Tagged: hooks php buddyboss
How to customise register.php?
I have a theme child of buddyboss. And in the functions.php, I have this code:
add_filter('bp_members_signup_error_message', 'function_voornaam', 10, 1); function function_voornaam($value, $fieldname) { if ($fieldname == 'field_1') { return $value = '<style>{font-family:bold}</style> you have to enter name.'; } return $value; }
So that by voornaam the text: This is a required field. will be replaced by the you have to enter name. But the text doesn’t change.
This is a image:
What I have to change?
Hi,
That’s not the right way to do it as the $fieldname is not available with that hook.here is the code you may use
add_action( 'bp_signup_validate', function () { $bp = buddypress(); if ( ! $bp->signup->errors ) { return; } if ( isset( $bp->signup->errors['field_1'] ) ) { $bp->signup->errors['field_1'] = sprintf( '<div class="bp-messages bp-feedback error"> <p>%s</p> </div>', 'You have to enter name.' ); } } );
Regards
BrajeshYou are welcome.
As of moving the error message below the input, sorry, there is no direct way. I will suggest contacting BuddyBoss to see if they have some way.
Regards
Brajesh
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.
This topic is: resolved