WordPress action hook

wpml_register_string

Fired by 25 WordPress plugins, running on 1.8M+ sites between them.

“To register the string in wpml”

How to use wpml_register_string

It's an action: your callback runs at that point and receives 5 arguments. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'wpml_register_string', function( $data, $arg2, $package, $html__, $arg5 ) {
	// Your code runs here.
}, 10, 5 );

Argument names come from Custom Post Type UI's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

25 plugins that fire wpml_register_string

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Custom Post Type UI icon Custom Post Type UI1+ million installs do_action( 'wpml_register_string', $data['label'], 'name', $package, esc_html__( 'Name (plural)', 'custom-post-type-ui' ), 'LINE' ) external/wpml.php:78
  2. SureForms icon SureForms500,000+ installs do_action( 'wpml_register_string', $value, $name, $package, '' !== $title ? $title : $name, $type ) inc/compatibility/multilingual/providers/wpml-provider.php:293
  3. WPML Multilingual & Multicurrency for WooCommerce icon WPML Multilingual & Multicurrency for WooCommerce100,000+ installs do_action( 'wpml_register_string', $string, $key, $package, sprintf( '%s %s', $string, ucfirst( $element ) ), $package->kind ) compatibility/WcCheckoutAddons/class-wcml-checkout-addons.php:48
  4. Ditty icon Ditty30,000+ installs do_action( 'wpml_register_string', $title, "ditty_title", $package, 'ditty_title', 'LINE' ) includes/translators/wpml.php:58
  5. NotificationX icon NotificationX30,000+ installs do_action( 'wpml_register_string', $value, $key, $package, $title, $type ) includes/ThirdParty/WPML.php:151
  6. Advanced Coupons for WooCommerce icon Advanced Coupons for WooCommerce20,000+ installs do_action( 'wpml_register_string', $t['value'], Plugin_Constants::META_PREFIX . $t['name'], $package, $t['label'], $t['type'] ) Models/Third_Party_Integrations/WPML_Support.php:284
  7. Wholesale Suite icon Wholesale Suite20,000+ installs do_action( 'wpml_register_string', $value, $option, $package, $title, $package['kind'] ) includes/class-wwp-wholesale-prices.php:2457
  8. MB Custom Post Types & Custom Taxonomies icon MB Custom Post Types & Custom Taxonomies10,000+ installs do_action( 'wpml_register_string', $settings['labels'][ $key ] ?? '', 'label_' . $key, $package, sprintf( '%s: %s', $post->post_title, $label ), 'LINE' ) src/Integrations/WPML/PostType.php:68
  9. Shiptastic for WooCommerce icon Shiptastic for WooCommerce10,000+ installs do_action( 'wpml_register_string', $value, self::get_shipping_provider_string_id( $string_name, $provider ), self::get_shipping_provider_string_package( $string_name, $provider ), $title, 'AREA' ) src/Compatibility/WPML.php:170
  10. WS Form LITE icon WS Form LITE10,000+ installs do_action( 'wpml_register_string', $string_value, $string_name, $this->get_package_object($form_id, $form_label), $string_title, $this->ws_form_type_convert($type) ) includes/third-party/wpml/class-ws-form-wpml.php:336
  11. WPML Multilingual for BuddyPress and BuddyBoss icon WPML Multilingual for BuddyPress and BuddyBoss6,000+ installs do_action( 'wpml_register_string', wp_unslash( $value ), $name, $package, $name, 'LINE' ) includes/class.groupTypes.php:107
  12. Themify Builder icon Themify Builder6,000+ installs do_action( 'wpml_register_string', $field['value'], self::$package_data['post_id'] . '/' . $element_id . '/' . $field['id'], self::$package_data, isset( $field['title'] ) ? $field['title'] : '', isset( $field['type'] ) ? $field['type'] : 'LINE' ) includes/plugin-compat/wpml-translation.php:1654
  13. Ajaxify Comments icon Ajaxify Comments3,000+ installs do_action( 'wpml_register_string', $label_value, $label_key, array( 'kind' => 'Ajaxify', 'name' => 'ajaxify-comments-labels', 'title' => 'Ajaxify Comment Labels', ), $label_key, 'line' ) php/Admin/Init.php:265
  14. ELEX WooCommerce Product Price Custom Text (Before & After Text) and Discount icon ELEX WooCommerce Product Price Custom Text (Before & After Text) and Discount2,000+ installs do_action( 'wpml_register_string', $string_to_translate, $name, $package, $name, 'LINE' ) includes/SettingsController.php:135
  15. MyRewards icon MyRewards2,000+ installs do_action( 'wpml_register_string', $this->title, 'title', $this->getPackageWPML(true), __("Title", 'woorewards-lite'), 'LINE' ) include/abstracts/event.php:890
  16. Multilingual Forms for Fluent Forms with WPML icon Multilingual Forms for Fluent Forms with WPML2,000+ installs do_action( 'wpml_register_string', $message, $translationKey, $this->package, 0, $type ) src/Controllers/GlobalSettingsController.php:199
  17. Events Manager and WPML Compatibility icon Events Manager and WPML Compatibility1,000+ installs do_action( 'wpml_register_string', $EM_Ticket->ticket_name, 'ticket_name_'.$EM_Ticket->ticket_id, $package, $ticket_label_prefix.esc_html__('Name', 'events-manager'), 'LINE' ) em-wpml-io.php:268
  18. Quform WPML icon Quform WPML700+ installs do_action( 'wpml_register_string', Quform::get($config, 'title', ''), 'form_title', $package, 'Form title', 'LINE' ) library/Quform/WPML/FormTranslator.php:34
  19. SaveTo Wishlist Lite icon SaveTo Wishlist Lite600+ installs do_action( 'wpml_register_string', $translatable_string['value'], $translatable_string['name'], $package, $translatable_string['label'], $translatable_string['type'] ) Classes/Integrations/WPML_Support.php:173
  20. Directorist icon Directorist300+ installs do_action( 'wpml_register_string', $string['value'], $string['name'], $package, $string['title'], $string['type'] ) app/Controller/Hook/Admin_Text_Translation.php:1044
  21. ELEX WordPress HelpDesk & Customer Ticketing System icon ELEX WordPress HelpDesk & Customer Ticketing System200+ installs do_action( 'wpml_register_string', $string_value, $string_name, $package, $string_title, $string_type ) includes/class-crm-public-functions.php:4911
  22. Bizdesire Advanced Connector for Hostaway icon Bizdesire Advanced Connector for Hostaway80+ installs do_action( 'wpml_register_string', $value, $name, array('domain' => self::TEXT_DOMAIN) ) includes/class-hostaway-i18n.php:96
  23. Integration for Breakdance and WPML icon Integration for Breakdance and WPML20+ installs do_action( 'wpml_register_string', $fieldValue, $stringId, $package, $field['title'], $field['editor_type'] ) src/Components/BuilderIntegration/StringTranslation.php:155
  24. Validation Muse for Contact Form 7 icon Validation Muse for Contact Form 710+ installs do_action( 'wpml_register_string', $value, $name, array( 'domain' => 'validation-muse-for-contact-form-7' ), $name, 'LITE' ) includes/class-vmcf7-i18n-compat.php:93
  25. Radas Options Page icon Radas Options PageFewer than 10 installs do_action( 'wpml_register_string', $field->get_sanitized_value(), $field->id, $this->get_wpml_package_kind(), $field->label, $type ) admin/option-page.php:325

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.