Change text with special characters

I'm trying to replace that specific text on the default signup page "(Must be at least 4 characters, letters and numbers only.) ". But Ultimate Branding can't really take care of the parenthesis.

Tried to escape them with" \" but it breaks the site. And if I try to pass in the HTML Entity representation of those characters(( and &#41), UB changes them to "(" and " )".

Any idea how I can go about changing the text there? Any workout without Ultimate Branding is fine as well.

  • Adam Czajczyk

    Hello Brett

    I hope you're well today and thank you for your question!

    The Ultimate Branding can only change the text that's "translatable" - so if it's "ready for translation". It cannot change the text that's "hardcoded" in to the template or a WP/theme/plugin code.

    The text in question doesn't include any special chars because the "translatable" part is only:

    Must be at least 4 characters, letters and numbers only.

    and parenthesis - as already noticed by Huberson during the chat - are outside of the "translation function". That means that they cannot be changed.

    That said, you can change the text by putting

    Must be at least 4 characters, letters and numbers only.

    into the "Find this text" box and replacement text into the "and replace it with" text field and that will work (I just tested it) though the new text will still be wrapped with parenthesis.

    If you want to remove/replace those as well, you would need to take a different route and this this by either creating a customized signup page template (which can be a bit of "overkill" for just changing one text) or use some JavaScript snippet.

    This should do the trick:

    function ms_signup_replace_text() {
        ?>
        <script type="text/javascript">
        jQuery(function($) {
            var new_msg = $('#setupform').html().replace('(Must be at least 4 characters, letters and numbers only.)', 'SOMETHING');
    		$('#setupform').html(new_msg);
        });
        </script>
        <?php
    }
    add_action('wp_footer', 'ms_signup_replace_text');

    You will want to replace SOMETHING with an actual replacement text and then you can put that code into the "functions.php" file of your current theme or instead add an opening php tag at the beginning of it

    <?php

    and add to site as "mu-plugin". To add it as an "mu-plugin" (Must Use) plugin simply create a file with a .php extension (e.g. "replace-signup-msg.php"), put the code inside it and upload the file to the "/wp-content/mu-plugins" folder of your WP install. If there's no "mu-plugins" folder inside "wp-content", just create it.

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.