• Resolved dflancto

    (@dflancto)


    Hi,

    Is it possible to change the default privacy settings on the account privacy tab when a new user registers to:

    Profile Privacy – Only me

    Hide my profile from directory – Yes

    I tried to add the following code but it doesn’t seem to work:

    add_filter( 'um_profile_privacy_options', 'my_profile_privacy_options', 10, 1 );
          function my_profile_privacy_options( $privacy_options ) {
    		
                    $privacy_options ['profile_privacy'] = array(
    			'default' => 'Only me',
    		);
    
    		$privacy_options ['hide_in_members'] = array(
    			'default' => 'Yes',
    );
    			 
    return $privacy_options;
    
    }

    Thanks for your help

    Regards,
    David

    • This topic was modified 7 years, 2 months ago by dflancto.
    • This topic was modified 7 years, 2 months ago by dflancto.
Viewing 1 replies (of 1 total)
  • Plugin Support mansurahamed

    (@mansurahamed)

    Hi @dflancto,

    Add following code at your child theme’s functions.php file which should fulfill your requirement

    add_action( 'user_register', 'custom_registration_save', 10, 1 );
    
    function custom_registration_save( $user_id ) {
    
            update_user_meta($user_id, 'profile_privacy', 'Only me');
    		update_user_meta($user_id, 'hide_in_members', array("Yes"));
    
    }
    

    But for existing users, you will need to loop through them and set the meta values for each of them.

    Thanks.

Viewing 1 replies (of 1 total)

The topic ‘Change Default Privacy Settings’ is closed to new replies.