Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Which file do I need to edit (registration questions)?


r-a-y
Keymaster

@r-a-y

@birdy43

Try logging into the WP backend. Navigate to “BuddyPress > General Settings”.

Under “Full Name Field Name”, change this from the default “Name” to whatever you want.

@mrjarbenne

You need to create a custom function for outputting your questions and another one to validate your questions.

function my_custom_questions() {
// your questions would go here - would be an input field of some kind

// eg.
echo '<label for="my_question">Please enter something for this new field</label>';
echo '<input type="text" name="my_question" id="my_question" value="" />';
}
add_action('bp_before_registration_submit_buttons', 'my_custom_questions');

function my_custom_validation() {
// here you'd check the submitted input fields, you'd probably do a check to see if the question is blank, if not return an error message

// would be something like this:

global $bp;

// checking if an input field of "my_question" is blank
if ( $_POST['my_question'] == "" ) {
$bp->signup->errors['my_question'] = 'You must type in something for the field "my_question".';
}
}
add_action('bp_signup_validate', 'my_custom_validation');

Skip to toolbar