WPML
apply_filters( 'wpml_element_type', string $element_type )
类型
filter
类别
杂项
WPML 版本
3.2

说明

过滤 WordPress 元素类型(文章类型、分类法术语、评论),方法是添加 WPML 前缀 ‘post_’、'tax_’(对于默认标签使用 ‘post_tag’),或者对于 ‘comment’ 不添加前缀,正如 icl_translations 数据库表中所使用的那样。

参数

$element_type
(字符串)(必填) 接受 comment, post, page, attachment, nav_menu_item, {custom post key}, nav_menu, category, post_tag, {custom taxonomy key}

使用示例

示例
//$wpml_element_type will return 'post_attachment'
$wpml_element_type = apply_filters( 'wpml_element_type', 'attachment' );

icl_ls_languages, wpml_sync_custom_field_copied_value, wpml_ls_enable_ajax_navigation, wpml_setting, wpml_sub_setting, wpml_exclude_post_from_auto_translate, wpml_forms_config_ninja-forms, wpml_forms_config_wpforms, wpml_tf_feedback_open_link, wpml_translatable_user_meta_fields

所有 30 个 杂项 钩子 →