Registration Page - text edits

Please note, this should be under the topic Plugins...Membership 2 Pro.

My client would like to make the following revisions to the membership registration page at this stage of the process:

Please refer to screenshot: http://162.144.73.104/~taggedbyanangel/wp-content/uploads/ss_membership_registration_page_edits.png

Could you please advise what file(s) needs to be modified and on what lines so that it reads as the client intends?

Thank you.

  • Milan

    Hello David

    I hope you are well today and thanks for asking us. :slight_smile:

    Instead of going with core file edit, you can use our https://premium.wpmudev.org/project/ultimate-branding/. Just install plugin and enable its Network wide text change module, specify replacement for that text and save changes. :slight_smile:

    Let me know if you have any doubt or any other query. :slight_smile:
    Best Regards,
    Milan

  • Dimitris

    Hey trere David,

    hope that you're doing good and don't mind skipping in! :slight_smile:

    I believe there were a misconception by my colleague Milan.

    Both of the texts you marked are translatable strings in /wp-content/plugins/membership/languages/membership2.pot.

    You can simply create a new .mo translation file through PoEdit, based on the aformentioned .pot file, and upload it in /wp-content/languages/plugins/.

    You can find more details in /wp-content/plugins/membership/languages/README.txt. Feel free to post back here if more assistance is required. :slight_smile:

    Warm regards,
    Dimitris

  • David

    First of all. Thank you both for replying.

    To Dimitris: for example line 67 msgid "Name", would this correspond to the "Name" field int he registration page?

    To Milan? How would I replace the Name field for the registration page using this plugin?

    NOTE: I do not see lines like "Please check the details of the membership below and click on the relevant button to complete the signup." on the Registration page in green text by doing a word search in the Membership2.pot file. Where else would this text be configured if not this file?

    To both: Q: if I use the ultimate branding plugin, will I retain my edits after updating the Membership plugin or will I have to patch the verbiage every time I update?

    Different scenario:

    To both: Q: if I use the ultimate branding plugin, will I retain my edits after updating the the ultimate branding plugin or will I have to patch the verbiage every time I update?

    If you could both please advise on all queries I'd appreciate it.

  • Adam Czajczyk

    Hello David!

    I hope you're well today and don't mind me joining this conversation.

    Let me first sort our the answers that you got from my colleagues: they are actually both right and you may change "built-in" Membership 2 Pro messages/text both by editing translation files and by using Ultimate Branding plugin.

    The Ultimate Branding plugin is a way to change strings that are "translatable" so it's an easier way to create "fast" and/or "temporary" translations or better yet - to change some messages without actually affecting translation files.

    The point is: if you change translation file then it will be overwritten with plugin's update. If this changed file is an English language file it will mean that these changes will be lost. If it's other language then if it's a "real translation" and was submitted to our translations page - changes should stay in place but otherwise would also be lost.

    Changes made with Ultimate Branding will not be lost upon Membership 2 Pro update unless translated strings has been removed or changed for some reason. This however happens very rarely and it easy to update changes directly with Ultimate Branding. Update of Ultimate Branding itself will not affect these changes as well. I guess this answers your questions.

    Having said that all, I think it may be even better in this case to use a simple JavaScript snipped in a form of MU (Must Use) plugin. Here's an example code that should do the job:

    <?php
    function wpmu_replace_text() {
        ?>
        <script type="text/javascript">
        jQuery(function($) {
                $('#first_div').html('First message');
    	$('#second_div').html('Second message');
        });
        </script>
        <?php
    }
    add_action('wp_footer', 'wpmu_replace_text');

    The code above would need some replacement in order to work:
    - "#first_div" and "#second_div" should be replaced with IDs of elements holding messages/strings that you wish to replace
    - "First message" and "Second message" should be replaced with your custom messages accordingly

    To apply MU plugin to the site simply create a file with a ".php" extension, paste the code inside and upload it to the "/wp-content/mu-plugins" folder of your site via FTP. If there's no "mu-plugins" folder inside "/wp-content" just create it.

    An advantage of this approach is that it would be completely independent of translation files and Membership 2 Pro updates and wouldn't require any additional plugins to be installed on your site.

    If you have any further questions on this, let me know please and I"ll be happy to help.

    Best regards,
    Adam

  • David

    RE: The code above would need some replacement in order to work:
    - "#first_div" and "#second_div" should be replaced with IDs of elements holding messages/strings that you wish to replace

    - "First message" and "Second message" should be replaced with your custom messages accordingly

    Q: how do I identify the ID of an element so I can implement the revisions for the MU plugn?

    As asked prior:

    RE: line 67 msgid "Name" in the file in /wp-content/plugins/membership/languages/membership2.pot., would this correspond to the "Name" field in the registration page?

    RE: I do not see lines like "Please check the details of the membership below and click on the relevant button to complete the signup." on the Registration page in green text by doing a word search in the Membership2.pot file. Where else would this text be configured if not this file?

    Finally, returning to my original question, can you provide ONE example on how to do any revision using the branding plugin?

  • Milan

    Hello David ,

    Hope you are well today and won't mind me chiming here. :slight_smile:

    Let's take down your questions one by one. :wink:

    Q: how do I identify the ID of an element so I can implement the revisions for the MU plugn?

    You can use browser element inspector tool. If you do not know anything about it, I suggest you go through these articles. :slight_smile:
    https://developer.mozilla.org/en/docs/Tools/Page_Inspector
    https://developers.google.com/web/tools/chrome-devtools/?hl=en

    can you provide ONE example on how to do any revision using the branding plugin?

    By revision you mean changing word right ? Please let me walk you through the process of changing one simple work. After you get comfortable with the procedure, you can follow it for other words too. :slight_smile:

    #1) Install Ultimate Branding plugin
    #2) Activate it's Network wide text change module.

    #3) Then go to Branding > Text Change page and add text to be replaced this way,

    Save the settings and check how it went. :slight_smile:

    Best Regards,
    Milan

  • David

    Hi.

    I am revisiting this thread. I am trying to use the Ultimate Branding plugin as instructed and am meeting with failure using it for http://www.taggedbyanangel.com.

    Please view screencast: http://screencast.com/t/g3E645wdPyS.

    Example page: http://www.taggedbyanangel.com/category/serial-numbers/.

    Note: you must be logged out to test this.

    I'm meeting with failure. Could you please advise as to what I am doing wrong or if there is an issue with the software itself.

    Concurrently I am also trying out Adam's code, first provided on Aug 12, 2016, but am meeting up with errors in how I edit two separate paragraphs of code.

    Please view second screen cast: http://screencast.com/t/TxdYQKur9

    This is my MU plugin code (which i will remove from my site after reporting this ticket)

    <?php
    function wpmu_replace_text() {
        ?>
        <script type="text/javascript">
        jQuery(function($) {
                $('.post_content p').html('test 1');
    	$('#second_div').html('Second message');
        });
        </script>
        <?php
    }
    add_action('wp_footer', 'wpmu_replace_text');

    As reported this code duplicated the words test 1 2x.

    I believe that my preference would be to use the Ultimate Branding plugin if we can get it to work but concurrently I'd like to know how to properly use the MU plugin code on multiple paragraphs.

    Please advise.

  • Dimitris

    Hey there David,

    hope you're doing good today! :slight_smile:

    I just went ahead and accessed your website and I was able to change couple ot texts for the "no posts found" page (/category/serial-numbers/). This was because the text is case-sensitive and the "NO POSTS FOUND" is in fact capitalised by CSS. There's already an option (checkbox) that surpasses this case-sensitive functionality and can be set in each text string you change.

    Now, about the JS solution and selectors, here your can find a complete set of CSS selectors that can be used for narrowing down things.
    http://www.w3schools.com/cssref/css_selectors.asp
    For example, targeting these two separate paragraphs, you may have used something like

    $('.post_content p:first-child').html('test 1');
    $('.post_content p:last-child').html('test 2');

    Considering the texts in membership form, you can use the following snippet (an alteration of Adam's code). I chose to propose this way because the "Name" string is used in different locations of M2PRO so changing that to "Invitation Code" via Ultimate Branding, would change that in all of these.

    #: app/addon/bbpress/rule/class-ms-addon-bbpress-rule-listtable.php:27
    #: app/view/shortcode/class-ms-view-shortcode-invoice.php:187
    #: app/view/templates/membership_frontend_payment.php:9
    #: app_old/membershipincludes/classes/membershipadmin.php:2243

    So instead you can simply try the following as a MU plugin :wink:

    <?php
    function wpmu_replace_text() {
        ?>
        <script type=&quot;text/javascript&quot;>
        jQuery(function($) {
          $('.ms-membership-form-wrapper .ms-alert-box.ms-alert-success').html('Your invitation code has been provided below. Please apply the code to complete the signup.');
          $('.ms-membership-form-wrapper .ms-purchase-table .ms-title-column').html('Invitation Code');
        });
        </script>
        <?php
    }
    add_action('wp_footer', 'wpmu_replace_text');

    Hope that was some help, feel free to post back here if you find yourself struggling with it! :slight_smile:

    Warm regards,
    Dimitris

  • David

    HI.

    Thank you for your involvement.

    Q: How do I change the label for a common single word for ONE page for one specific spot?

    Screenshot: http://screencast.com/t/LHs9UvEF.

    Could you provide an example in Ultimate branding>

    Could you provide an example for the MU plugin?

    Note: for this page, my MU code did not work in changing the label "Name " to "Your Invitation Code".

    http://www.taggedbyanangel.com/register/?membership_id=3152

    <?php
    function wpmu_replace_text() {
        ?>
        <script type=&quot;text/javascript&quot;>
        jQuery(function($) {
          $('.ms-membership-form-wrapper .ms-title-column').html('Your Invitation Code');
          $('#second_div').html('Second message');
        });
        </script>
        <?php
    }
    add_action('wp_footer', 'wpmu_replace_text');

    Please advise.

  • Dimitris

    Hey there David,

    doing so from Ultimate Branding will change these strings across the whole plugin so I'd rather go the MU plugin way. Did you give a try the MU plugin I provided in my previous reply? I double checked that in my test installation and seems to work.

    Simply access your server via FTP (or a File Manager from your server control panel like cPanel or Plesk), create a /wp-content/mu-plugins folder if it doesn't exist, create a file in there like translations.php and insert the following content in there:

    <?php
    function wpmu_replace_text() {
        ?>
        <script type=&quot;text/javascript&quot;>
        jQuery(function($) {
          $('.ms-membership-form-wrapper .ms-alert-box.ms-alert-success').html('Your invitation code has been provided below. Please apply the code to complete the signup.');
          $('.ms-membership-form-wrapper .ms-purchase-table .ms-title-column').html('Invitation Code');
        });
        </script>
        <?php
    }
    add_action('wp_footer', 'wpmu_replace_text');

    Let me know how that goes! :slight_smile:
    Warm regards,
    Dimitris

    PS. I moved that thread in our "Plugins & Themes" support forum section where you'll have a more close attention of WPMUDEV support staff. The "Features & Feedback" section is more appropriate to propose features that you'd like to add in our products and engage other members on these. :wink:

  • Adam Czajczyk

    Hello David!

    The code that Dimitris supplied seems to be working well on my end as well so I'm thinking there's some slight adjustment/addition to the code necessary specific to your setup.

    Would you mind letting me take a direct look at this? I'd need to be able to access your site via FTP to do this. If you accept this please send in:

    Subject: "Attn: Adam Czajczyk"

    - Mark to my attention, the subject line should contain only: ATTN: Adam Czajczyk
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - login URL and admin account login credentials (may be a temporary admin account) data
    - Include FTP log-in details (hostname, username & password)
    - Include hosting control panel access details (login address, username & password) - cPanel's usually the control panel used for this, but your provider may use something else; this would be optional in case you weren't able to provide me with FTP credentials - so I could make use of cPanel's "File Manager" instead.
    - Include any relevant URLs for your site

    Please use our contact form here http://premium.wpmudev.org/contact/

    Select "I have a different question" from the drop-down list. 

    Please be sure to make a full backup of your entire site first!

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.