WPML
SignaturePHP
add_action( 'wpml_update_active_languages', callable $function_to_add );

Description

Run your custom function when a new language is added or deleted.

Arguments

  • $function_to_addcallableRequired

    Your callback function to run on this action.

Example Usage

PHP
/**
 * Run this function when active languages are updated.
 * 
 * @param array $old_active_languages An array of the languages before updating.
 * @return void 
 */
function wpml_update_active_languages_callback( $old_active_languages ) {
	// To get latest languages after updating use this hook https://wpml.org/wpml-hook/wpml_active_languages/ 
}
add_action('wpml_update_active_languages', 'wpml_update_active_languages_callback');