Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25365

    Hi Dorian,
    Thank you for the reply.

    Yes, It should work fine for the REST API.

    Please put this in wp-content/plugins/bp-custom.php

    
    
    /**
     * Ensures default profile fields visibility is used while displaying profile
     *
     * It is only applied if user has not saved any custom visibility.
     */
    function budydev_ensure_default_xprofile_field_data_visibility_for_user( $value, $object_id, $meta_key ) {
    
    	if ( 'bp_xprofile_visibility_levels' !== $meta_key ) {
    		return $value;
    	}
    
    	// let us use a  static cache since the default visibilites won't change during a request.
    	static $default_visibilities = null;
    
    	if ( ! is_null( $default_visibilities ) ) {
    		return $default_visibilities;
    	}
    
    	$visibilities = BP_XProfile_Group::fetch_default_visibility_levels();
    
    	foreach ( $visibilities as $field_id => $visibility ) {
    		$default_visibilities[ $field_id ] = isset( $visibility['default'] ) ? $visibility['default'] : 'public';
    	}
    
    	return $default_visibilities;
    
    }
    
    add_filter( 'default_user_metadata', 'budydev_ensure_default_xprofile_field_data_visibility_for_user', 10, 3 );
    
    

    It will ensure that whatever you set as the default visibility for the profile field will be used for users who haven’t updated their profile data.

    Please let me know if it works for you or not?

    Regards
    Brajesh

    PS:- Please do not copy code from email notification. It is entity encoded. Use the code from this post on forum.

  • Keymaster
    (BuddyDev Team)
    Posts: 25365

    Hi Saleam,
    Thank you for the patience.

    For the time being, I have put this code at the bottom of your theme’s function.php

    
    // show all profile field groups on BuddyPress registration.
    add_filter( 'bp_after_has_profile_parse_args', function ( $args ) {
    
    	if ( ! bp_is_register_page() ) {
    		return $args;
    	}
    
    	// BuddyPress does not allow us fetch multiple group using id but it does allows excluding.
    	$args['profile_group_id'] = false;
    	$args['exclude_groups']   = [];
    
    	return $args;
    } );
    

    Please check if the registration is working or not(by registering a new account). If it does not, we may need to change a Youzer template file.

    This change will be lost when you will update your theme in future. I will recommend using child theme or putting the code in wp-content/plugins/bp-custom.php

    I was not able to put it in bp-custom.php as I don’t have access to FTP.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25365

    Hi Carsten,
    Thank you for the question.

    We do not plat to add the registration moderation currently.

    We are releasing a profile data moderation addon(allows you to monitor profile data for any change by user and approve/reject them) next week.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25365

    I am sorry but I am not sure of your reply.

    If the users are still there in database, It means they were not deleted completely. I will suggest disabling all plugins and trying to find out the culprit if any.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25365

    Hi Saleam,
    Thank you.

    Please confirm that you want all the fields from both the profile field groups to appear on registration page.

    PS:- I will not be making any changes in the settings and will let you know which template files I changed.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25365

    Hi Dorian,
    Welcome to BuddyDev forums.

    The User Profile fields data visibility is stored in user meta as an associative array of field ids as key and visibility levels as value

    Example
    array( 1=> ‘public’, 2=>’private’ and so on) where 1, 2 etc are field ids.

    Deleting the old value will make all the fields public(except if you have an enforced visibility option set foe the field).

    If your goal is not to enforce a default visibility all the time, just doing it when this was not set by the user(I am assuming you deleted the meta key), we can use two approaches:-

    1. Bulk update usermeta for each user via phpmyadmin and set the value for ‘bp_xprofile_visibility_levels’ as the serialized value of our expected setting

    2. Or the easier route is to filter on the value of the user meta ‘bp_xprofile_visibility_levels’ and if it is empty(you deleted all, if the user updated it, It won’t be empty), we return the default fields visibility.

    Which route will you like to use? Please let me know and I will assist.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25365

    Hi Carsten,
    Thank you for the reply.

    Please visit Cpanel and search for phpmyadmin, open it and you will have access to database. The tables are listed there.

    Please do not delete anything from there just check for the users.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25365

    Hi Carsten,
    That’s strange.

    is there any chance you are on a multisite? In case of multisite, the user should be deleted from Network Admin->Users screen.

    If not, Please check wp_users table and see if the deleted users are present or not? They should not be there.
    If they are, something is disabling complete deletion of users.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25365
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25365

    Hi Saleam,
    Thank you for the reply.

    I appreciate you joining our membership.

    It is strange is a field from non primary group appeared on registration. That is not normal behaviour for BuddyPress(unless a theme/plugin modifies it).

    Please use “Private Reply” checkbox here for sharing credentials.

    You can share the theme via google drive or something similar and link me here in a private reply.

    Thank you
    Brajesh