- availability:
-
WPML Version: 4.5.0
- description:
-
Run your custom function when a new language is added or deleted.
- type:
- action
- category:
- Site-Wide Language Information
- parameters:
-
add_action( 'wpml_update_active_languages', callable $function_to_add );
- $function_to_add
- (callable) (Required) Your callback function to run on this action.
- hook example usage:
-
Example
/** * 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');