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
- Change permalink structure hidden button edit
- How to pull code snippet from functionality plugin?
- Where (or when) should I register a new taxonomy?
- 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
- Inserting above the comment template
- Creating a plugin to sanitize comment and the url field before display only
- 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
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- Using a post-signup hook to get user details
- White page by using filter template_include
- How to check current user before all actions and filters?
- Create a navbar filter that filters by a custom field
- Passing an array from shortcode-function to filter-function
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Filtering WooCommerce Orders by Category
- qTranslate remove default directory from link
- 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
- How to change the name of the “edit my profile” link in the WordPress admin backend
- Proper way to replace the_content only for pages created by custom plugin
- add_filter doesn’t work
- Redirect to another page using contact form 7? [closed]
- Template filter for custom taxonomy terms
- Add sub menu page in your plugin
- Check if variable is set in filter
- What exactly happens to function argument availability when using a filter?
- Check filter defined or not?
- remove_action not removing add_action from constructor
- Hook for page Request?
- How to use the pre_option filter before a plugin loads?
- How do I add $_SESSION[”] to my wordpress page?
- How to use filter to disable adding a product to wishlist?
- Save user total active time after login in wordpress [closed]
- WordPress: Add custom add_filter for custom functions
- wp_loaded with static Singleton
- is it possible to hook every page style?
- Add a function call after content automatically?
- Hook for altering the content of all wp mails
- 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
- Quick press publish post hook
- 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 deactivate my plugin upon deactivation of NextGen
- How to automatically activate users after registration without activation email?
- Creating a plugin that will display text on every page
- Want to create custom design of progress indicator in wpforms
- Activation flow of a plugin in a multisite environment
- Use a hook or filter, or overwrite this Gamipress function?
- admin_post hook not firing function inside class
- Using OR Condition with facetwp facets
- Unpublished Pages Failing To Appear On Custom Path
- Randomize post (and page) IDs on generation
- The function called on the wp head hook becomes null
- When/where would want to attach other classes to the base class in a WordPress plugin?
- 500 Internal server error wp_handle_upload_prefilter
- Plugin function in child theme
- Nested Actions and Filters
- 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
- Customize plugin templates
- Using multi-dimensional array with filter
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- Can I add content before post content without using the_content filter
- WordPress Add advertising ads befor and after content with periority [closed]
- 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
- trying to create simple plugin to filter categories from all authors
- shortcode which is introduced into entry the blog, and appears in side bar
- How do i get all author posts on custom post type list
- Plugin hook breaks new WP 4.0 media library grid view?
- Plugin Hook: Get posts
- Display_rows() and column_cb() strange behaviour
- change output location of plugin function using a custom hook
- How to create and use Custom hooks
- 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