WP Media Folder 开发人员文档
本文档将帮助经验丰富的开发人员使用我们的插件插入任何其他服务。 以下是该插件的所有操作和过滤器,如果您需要更多,请随时通过 专用论坛询问。 感谢您使用我们的插件!
助手文件
WP Media Folder 带有一个帮助文件,该文件具有将您的主题和插件集成到其中的主要功能。
- 将文件移到文件夹
- 建立资料夹
- 移动文件夹
- 获取文件夹中的附件
- ...
include('wp-content/plugins/wp-media-folder/helper.php');
\Joomunited\WPMediaFolder\Helper::createFolder('My new folder');
钩子
import_term_meta
导入术语元后触发。
参数:
int $term_id ID of the newly created term.string $key Meta key.mixed $value Meta value.
Return :
void
在文件中:
类/导入/class-wp-import.php第451行
wpmf_after_replace
替换文件后执行操作
参数:
integer Attachment ID
Return :
void
在文件中:
类/class-replace-file.php第227行
wpmf_attachment_set_folder
将附件移动到媒体管理器中的文件夹后设置附件文件夹此挂钩还可用于将附件导入到类别、上传附件后以及将多个文件夹分配给附件时
参数:
integer Attachment IDinteger|array Target folder or array of target foldersarray Extra informations
Return :
void
在文件中:
class/class-main.php line 818 class/class-main.php line 849 class/class-main.php line 2666 class/class-main.php line 3224 class/class-main.php line 4451 class/class-main.php line 5252 class/class-helper.php line 140 class/class-helper.php line 196 class/class-wp-folder-option.php line 396 class/class-wp-folder-option.php行3486
wpmf_before_delete_folder
删除文件夹之前
参数:
WP_Term Folder, this term is not available anymore as it as been deleted
Return :
void
在文件中:
class/class-main.php行3974 class/class-main.php行4351
wpmf_create_folder
从媒体库创建文件夹从 FTP 同步和导入文件、创建基于用户和角色的文件夹以及从 Nextgen Gallery 导入时也会使用此挂钩
参数:
integer Created folder IDstring Created folder nameinteger Parent folder IDarray Extra informations
Return :
void
在文件中:
class/class/class-main.php行2643 class/class-main.php行3481 class/class-main.php行3495 class/class-main.php line 3799 class/class-wp-folder-option.php line 3363
wpmf_delete_folder
删除资料夹
参数:
WP_Term Folder, this term is not available anymore as it as been deleted
Return :
void
在文件中:
class/class-main.php行3982 class/class-main.php行4360
wpmf_duplicate_attachment
复制附件
参数:
integer Attachment IDinteger Target folder
Return :
void
在文件中:
类/class-duplicate-file.php第104行
wpmf_移动_文件夹
从媒体库移动文件夹当角色文件夹选项更改时也会使用此挂钩
参数:
integer Folder moved IDstring Destination folder IDarray Extra informations
Return :
void
在文件中:
class/class-main.php行4548 class/class-wp-folder-option.php行2921
wpmf_update_folder_name
更新文件夹名称
参数:
integer Folder IDstring Updated name
Return :
void
在文件中:
class/class-main.php行3913 class/class-folder-post-type.php line 500
wpmf_update_folder_name
更新文件夹名称
参数:
integer Folder IDstring Updated name
Return :
void
在文件中:
class/class-main.php行3913 class/class-folder-post-type.php line 500
fallback_intermediate_image_sizes
过滤为非图像哑剧类型生成的图像大小。
参数:
array $fallback_sizes An array of image size names.array $metadata Current attachment metadata.
Return :
void
在文件中:
类/class-helper.php第312行
import_term_meta_key
筛选导入的术语meta的meta键。
参数:
string $meta_key Meta key.int $term_id ID of the newly created term.array $term Term data from the WXR import.
Return :
void
在文件中:
类/导入/class-wp-import.php第432行
wp_import_existing_post
与当前导入的帖子对应的现有帖子的过滤 ID。返回 0 强制导入帖子。 将 ID 过滤为其他内容以覆盖映射到导入帖子的现有帖子。
参数:
int $post_exists Post ID, or 0 if post did not exist.array $post The post array to be inserted.
Return :
void
在文件中:
类/导入/class-wp-import.php第505行
wp_import_term_meta
筛选附加到导入术语的元数据。
参数:
array $termmeta Array of term meta.int $term_id ID of the newly created term.array $term Term data from the WXR import.
Return :
void
在文件中:
类/导入/class-wp-import.php第416行
wpmf_gallery_enable_download
过滤以启用/禁用图库上的下载图像
参数:
boolean Enable/disable download image
Return :
boolean
在文件中:
类/class-display-gallery.php第472行
wpmf_gallery_query_args
过滤图库查询参数以获取图像。
参数:
array Gallery query arguments
Return :
array
在文件中:
类/class-display-gallery.php第410行
wpmf_get_categories_args
过滤到自定义参数以获取所有类别
参数:
array Agument
Return :
array
在文件中:
class/class-main.php行2125
wpmf_限制_文件夹
过滤器设置加载的文件夹数量限制
参数:
integer Limit folder number
Return :
integer
在文件中:
class/class-main.php行1616 class/class-folder-post-type.php行1769
wpmf_限制_文件夹
过滤器设置加载的文件夹数量限制
参数:
integer Limit folder number
Return :
integer
在文件中:
class/class-main.php行1616 class/class-folder-post-type.php行1769
wpmf_set_file_title
在将文件标题保存到数据库之前进行操作
参数:
string File title
Return :
string
在文件中:
class/class-main.php行5373
wpmf_taxonomy_public
过滤以更改公共参数 wpmf-category 分类
参数:
boolean Toxonomy public status
Return :
boolean
在文件中:
WP-Media-folder.php行1463
wpmf_user_can
筛选检查用户执行操作的能力
参数:
boolean The current user has the given capabilitystring Action name
Return :
boolean
在文件中:
wp-media-folder.php line 36 class/pages/settings/image_compression.php line 44 class/pages/settings/image_compression.php line 98 class/pages/settings/image_compression.php line 252 class/pages/settings/image_compression.php line 288 class/pages/settings/import_export.php line 159 class/pages/settings/import_export.php行332 class/class/class-main.php行1039 class /class/class-main.php class/class/class-main.php行1450 class/class-main.php line class/class/class/class-main.php line 2520 class/class-main.php line class/class/class/class/class/ class 348 class 348 class 348。 class/class-main.php line 3860 class/class-main.php line 4233 class/class-main.php line 4285 class/class-main.php line 4398 class/class-main.php line 4494 class/class-main.php line 4584 class/class-main.php line 4866 class/class-main.php line 4999 class/class-main.php line 5190 class/class-main.php line 5658 class/class-main.php line 5705 class/class-folder-access.php line 41 class/class-duplicate-file.php line 53 class/install-wizard/install-wizard.php line 54 class/class-image-watermark.php line 252 class/class-wp-folder-option.php line 263 class/class-wp-folder-option.php line 854 class/class-wp-folder-option.php line 1061 class/class-wp-folder-option.php line 1112 class/class-wp-folder-option.php line 1402 class/class-wp-folder-option.php line 1489 class/class-wp-folder-option.php line 2123 class/class-wp-folder-option.php line 3331 class/class-wp-folder-option.php line 4034 class/class-wp-folder-option.php line 4134 class/class-wp-folder-option.php line 4202 class/class-wp-folder-option.php line 4315 class/class-wp-folder-option.php line 4366 class/class-wp-folder-option.php行4414 class/class-replace-file.php行54 class/class-replace-file.php line 277
Composer
使用 WP CLI 以编程方式设置更新密钥
使用您用于安装 Composer 的相同密钥并执行此 Composer 命令来设置更新令牌 wp option update ju_user_token "YOUR_TOKEN"