Search Results for 'profile fields'
-
Search Results
-
Topic: Cannot add profile fields
The button to update the profile field is blocked by the type box. I cannot press update.
See screen shot https://ibb.co/jyMvngr
Hi,
I am building a new buddypress website and want to set all spam preventions before going live.
Does this honeypot code still work for buddypress register page?
// BuddyPress Honeypot function add_honeypot() { echo ''; } add_action('bp_after_signup_profile_fields','add_honeypot'); function check_honeypot() { if (!empty($_POST['system55'])) { global $bp; wp_redirect(home_url()); exit; } } add_filter('bp_core_validate_user_signup','check_honeypot');
best regards,
flamurenI have WordPress 6.6.2 and Buddypress 14.1.0 and in the edit profile page, the options are displayed horizontally like this: https://snipboard.io/DrOLiw.jpg
This does not look good, they do not even have a gap between them. How can I make them display vertically like a list?
My users are being confused by our ‘register’ page as it prompts them to enter a ‘Name’ twice. It prompts them to fill in six forms as follows:
—–
Account Details
Username (required)
Email Address (required)
Choose a Password (required)
Confirm Password (required)Profile Details
Name (required)
Name (required)—–
Should the ‘Name’ option appear twice? It seems wrong.
I have found the option to edit this in the WordPress admin under User > Profile Fields > Signup Fields. But although I can drag the two options which are labelled ‘Name (Primary) (required) (Sign-up)’, I cannot remove either of them. How can I fix this?
I am using BuddyPress 14.1.0 and WordPress 6.5.3.
Hello, BuddyPress community!
I’m working on a packing website where users can customize their packaging options, specifically allowing them to select various features for a “custom box.” I’m trying to integrate this functionality with BuddyPress profiles, so each user can save their custom box preferences on their profile page.
However, I’m running into some difficulties with saving and displaying these custom box selections. Is there a way to add custom fields to BuddyPress profiles that could store these specific packing choices? Alternatively, could anyone recommend a plugin or method for syncing this data with BuddyPress profiles seamlessly?
Any advice or guidance would be greatly appreciated. Thanks in advance!
I’m looking to customize user profiles in BuddyPress to better suit my site’s needs. What are the best practices for:
Adding custom fields and profile sections
Ensuring seamless integration with existing themes
Improving user interface and experience for profile pages
Any recommended plugins or techniques for advanced customization
I’d appreciate any advice or resources you can share to help with customizing BuddyPress profiles effectively.Thanks!
I’m trying to get the XProfile of the specified user using the API.
My endpoint looks like this:
https://xxxxxxxx/wp-json/buddypress/v1/xprofile/2/data/4As expected, it will get Fields #2 with user ID 4, which has enforced visibility and visibility level onlyme (adminsonly in the database).
But when I used an authentication with admin privileges to get the endpoint, it returned “Sorry, the profile field value is not viewable for this user.”After testing,”All Members” is also invalid, only in “Everyone” API can get data properly
The Buddypress version I am using is 14.0
Topic: Profile field Validation
Is there a way to validate the file type fields, before the saving to db. I am using this hook but it’s not working add_action( ‘xprofile_data_before_save’, ‘validate_required_unshared_fields’);
I want to make users able to add bullet or numeric lists to their profile page. Doesn’t matter if I chose wp user meta bio field or multiline xprofile field, both display lists in user profile as words with linebreaks (br). How can I avoid that and show it like it is saved in db?
Same question here 3 years ago, unanswered.
Hello, I had this code, what it does is that certain users already enter with a subscription and can use the chat without having to pay. When updating to the latest version the code no longer works. Any idea what has changed?:
add_filter(‘bp_get_total_member_count’,’bpfr_hide_get_total_filter’);
function kleo_pmpro_default_level($user_id) {
global $wpdb, $bp;//Change this with your field name
$field_name= “i am”;//Change the field value
$value_to_match = “woman”;//Membership level id
$membership_level = 4;//Done editing
$field_id = $wpdb->get_var( $wpdb->prepare( “SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s”, $field_name ) );
if ($_POST[‘field_’.$field_id] == $value_to_match) {
pmpro_changeMembershipLevel($membership_level, $user_id);
}
}if (is_multisite()) {
add_action( ‘wpmu_activate_user’, ‘kleo_mu_pmpro_default_level’, 10, 4);
} else {
add_action(‘user_register’, ‘kleo_pmpro_default_level’);
}Thanks!
Hi all,
we have a BP page with around 30 BP-Profile fields configured per user.
We found that every individual field is queried indiviually twice, resulting in 60 queries for the field sanitization. One query is made to check for allowed HTML, this function
bp_xprofile_is_richtext_enabled_for_field
.So I’d have two suggestions for raw performance:
1st:
Any way to allow for a hook at the very start of functionbp_xprofile_is_richtext_enabled_for_field
to disable that check so that I can simply set “false” for all fields globally via Hook? Right now I have to patch bp_xprofile_is_richtext_enabled_for_field() and immediately “return false” right at the beginning. I don’t want HTML anyhow in our fields.2nd:
This filter apply_filters( ‘xprofile_allowed_tags’, $xprofile_allowedtags, $data_obj, $field_id ); queries each and every ProfileField from DB once. At least it can be removed via unhooking.This is the call-chain for sanitization for allowed individual tags, it’s this call-chain (from bottom to top):
BP_XProfile_ProfileData->populate
BP_XProfile_ProfileData->__construct
BP_XProfile_Field->get_field_data
BP_XProfile_Field->populate
BP_XProfile_Field->__construct
BPXProfileCFTR\Filters\Xprofile_Kses_Filter->filter
apply_filters(‘xprofile_allowed_tags’)
xprofile_filter_kses
xprofile_sanitize_data_value_before_display
apply_filters(‘bp_get_the_profile_field_value’)
bp_get_the_profile_field_valueSo overall, this function runs two queries per field and is the absolute killerblow to performance:
xprofile_filter_kses()
.A fix would be highly appreciated. At least query all HTML-tag stuff in ONE query for all fields instead of doing it one by one.
Thanks!
Topic: Unable to register users
I’m trying to troubleshoot my BuddyPress registration form, which seems to be having some serious problems. I should start by noting that I have added some customizations to my form to add additional data fields, but the registration fails regardless of whether the customizations and overrides are enabled or disabled, and fails in exactly the same manner based on the error log, so the customizations are unlikely to be having an impact.
Here are the hooks that I am using to track where the problem is originating from:
// Hook into various stages of the BuddyPress registration process
add_action( ‘bp_before_registration_submit_buttons’, ‘log_before_registration_submit_buttons’ );
add_action( ‘bp_core_screen_signup’, ‘log_core_screen_signup’ );
add_action( ‘bp_signup_pre_validate’, ‘log_signup_pre_validate’ );
add_action( ‘bp_signup_validate’, ‘ex_custom_bp_signup_validate’ );
add_action( ‘bp_core_signup_user’, ‘log_core_signup_user’, 10, 2 );
add_action( ‘bp_core_activate_user’, ‘log_core_activate_user’, 10, 3 );
add_filter( ‘bp_core_validate_user_signup’, ‘log_core_validate_user_signup’ );
add_filter( ‘bp_core_signup_user_notification’, ‘log_core_signup_user_notification’, 10, 2 );function log_before_registration_submit_buttons() {
error_log( ‘Hook: bp_before_registration_submit_buttons fired.’ );
}function log_core_screen_signup() {
error_log( ‘Hook: bp_core_screen_signup fired.’ );
error_log( ‘Form submission data: ‘ . print_r( $_POST, true ) );
}function log_signup_pre_validate() {
error_log( ‘Hook: bp_signup_pre_validate fired.’ );
}function ex_custom_bp_signup_validate() {
global $bp;
error_log( ‘bp_signup_validate hook fired. Validation errors: ‘ . print_r( $bp->signup->errors, true ) );
}function log_core_signup_user( $user_id, $user_data ) {
error_log( ‘Hook: bp_core_signup_user fired.’ );
error_log( ‘User ID: ‘ . $user_id );
error_log( ‘User Data: ‘ . print_r( $user_data, true ) );
}function log_core_activate_user( $user_id, $key, $user ) {
error_log( ‘Hook: bp_core_activate_user fired.’ );
error_log( ‘User ID: ‘ . $user_id );
error_log( ‘Activation Key: ‘ . $key );
error_log( ‘User Data: ‘ . print_r( $user, true ) );
}function log_core_validate_user_signup( $result ) {
error_log( ‘Hook: bp_core_validate_user_signup fired.’ );
error_log( ‘Validation Result: ‘ . print_r( $result, true ) );
return $result;
}function log_core_signup_user_notification( $user_id, $user_data ) {
error_log( ‘Hook: bp_core_signup_user_notification fired.’ );
error_log( ‘User ID: ‘ . $user_id );
error_log( ‘User Data: ‘ . print_r( $user_data, true ) );
return $user_data;
}Here is a sample of the outputs from testing, with and without the Extended Profiles setting turned on:
[19-Jul-2024 00:01:28 UTC] Hook: bp_core_screen_signup fired.
[19-Jul-2024 00:01:28 UTC] Form submission data: Array
(
[signup_username] => TestUserAlpha
[signup_email] => AlphaEmail@EmailAlpha.com
[signup_password] => xEO^ONJS1ZkY
[signup_password_confirm] => xEO^ONJS1ZkY
[field_1] => Imma User
[signup_profile_field_ids] => 1
[signup-privacy-policy-check] => 1
[signup-privacy-policy-accept] => on
[signup_submit] => Complete Sign Up
[_wpnonce] => 3184f10172
[_wp_http_referer] => /register
)[19-Jul-2024 00:01:28 UTC] Hook: bp_before_registration_submit_buttons fired.
[19-Jul-2024 00:01:32 UTC] Hook: bp_core_screen_signup fired.
[19-Jul-2024 00:01:32 UTC] Form submission data: Array
(
[signup_username] => TestUserBeta
[signup_email] => AlphaEmail@EmailAlpha.com
[signup_password] => oeHAfbtPlIRG
[signup_password_confirm] => oeHAfbtPlIRG
[signup-privacy-policy-check] => 1
[signup-privacy-policy-accept] => on
[signup_submit] => Complete Sign Up
[_wpnonce] => 9240fe3ccc
[_wp_http_referer] => /register
)After poking around in various threads and ChatGPT, the suggestion is that the error is happening in the form validation, and I was told to look at bp-core-signup.php in the bp-core folder. Problem: this file does not exist in my BuddyPress installation. I deleted everything, did a fresh installation, and the file still does not exist. I added the hooks back in, made another test, and got exactly the same result. So am I just straight up missing a file in my installation? Or is there a deeper problem that’s outside the scope of my current awareness?