apply_filters( 'wpml_sub_setting', mixed|bool $default, string $key, string $sub_key )
- 类型
- filter
- 类别
- 杂项
- WPML 版本
- 3.2
说明
返回 WPML 子设置的值。
参数
- $default
- (mixed|bool) (必填) 如果设置键不存在则返回的值。如果不使用,请设置为 false
- $key
- (字符串) (必填) 子键所属的设置名称键
- $sub_key
- (字符串) (必填) 要返回其值的子键
使用示例
示例
// $my_book_translation_option will return the translation option configured for the custom post type 'book' $my_book_translation_option = apply_filters( 'wpml_sub_setting', false, 'custom_posts_sync_option', 'book' ); // $my_author_translation_option will return the translation option configured for the custom taxonomy 'author' $my_author_translation_option = apply_filters( 'wpml_sub_setting', false, 'taxonomies_sync_option', 'author' );
相关钩子
icl_ls_languages, wpml_sync_custom_field_copied_value, wpml_ls_enable_ajax_navigation, wpml_element_type, wpml_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