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/class-replace-file.php行388
wpmf_attachment_set_folder
将附件移动到媒体管理器中的文件夹后设置附件文件夹此挂钩还可用于将附件导入到类别、上传附件后以及将多个文件夹分配给附件时
参数:
integer Attachment IDinteger|array Target folder or array of target foldersarray Extra informations
Return :
void
在文件中:
class/class-main.php line 822 class/class-main.php line 853 class/class-main.php line 2670 class/class-main.php line 3228 class/class-main.php line 4455 class/class-main.php line 5256 class/class-wp-folder-option.php line 400 class/class-wp-folder-option.php line 3505 class/class-helper.php行140 class/class-helper.php系列196
wpmf_before_delete_folder
删除文件夹之前
参数:
WP_Term Folder, this term is not available anymore as it as been deleted
Return :
void
在文件中:
class/class-main.php行3978 class/class-main.php行4355
wpmf_create_folder
从媒体库创建文件夹从 FTP 同步和导入文件、创建基于用户和角色的文件夹以及从 Nextgen Gallery 导入时也会使用此挂钩
参数:
integer Created folder IDstring Created folder nameinteger Parent folder IDarray Extra informations
Return :
void
在文件中:
class/class-main.php行2647 class/class-main.php行3485 class/class-main.php line 3499 class/class-main.php行3803 class/class-wp-folder-option.php line 3382
wpmf_delete_folder
删除资料夹
参数:
WP_Term Folder, this term is not available anymore as it as been deleted
Return :
void
在文件中:
class/class-main.php行3986 class/class-main.php行4364
wpmf_duplicate_attachment
复制附件
参数:
integer Attachment IDinteger Target folder
Return :
void
在文件中:
class/class-duplate-file.php行118
wpmf_移动_文件夹
从媒体库移动文件夹当角色文件夹选项更改时也会使用此挂钩
参数:
integer Folder moved IDstring Destination folder IDarray Extra informations
Return :
void
在文件中:
class/class-main.php行4552 class/class-wp-folder-option.php行2940
wpmf_update_folder_name
更新文件夹名称
参数:
integer Folder IDstring Updated name
Return :
void
在文件中:
class/class-main.php行3917 class/class-folder-post-type.php line 500
wpmf_update_folder_name
更新文件夹名称
参数:
integer Folder IDstring Updated name
Return :
void
在文件中:
class/class-main.php行3917 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行2129
wpmf_限制_文件夹
过滤器设置加载的文件夹数量限制
参数:
integer Limit folder number
Return :
integer
在文件中:
class/class-main.php行1620 class/class-folder-post-type.php行1769
wpmf_限制_文件夹
过滤器设置加载的文件夹数量限制
参数:
integer Limit folder number
Return :
integer
在文件中:
class/class-main.php行1620 class/class-folder-post-type.php行1769
wpmf_set_file_title
在将文件标题保存到数据库之前进行操作
参数:
string File title
Return :
string
在文件中:
class/class-main.php行5377
wpmf_taxonomy_public
过滤以更改公共参数 wpmf-category 分类
参数:
boolean Toxonomy public status
Return :
boolean
在文件中:
wp-media-folder.php行1559
wpmf_user_can
筛选检查用户执行操作的能力
参数:
boolean The current user has the given capabilitystring Action name
Return :
boolean
在文件中:
wp-media-folder.php line 36 class/class-replace-file.php line 53 class/class-replace-file.php line 435 class/class-main.php line 1043 class/class-main.php line 1415 class/class-main.php line 1454 class/class-main.php line 1634 class/class-main.php line 2524 class/class-main.php line 2558 class/class-main.php line 3360 class/class-main.php line 3752 class/class-main.php line 3864 class/class-main.php line 4237 class/class-main.php line 4289 class/class-main.php line 4402 class/class-main.php line 4498 class/class-main.php line 4588 class/class-main.php line 4870 class/class-main.php line 5003 class/class-main.php line 5194 class/class-main.php line 5662 class/class-main.php line 5709 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 line 332 class/class-duplicate-file.php line 53 class/class-folder-access.php line 41 class/class-wp-folder-option.php line 263 class/class-wp-folder-option.php line 871 class/class-wp-folder-option.php line 1078 class/class-wp-folder-option.php line 1129 class/class-wp-folder-option.php line 1421 class/class-wp-folder-option.php line 1508 class/class-wp-folder-option.php line 2142 class/class-wp-folder-option.php line 3350 class/class-wp-folder-option.php line 4053 class/class-wp-folder-option.php line 4153 class/class-wp-folder-option.php line 4221 class/class-wp-folder-option.php line 4334 class/class-wp-folder-option.php line 4385 class/class-wp-folder-option.php行4433 class/install-wizard/install-wizard.php line 54 class/class-image-watermark.php行252
Composer
使用 WP CLI 以编程方式设置更新密钥
使用您用于安装 Composer 的相同密钥并执行此 Composer 命令来设置更新令牌 wp option update ju_user_token "YOUR_TOKEN"