add_action( 'wpml_tm_loaded', callable $function_to_add );
- Type
- action
- Category
- Miscellaneous
- WPML Version
- 3.2.1
Description
- To make sure a WPML Translation Management dependent code is executed at the right time, this code should be hooked into the
wpml_tm_loadedaction. This action is called after WPML Translation Management is fully configured and loaded. - If we do not hook into this
wpml_tm_loaded, sometimes the WPML Translation Management dependent code might be called too early. Then even if WPML Translation Management is active and configured, we may not get expected results. wpml_tm_loadedis executed during the plugins_loaded and wpml_loaded actions.- There is a similar hook for WPML Translation Management wpml_st_loaded.
Arguments
- $function_to_add
- (callable) (Required) Your callback to be run when the filter is applied.
Example usage
Example
function my_plugin_wpml_tm_code() {
// Run WPML Translation Management dependent actions
// These actions will be executed right after WPML Translation Management is fully configured and loaded.
}
add_action( 'wpml_tm_loaded', 'my_plugin_wpml_tm_code' );
Related hooks
icl_ls_languages, wpml_sync_custom_field_copied_value, wpml_ls_enable_ajax_navigation, wpml_element_type, wpml_setting, wpml_sub_setting, wpml_exclude_post_from_auto_translate, wpml_forms_config_ninja-forms, wpml_forms_config_wpforms, wpml_tf_feedback_open_link