Replies
- Brajesh Singh on May 2, 2022 at 9:40 am in reply to: [Resolved] Buddypress conditional registration #44787
Hi Tosin,
Thank you for the reply.Although it is fine to do that, I will rather write a function. If you check, there are 3 things which vary field id, value and error message.
You can remove the previous code and use the following instead.
// forces user to select a specific select field value on registration page. add_action( 'bp_signup_validate', function () { bd_tosin_validate_signup_field( 4448, 'I accept', 'This is a required field. You must accept.' ); // You can uncomment the below function and specify your value. Repeat it as you need. // bd_tosin_validate_signup_field( 2, 'some other value', 'Your error message' ); // bd_tosin_validate_signup_field( 2, 'some other value', 'Your error message' ); } ); /** * Validates BuddyPress signup field. * * Makes sure that the user entered value is same as the expected value. If not, the specified error will be shown. * * @param int $field_id * @param string $expected_value expected value to match. * @param string $error_message Error message to be shown if the values do not match. * * @return void */ function bd_tosin_validate_signup_field( $field_id, $expected_value, $error_message = 'Please try again, the value did not match our expectation' ) { if ( ! isset( $_POST[ 'field_' . $field_id ] ) ) { return; //should never happen if the field is marked as required. } $input_value = wp_unslash( $_POST[ 'field_' . $field_id ] ); if ( strtolower( $expected_value ) !== strtolower( $input_value ) ) { buddypress()->signup->errors[ 'field_' . $field_id ] = $error_message; } }And you can use it for as many fields as you need.
Regards
Brajesh - Brajesh Singh on May 2, 2022 at 6:51 am in reply to: [Resolved] Buddypress ‘Members’ built-in widget, possible to modify? #44782
You are welcome.
- Brajesh Singh on May 1, 2022 at 9:16 am in reply to: Buddyboss: Notification api changed – recent visitors #44780
Hi Eric,
Welcome to BuddyDev support forums.
Thank you for letting us know. we will be exploring and updating as needed.
Regards
Brajesh Hi Tosin,
thank you for the suggestion.Our Profile Data Control already does it.
Please have a look.
https://buddydev.com/plugins/buddypress-profile-data-control/Regards
Brajesh- Brajesh Singh on April 30, 2022 at 6:34 am in reply to: [Resolved] Buddypress conditional registration #44769
Hi tosin,
Please use the following code// forces user to select a specific select field value on registration page. add_action( 'bp_signup_validate', function () { $field_id = 4448; // Your select field id. $accepted_value = 'I accept'; // please change with the value you want to accept. if ( ! isset( $_POST[ 'field_' . $field_id ] ) ) { return; //should never happen if the field is marked as required. } $selected_val = $_POST[ 'field_' . $field_id ]; if ( strtolower( $accepted_value ) !== strtolower( $selected_val ) ) { buddypress()->signup->errors[ 'field_' . $field_id ] = __( 'This is a required field. You must accept.', 'buddypress' ); } } );please make sure to update the variable $accepted_value with the actual value which you have used for your selectbox.
Regards
Brajesh - Brajesh Singh on April 30, 2022 at 6:15 am in reply to: [Resolved] Buddypress ‘Members’ built-in widget, possible to modify? #44768
Hi Michael,
Thank you for your question.1. You may use the following css to hide the popular option
.widget_bp_core_members_widget .bp-separator:nth-child(4){ display:none; } .widget_bp_core_members_widget #popular-members { display:none; }2. Yes, It is doable via ajax but I don’t see any existing solution. You will probably need to develop it as a custom solution.
Regards
Brajesh - Brajesh Singh on April 30, 2022 at 5:35 am in reply to: [Resolved] BuddyBlog Pro: how to change date format? #44766
Hi Greg,
Thank you.I see the reason why that did not work. The site archive page templates do not use our bundled template. It comes from your theme and it seems to me they have it hardcoded. I will be looking into the theme this weekend and get back to you with a proper suggestion.
Regards
Brajesh - Brajesh Singh on April 30, 2022 at 5:28 am in reply to: [Resolved] BuddyBlog Pro: how to change date format? #44764
Hi Greg,
Thank you for the reply.1. can you please tell me which theme are you using? We do have some of the template specific to theme, so I will check and get back to you. I am assuming the screenshot of post list is from user’s profile? or is it from your site archive page?
2. sure
Please let me know and I will assist.
Regards
Brajesh - This reply has been marked as private.
Hi Fabien,
Thank you.1. I am not sure. I don’t think there is any plugin that works with native wp registration(wp-signup.php or the dashboard->Users->Add New)
2. That means it is a compatibility issue with PostSMTP and you should report it to them.
3. As details in other topic, Please contact the theme provide for the assistance.
I am sorry, I am not being much helpful here as all the 3 issues are related to some compatibility/feature with 3rd party code.
Regards
Brajesh