availability:

WPML Version: 3.2

description:

Returns a WPML sub setting value.

Attention

  • This hook is temporarily broken in WPML 3.3.6. We are working on it to fix this issue.
  • Currently you can use this hook wpml_setting for the same purpose.
  • Example:
    // Example: I need to get sub setting "font-current-normal" of "icl_lang_sel_config"
    
    $switcher = apply_filters( 'wpml_setting', false, 'icl_lang_sel_config' );
    echo $switcher['font-current-normal']; 
    
type:
filter
category:
Miscellaneous
parameters:
apply_filters( 'wpml_sub_setting', mixed|bool $default, string $key, string $sub_key )
$default
(mixed|bool) (Required) The value to return if the settings key does not exist. Set to false if not using
$key
(string) (Required) The settings name key the sub key belongs to
$sub_key
(string) (Required) The sub key to return the value of
hook example usage:

Example

// $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' );