WPML
wpml_apply_save_attachment_actions
类型
filter
类别
更新内容
WPML 版本
4.4.0

说明

当返回 true 时,WPML 将同步附件及其翻译(状态、分类项、自定义字段)。

参数

一个布尔值,用于决定是否启用同步(默认值:false


$post_id

(整数)正在处理的附件 ID。

使用示例

/**
* @param bool $isEnabled
* @param int $postId
*/
function myplugin_apply_save_attachment_actions( $isEnabled, $postId ) {
    return true;
}
add_filter( 'wpml_apply_save_attachment_actions', 'myplugin_apply_save_attachment_actions', 10, 2 );

wpml_set_translation_mode_for_post_type, wpml_st_force_translate_admin_options

所有 3 个 更新内容 钩子 →