AI Translation For TranslatePress 2.1.0 has 6 actions and 37 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when AI Translation For TranslatePress fires an action
add_action( 'cpfm_register_notice', function() {
// Your code runs here.
}, 10, 1 );
// Change a value AI Translation For TranslatePress is about to use
add_filter( 'trp_machine_translated_slug', function( $sanitized_slug, $value, $language_code, $translated_strings, $arg5 ) {
// Change $sanitized_slug here.
return $sanitized_slug;
}, 10, 5 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
cpfm_register_notice
action/** * Allow other plugins to register notices dynamically. Example usage in other * plugins: do_action('cpf_cpfm_register_notice', 'crypto', [ 'title' => * 'Crypto Plugin Notice', 'message' => 'This is a crypto dashboard setup * notice.', 'pages' => ['dashboard', 'cpfm_'], ]); */ do_action( 'cpfm_register_notice' ); -
trp_machine_translated_slug
filter/** * Filters a machine-translated slug right before it is saved to the database. */ apply_filters( 'trp_machine_translated_slug', $sanitized_slug, $value['original_slug_name'], $language_code, $translated_strings[ $key ], ( isset( $value['type'] ) ? $value['type'] : '' ) ); -
/** * Filter the language that the sitemap URL is considered to be for. Used by * Multiple Domains addon to detect language from URL domain. */ apply_filters( 'trp_sitemap_url_original_language', $original_language, $url['loc'], $settings ); -
apply_filters( 'trp_disable_languages_sitemap', false ); -
trp_hreflang
filterapply_filters( 'trp_hreflang', $hreflang, $language ); -
trp_is_rest_api
filterapply_filters( 'trp_is_rest_api', false, $current_url_with_domain ); -
apply_filters( 'trp_add_language_url_to_sitemap', true, $language, $url, $output ); -
apply_filters( 'trp_is_admin_link_for_request_uri', false, $current_url ); -
apply_filters( 'trp_translate_slugs_on_internal_links', $url, $TRP_LANGUAGE ); -
trp_translating_capability
filterapply_filters( 'trp_translating_capability', 'manage_options' ); -
do_action( "cpfm_after_opt_in_{$plugin_name}", $category ); -
tpa_display_admin_notices
actiondo_action( 'tpa_display_admin_notices' ); -
tpa_editor_extra_data
filterapply_filters( 'tpa_editor_extra_data', $extra_data ); -
apply_filters( 'tpa_should_load_bundled_seo_pack', true ); -
apply_filters( 'trp_add_country_hreflang_tags', true ); -
apply_filters( 'trp_add_region_independent_hreflang_tags', true ); -
apply_filters( 'trp_allow_redirect_to_translated_url', true, $current_url_with_domain ); -
trp_before_based_slug_save
actiondo_action( 'trp_before_based_slug_save', $type, $all_strings ); -
apply_filters( 'trp_do_not_translate_these_slugs_of_type_other_with_at', array( 'feed' ) ); -
apply_filters( 'trp_editor_get_posts_excluded_statuses', [ "'auto-draft'", "'inherit'" ] ); -
apply_filters( 'trp_enable_gettext_slugs_translation', false ); -
apply_filters( "trp_exclude_{$type}_from_translation", array() ); -
apply_filters( 'trp_filter_post_type_base_slugs_from_automatic_translation', true, $post_type_string ); -
apply_filters( 'trp_filter_url_sitemap_before_output', $url ); -
trp_is_admin_link
filterapply_filters( 'trp_is_admin_link', $is_admin_link, $url, $admin_url, $wp_login_url ); -
trp_is_form_for_request_uri
filterapply_filters( 'trp_is_form_for_request_uri', $is_form_request, $current_url_with_domain ); -
trp_machine_translate_slug
filterapply_filters( 'trp_machine_translate_slug', false ); -
trp_redirect_status
filterapply_filters( 'trp_redirect_status', 301, 'redirect_to_translated_slug' ); -
apply_filters( 'trp_redirect_to_translated_slug_url', $this->redirect_to_url ); -
trp_schema_node_keys
filterapply_filters( 'trp_schema_node_keys', array( 'name', 'description', 'text' ) ); -
apply_filters( 'trp_seo_pack_post_get_gettext_slugs', $this->gettext_slugs ); -
apply_filters( 'trp_seo_pack_pre_get_gettext_slugs', $this->gettext_slugs ); -
apply_filters( 'trp_seo_pack_set_type_slug_for_gettext_slug', $item['type'], $slugs_domain, $slug, $slugs_details ); -
apply_filters( 'trp_should_defer_internal_link_translation_hooks', true ); -
apply_filters( 'trp_show_inactive_slugs_in_editor', true, $type ); -
apply_filters( "trp_string_translation_query_args_{$this->type}", $query_args, $sanitized_args ); -
apply_filters( "trp_to_translate_{$type}_slugs_array", $return, $type, $include_labels ); -
apply_filters( 'trp_translatable_slug_hooks_array', [ 'post_type_link', 'page_link', 'post_link', 'post_type_archive_link', 'term_link', 'get_pagenum_link', 'attachment_link', 'woocommerce_get_cart_url', 'woocommerce_get_endpoint_url', 'woocommerce_get_checkout_url', 'woocommerce_cart_item_permalink' ] ); -
trp_translate_other_slugs
filterapply_filters( 'trp_translate_other_slugs', true, $current_url ); -
trp_translated_request_uri
actiondo_action( 'trp_translated_request_uri', $new_request_uri, $url ); -
trp_update_{$type}_slug
actiondo_action( "trp_update_{$type}_slug", $slug, $language, $update_slugs ); -
apply_filters( 'trp_xml_sitemap_output_for_url', $new_output, $output, $settings, $alternate, $all_lang_urls, $url );
Generated from AI Translation For TranslatePress's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Can't find the right hook?
We can build the customisation for you. Describe what you need: