Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] How do I change the title of the Create an Account page?

Viewing 7 replies - 1 through 7 (of 7 total)

  • danbp
    Moderator

    @danbp

    @tinabeansy,

    first of, required pages for buddypress such as registration cannot use custom template as an usual WP page.

    “Create an Account” can be modified by using the language file, even if the site is in english.
    Read here

    BP comes with a pot file where you find ALL strings used by the plugin AND the file/line where they are used. Very handy for searching “create an account”. 😉

    For now:
    bp-core/bp-core-filters.php:487 bp-members/bp-members-screens.php:517

    Also found scratchhouse.co Is this your site ? BP seems to not be installed.
    Have you setup the pretty permalinks ? Could explain why you have trouble with some pages.

    And don’t forget: codex is your friend. 😉


    tinabeansy
    Participant

    @tinabeansy

    Thanks, @danbp!

    I’m currently in the process of migrating my site to use WordPress, so it’s not on the main production server yet.

    I’ll check out the codex!


    timsilva_
    Participant

    @timsilva_

    I am curious how to achieve this as well with the current version of BuddyPress (2.5.3).

    I can see that the “Create an Account” title in on line 3070 of bp-core-template.php

    How could I change this to “Register” through a hook/filter in functions.php or bp-custom.php?


    danbp
    Moderator

    @danbp

    it’s explained above !
    Another solution here:

    Hide All Members Tag


    timsilva_
    Participant

    @timsilva_

    @danbp Thanks for the additional link! Totally my fault, I read everything in the thread, but I didn’t realize the pot files can’t be search on OSX. I was searching my WP installation for “Create ab Account” and since the pot file didn’t show up, I thought it was moved somewhere else.

    I’m curious about that second link you gave though, the “Hide All Members Tag” one. I’m not great at hooks/filters yet, just started trying to experiment with them a few weeks ago. If you wouldn’t mind, how could I modify the mlao_gettext function you created to change the “Create an Account” text to something else? No worries if you don’t have time. Cheers!


    danbp
    Moderator

    @danbp

    The function tells gettext() to change a string to another. It use a switch called $original_string. If not explicit enough, this means the original phrase or words you want to modify. You see it near ‘case’. And right of return, you can put your words.
    The present example use only one case. But you can add more. (See php switch)

    function abcd_gettext( $translated, $original_text, $domain ) {
    
        if ( 'buddypress' !== $domain )  
               return $translated;
    
        switch ( $original_text ) {
            case 'STING YOU WANT TO MODIFY':
                return 'MODIFIED STRING';
    
            default:
                return $translated;
        }
    }
    add_filter( 'gettext', 'abcd_gettext', 20, 3 );

    IMPORTANT

    Why to use po/mo if this kind of function can be used ?

    – because po/mo is much faster as only loaded once.
    – using this function force gettext to recalculate all strings one by one at each string load. Imagine what will happen on your server if you translate all 1970(BP2.6) BP’s string like this!
    – this function can be handy only in case you need to change a few words. I wouldn’t use it for more as 10 strings.
    – it’s also handy if you already use a mo file, but need temporary a different word/string.

    So you’re warned. Best practice to change strings is to use po/mo files. See codex for details.


    timsilva_
    Participant

    @timsilva_

    @danbp Thanks for the detailed explanation! That was really helpful, I can imagine lots of ways to use this. With that said, I will make sure to use it selectively and not overload the server. 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] How do I change the title of the Create an Account page?’ is closed to new replies.
Skip to toolbar