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行330
wpmf_attachment_set_folder
将附件移动到媒体管理器中的文件夹后设置附件文件夹此挂钩还可用于将附件导入到类别、上传附件后以及将多个文件夹分配给附件时
参数:
integer Attachment IDinteger|array Target folder or array of target foldersarray Extra informations
Return :
void
在文件中:
class/class-wp-folder-option.php line 400 class/class-wp-folder-option.php line 3503 class/class-main.php line 819 class/class-main.php line 850 class/class-main.php line 2667 class/class-main.php line 3225 class/class-main.php line 4452 class/class-main.php line 5253 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行3975 class/class-main.php行4352
wpmf_create_folder
从媒体库创建文件夹从 FTP 同步和导入文件、创建基于用户和角色的文件夹以及从 Nextgen Gallery 导入时也会使用此挂钩
参数:
integer Created folder IDstring Created folder nameinteger Parent folder IDarray Extra informations
Return :
void
在文件中:
class/class-wp-folder-option.php行3380 class/class-main.php行2644 class/class-main.php行3482 class/class-main.php line 3496 class/class-main.php line 3800
wpmf_delete_folder
删除资料夹
参数:
WP_Term Folder, this term is not available anymore as it as been deleted
Return :
void
在文件中:
class/class-main.php行3983 class/class-main.php行4361
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-wp-folder-option.php行2938 class/class-main.php行4549
wpmf_update_folder_name
更新文件夹名称
参数:
integer Folder IDstring Updated name
Return :
void
在文件中:
class/class-main.php行3914 class/class-folder-post-type.php line 500
wpmf_update_folder_name
更新文件夹名称
参数:
integer Folder IDstring Updated name
Return :
void
在文件中:
class/class-main.php行3914 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行2126
wpmf_限制_文件夹
过滤器设置加载的文件夹数量限制
参数:
integer Limit folder number
Return :
integer
在文件中:
class/class-main.php行1617 class/class-folder-post-type.php行1769
wpmf_限制_文件夹
过滤器设置加载的文件夹数量限制
参数:
integer Limit folder number
Return :
integer
在文件中:
class/class-main.php行1617 class/class-folder-post-type.php行1769
wpmf_set_file_title
在将文件标题保存到数据库之前进行操作
参数:
string File title
Return :
string
在文件中:
class/class-main.php行5374
wpmf_taxonomy_public
过滤以更改公共参数 wpmf-category 分类
参数:
boolean Toxonomy public status
Return :
boolean
在文件中:
WP-Media-folder.php行1558
wpmf_user_can
筛选检查用户执行操作的能力
参数:
boolean The current user has the given capabilitystring Action name
Return :
boolean
在文件中:
class/class-duplicate-file.php行53类/页/settings/import_export.php行159 class/pages/pages/stastings/import_export.php行332 class/pages/pages/pages/image_compression.php line 44 class/class/pages/pages/pages/pages/pags/image_compression.php lines/pap class/pep line.php line class/pags line 252 class/pages/settings/image_compression.php行288 class/class-wp-folder-option.php行263 class/class-wp-folder-option.php行871 class/class-wp-folder-option.php class/class-wp-folder-option.php 1078 class/class-wp-folder-option.php行112929292929292929292929292929292929292929292929292929292929292-9 class/class-wp-folder-option.php line 1506 class/class-wp-folder-option.php line 2140 class/class-wp-folder-option.php line 3348 class/class-wp-folder-option.php line 4051 class/class-wp-folder-option.php line 4151 class/class-wp-folder-option.php line 4219 class/class-wp-folder-option.php line 4332 class/class-wp-folder-option.php line 4383 class/class-wp-folder-option.php line 4431 class/class-folder-access.php line 41 class/class-image-watermark.php line 252 class/class-main.php line 1040 class/class-main.php line 1412 class/class/class-main.php行1451 class/class-main.php行1631 class/class-main.php行2521 class /class/class-main.php行2555 class/class-main.php行3357 class/class /class-main.php line 3749 class/class-main.php行4399 class/class-main.php行4495 class/class-main.php行4585 class/class/class-main.php行4867 class/class/class-main.php行5000 class/class /class-main.php行5191 class/class/class/class/class/class/class/class/class/class/class/class/class 5659 54 class/class-replace-file.php行53 class/class-replace-file.php行377 WP-MEDIA-FOLDER.PHP LINE 36
Composer
使用 WP CLI 以编程方式设置更新密钥
使用您用于安装 Composer 的相同密钥并执行此 Composer 命令来设置更新令牌 wp option update ju_user_token "YOUR_TOKEN"