Last active
May 18, 2018 11:47
-
-
Save cubehrends/654d360ece4045bec40ccd831e976af4 to your computer and use it in GitHub Desktop.
How to customize the Comment Form Cookies Consent Label in WordPress 4.9.6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* the code below goes into your child themes functions.php | |
=============================================================== */ | |
function customize_comment_form_cookies_consent_label( $translated, $original, $domain ) { | |
$strings = array( | |
'Save my name, email, and website in this browser for the next time I comment.' => '=> YOUR CUSTOMIZED TEXT GOES HERE <=' | |
); | |
if ( ! empty( $strings[$original] ) ) { | |
$translations = &get_translations_for_domain( $domain ); | |
$translated = $translations->translate( $strings[$original] ); | |
} | |
return $translated; | |
} | |
add_filter( 'gettext', 'customize_comment_form_cookies_consent_label', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment