Forum Replies Created
-
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.
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.