Advertisement
vapvarun

Add profile privacy for all users

Feb 8th, 2022
1,269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. // private community pro
  2. function update_level_field_in_db() {
  3.     $users = get_users( array( 'fields' => array( 'ID' ) ) );
  4.     foreach ( $users as $user ) {
  5.         $get_visibilty = get_user_meta( $user->ID, 'blpro_profile_page_visibility', true );
  6.         if ( '' == $get_visibilty ) {
  7.             update_user_meta( $user->ID, 'blpro_profile_page_visibility', 'adminsonly' );
  8.         }
  9.     }
  10. }
  11. add_action( 'bp_core_signup_after_activate', 'update_level_field_in_db' );
  12. // remove last bp_init line after checking  website )
  13. add_action( 'bp_init', 'update_level_field_in_db' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement