BuddyDev

Search

bug BuddyPress Profile Data Moderator

  • Participant
    Level: Initiated
    Posts: 9
    jerome jerome on #54528
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24766
    Brajesh Singh on #54533
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24766
    Brajesh Singh on #54557

    Hi Jerome,
    Thank you for your patience.

    I had a look at the theme’s code.

    There is a function hardcoded in the theme header that prints this data(You select these fields in the Theme Settings page(BuddyPress members & Profile) section.

    There is no good way to fix this issue in the header.

    There is a solution to use the following code

    
    add_filter( 'xprofile_get_field_data', function ( $values, $field_id, $user_id ) {
    
    	if ( ! function_exists( 'bp_profile_data_control_is_field_visible' ) ) {
    		return $values;
    	}
    
    	if ( bp_profile_data_control_is_field_visible( $user_id, get_current_user_id(), $field_id ) ) {
    		return $values;
    	}
    
    	return '';
    }, 10, 3 );
    
    

    In child theme’s functions.php but it is not very efficient as it will apply to all the fields being fetched(including Display name), currently we were only applying to profile loop.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    jerome jerome on #54558

    Hello,

    so if I understand correctly, we can’t do anything?
    What is the use of the code? because I just put it in place and it doesn’t seem to do anything
    thank you very much

  • Keymaster
    (BuddyDev Team)
    Posts: 24766
    Brajesh Singh on #54559

    Hi Jerome,
    The code will work if you put it in functions.php in your active theme/or child theme. Make sure you are not checking as site administrator as it won’t stop site admins form viewing the data.

    Also, can you confirm that the plugin is hiding the data from their actual Profile view(Under the header, profile tab) without this code too?

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    jerome jerome on #54560

    I put it in the function.php of the child theme
    from a member connection, not admin, I made changes, including on the BIO
    As admin I was asked to validate the other changes not the bio which was validated directly.
    thank you

  • Keymaster
    (BuddyDev Team)
    Posts: 24766
    Brajesh Singh on #54630

    Hi Jerome,
    I am sorry, I could not understand the last reply.

    Is it not hiding the bio even after you put the custom code? If yes, Please let me know where did you put the custom code(file and directory name).

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    jerome jerome on #54645

    Hello,
    Sorry for my bad English 😉
    I put the code in the function.php file of the child theme and yes the bio is not subject to validation by the admin.
    Thank you

  • Keymaster
    (BuddyDev Team)
    Posts: 24766
    Brajesh Singh on #54648

    Hi Jerome,
    I am very sorry. I am still not sure about it(No worries about English, It is not my first language either).

    I am assuming the expectation is to have the Bio moderated before it become visible.

    Can you please tell me which of the following is happening:-

    1. It is not appearing in the admin profile data moderation(the Bio field)
    2. Or it is appearing in the moderation.

    I am expecting that it is the first case form your reply, am I right tin assuming that?

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    jerome jerome on #54663

    Hello, nothing happens, the member modifies the bio field and it is automatically validated. The administration has no information.

You must be logged in to reply to this topic.

This topic is: not resolved