Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • alexalexalex09
    Participant

    @alexalexalex09

    Whoops, I forgot instructions on how to change the account details fields. Here, I updated it:

    To change the text on the regular (Account Details) fields, make a copy of wpcontent/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/register.php and place it in themes/your-child-theme/buddypress/members (a folder which you will have to create).

    Then, open that file and replace every instance of <?php _e( '(required)', 'buddypress' ); ?> with your asterisk (*).

    Then, to change the text on profile fields (Profile Details), just add the following code to bp-custom.php (which, if it doesn’t exist, you’ll need to create in wpcontent/plugins).

    
    function bp_change_required_label($translated_string, $field_id) {
    		return '*';		
    }
    add_filter('bp_get_the_profile_field_required_label', 'bp_change_required_label', 10, 2);
    

    This function hooks into the function bp_get_the_profile_field_required_label() in buddypress/bp-xprofile/bp-xprofile-template using the supplied filter. It takes the translated “(required)” string and replaces it with “*”. which will also remove any translation – but that should be acceptable for a symbol in most cases.


    alexalexalex09
    Participant

    @alexalexalex09

    I know this is an old thread, but for those who are (like me) interested and googling this, here’s a quick solution that requires no language file editing.

    Just add the following code to bp-custom.php (which, if it doesn’t exist, you’ll need to create in wpcontent/plugins).

    
    function bp_change_required_label($translated_string, $field_id) {
    		return '*';		
    }
    add_filter('bp_get_the_profile_field_required_label', 'bp_change_required_label', 10, 2);
    

    This function hooks into the function bp_get_the_profile_field_required_label() in buddypress/bp-xprofile/bp-xprofile-template using the supplied filter. It takes the translated “(required)” string and replaces it with “*”. which will also remove any translation – but that should be acceptable for a symbol in most cases.

Viewing 2 replies - 1 through 2 (of 2 total)
Skip to toolbar