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/import/class-wp-import.php 第 451 行
wpmf_after_replace
替换文件后执行操作
参数:
integer Attachment ID
Return :
void
在文件中:
类/class-replace-file.php第188行
wpmf_attachment_set_folder
在将附件移动到媒体管理器中的文件夹之后,设置附件文件夹在将附件
导入类别,附件上传之后以及
将多个文件夹分配给附件时,也使用此钩子
参数:
integer Attachment ID
integer|array Target folder or array of target folders
array Extra informations
Return :
void
在文件中:
类/class-main.php行763
类/class-main.php行794
类/class-main.php行2359
类/class-main.php行2912
类/class-main.php行4062
类/class-main .php 第 4862 行
class/class-helper.php 第 138 行
class/class-helper.php 第 194 行
class/class-wp-folder-option.php 第 379 行
class/class-wp-folder-option.php 第 3355 行
wpmf_before_delete_folder
删除文件夹之前
参数:
WP_Term Folder, this term is not available anymore as it as been deleted
Return :
void
在文件中:
类/class-main.php第3589行
类/class-main.php第3962行
wpmf_create_folder
从媒体库创建文件夹在
从FTP同步和导入文件,创建基于用户和角色的文件夹
以及从Nextgen Gallery导入时,也使用此钩子
参数:
integer Created folder ID
string Created folder name
integer Parent folder ID
array Extra informations
Return :
void
在文件中:
类/class-main.php 行 2336
类/class-main.php 行 3416
类/class-wp-folder-option.php 行 3232
wpmf_delete_folder
删除资料夹
参数:
WP_Term Folder, this term is not available anymore as it as been deleted
Return :
void
在文件中:
类/class-main.php第3596行
类/class-main.php第3971行
wpmf_duplicate_attachment
复制附件
参数:
integer Attachment ID
integer Target folder
Return :
void
在文件中:
class / class-duplicate-file.php第104行
wpmf_move_folder
从媒体库中移动文件
夹更改角色文件夹选项时,也会使用此挂钩
参数:
integer Folder moved ID
string Destination folder ID
array Extra informations
Return :
void
在文件中:
类/class-main.php行4158
类/class-wp-folder-option.php行2791
wpmf_update_folder_name
更新文件夹名称
参数:
integer Folder ID
string Updated name
Return :
void
在文件中:
类/class-main.php第3530行
fallback_intermediate_image_sizes
过滤为非图像哑剧类型生成的图像大小。
参数:
array $fallback_sizes An array of image size names.
array $metadata Current attachment metadata.
Return :
void
在文件中:
类/class-helper.php第310行
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/import/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/import/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/import/class-wp-import.php 第 416 行
wpmf_gallery_enable_download
过滤以启用/禁用图库上的下载图像
参数:
boolean Enable/disable download image
Return :
boolean
在文件中:
类/class-display-gallery.php第459行
wpmf_get_categories_args
过滤到自定义参数以获取所有类别
参数:
array Agument
Return :
array
在文件中:
类/class-main.php第1908行
wpmf_limit_folders
过滤以设置加载的文件夹数量限制
参数:
integer Limit folder number
Return :
integer
在文件中:
类/class-main.php第1412行
wpmf_set_file_title
在将文件标题保存到数据库之前进行操作
参数:
string File title
Return :
string
在文件中:
类/class-main.php第4983行
wpmf_taxonomy_public
过滤以更改公共参数 wpmf-category 分类
参数:
boolean Toxonomy public status
Return :
boolean
在文件中:
wp-media-folder.php 第 1488 行
wpmf_user_can
筛选检查用户执行操作的能力
参数:
boolean The current user has the given capability
string Action name
Return :
boolean
在文件中:
class/class-main.php 第 955 行
class/class-main.php 第 1219 行
class/class-main.php 第 1257 行
class/class-main.php 第 1426 行
class/class-main.php 第 2213
行.php 第2247行
class/class-main.php 第3043行
class/class-main.php 第3380行
class/class-main.php 第3477行
class/class-main.php 第3844行
class/class-main.php 第3896
行/class-main.php行4009
类/class-main.php行4104
类/class-main.php行4194
类/class-main.php行4476
类/class-main.php行4609类
/class-main。 php行4800
类/class-main.php行5262
类/class-main.php行5309
类/class-duplicate-file.php行53
类/class-folder-access.php行41类
/安装向导/安装-wizard.php第54行
class/class-wp-folder-option.php第263行
class/class-wp-folder-option.php第782行
class/class-wp-folder-option.php第986行
class/class-wp -folder-option.php第1037行
class/class-wp-folder-option.php第1312行
class/class-wp-folder-option.php第1394
行class/class-wp-folder-option.php第2008行
class/class -wp-folder-option.php行3200
类/class-wp-folder-option.php行3903
类/class-wp-folder-option.php行4003
类/class-wp-folder-option.php行4071
类/class-wp-folder-option.php 第 4184 行
class/class-wp-folder-option.php 第 4235 行
class/class-wp-folder-option.php 第 4283
行 class/class-replace-file.php 第 45
行/class-replace-file.php 第 220 行
class/class-image-watermark.php 第 209 行
class/pages/settings/image_compression.php 第 44 行
class/pages/settings/image_compression.php 第 98 行
class/pages/settings/image_compression .php 第 252 行
class/pages/settings/image_compression.php 第 288 行
class/pages/settings/import_export.php 第 151 行
class/pages/settings/import_export.php 第 324 行
wp-media-folder.php 第 36 行
Composer
使用 WP CLI 以编程方式设置更新密钥
使用您用于安装 Composer 的相同密钥并执行此 Composer 命令来设置更新令牌
wp option update ju_user_token "YOUR_TOKEN"