There is a filter you can use, but it is well hidden. Take a look at the WordPress function __
. As you can see it calls another function, translate
. And there it is, a filter called gettext
. You can use it to intercept any (translated) text that is run through __
.
Basically, what you do is overwrite the translation, which will be the same as the original text if no translation is available for the current language. Like this:
add_filter ('gettext','wpse305425_change_string',10,3);
function wpse305425_change_string ($translation, $text, $domain) {
if ($text == 'I consent to ...') $translation = 'your text';
return $translation;
}
Related Posts:
- Pass A Value From Outside To A Plugin Variable
- Failed to invoke other hook from the init hook
- How can I filter blog name?
- Determine plugin name from within plugin_action_links filter
- merging an array to an existing array using add_filter
- Get Time Taken By Each Action Hook in WordPress
- Add hook after content without formatting
- Passing a parameter to filter and action functions
- Get a list of all registered actions
- How can I edit post data before it is saved?
- How to only hook on Single.php after content?
- Customizing subject in comment notification e-mails
- How to save the values of checkbox to the register setting?
- Using add_filter inside another class
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- How to list the Hooks and order of execution in current loading page? [duplicate]
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- Hide WordPress Plugin Deactivation Links
- Built in admin ajax hooks?
- Does the ‘nav_menu_css_class’ filter accept 2 or 3 arguments?
- Adding dynamic section to WordPress
- do_action and hook methods
- why does the add_action(‘the_content’) overwrite my page
- Fatal error: Class not found in
- Is it possible to add an action to the currently running action?
- How to filter content post only on save
- Filter or action hook to insert content on admin pages before tag
- Why load_textdomain work but not load_plugin_textdomain?
- Showing Notifications While Activating Plugin
- Language Translation is not working?
- plugin_action_links_{$plugin_file} hook not in the main plugin file
- OOP: Display warning and deactivate the plugin if PHP version is less than 5.4
- Add Fields with Sub-Fields to WP Job Manager
- How to prevent action in ajax request, when in admin side?
- template_redirect not being called when using ajax
- What are the benefit in adding hook in the init() hook?
- Reposition Woocommerce Message
- add_action in functions.php, do_action in plugin?
- How to correctly detect accessing wp-content/uploads?
- load_theme_textdomain path
- How to pull code snippet from functionality plugin?
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- Any hook for pre-plugin-update -either bulk or single plugin update
- How to find the origin of a file upload from within wp_handle_upload?
- How to get all of the activate_plugin action parameters?
- Modifying the comments section through a plugin regardless of theme
- Using a post-signup hook to get user details
- White page by using filter template_include
- Passing an array from shortcode-function to filter-function
- Filtering WooCommerce Orders by Category
- Force language in translate function
- do_action() hook into load-(page)
- Howto check version of another plugin and then add a submenu page to it
- Proper way to replace the_content only for pages created by custom plugin
- add_filter doesn’t work
- Add sub menu page in your plugin
- Check if variable is set in filter
- Check filter defined or not?
- remove_action not removing add_action from constructor
- How to use filter to disable adding a product to wishlist?
- Save user total active time after login in wordpress [closed]
- wp_loaded with static Singleton
- is it possible to hook every page style?
- Add a function call after content automatically?
- what is the point of telling add_filter how many parameters you want passed to the function?
- How to add filter for wordpress plugin?
- How to use add_action for multiple instances of the same class
- How to hook into action/filter call
- using wp_footer hook in a plugin
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- How to automatically activate users after registration without activation email?
- Want to create custom design of progress indicator in wpforms
- Use a hook or filter, or overwrite this Gamipress function?
- admin_post hook not firing function inside class
- Unpublished Pages Failing To Appear On Custom Path
- When/where would want to attach other classes to the base class in a WordPress plugin?
- Plugin function in child theme
- Use action, filter, or hook to append HTML to WordPress plugin function
- Passing function into add_action always returns the first argument
- Hook to display element as product on category page
- Remove action added in plugin class from theme
- Using multi-dimensional array with filter
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- plugin not hooking to my custom hook
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- Passing a parameter to filter and action functions
- Change localization only for plugin
- shortcode which is introduced into entry the blog, and appears in side bar
- Plugin hook breaks new WP 4.0 media library grid view?
- Plugin Hook: Get posts
- Display_rows() and column_cb() strange behaviour
- Checking url from plugin [duplicate]
- add query string to all pages after user logged in
- How wordpress plugin hooks works? [duplicate]
- Post curl function save twice using plugin hook function wordpress
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- WordPress Hooks : Where to place callbacks that repetitively yield the same effect?
- Unable to pass arguments from plugin form to filter hook using ajax, the data is transferring via ajax but unable to pass as arguments in filter hooks
- How to Add Extra Text In WordPress Title Before Post Publish
- Why is my activator class adding the files/running the actions I add?