change_locale action-hook . WP 4.7.0
Fires when the locale is switched to or restored.
Usage
add_action( 'change_locale', 'action_function_name_5708' ); function action_function_name_5708( $locale ){ // action... }
- $locale(string)
- The new locale.
Changelog
Since 4.7.0 | Introduced. |
Where the hook is called
change_locale
wp-includes/class-wp-locale-switcher.php 235
do_action( 'change_locale', $locale );
Where in WP core the hook is used WordPress
wp-includes/class-wp-locale-switcher.php 499
add_action( 'change_locale', 'create_initial_post_types' );
wp-includes/class-wp-locale-switcher.php 535
add_action( 'change_locale', 'create_initial_taxonomies' );