Skip to content

Instantly share code, notes, and snippets.

@cryptexvinci
Last active March 6, 2024 08:37
Show Gist options
  • Save cryptexvinci/59203e5b1862f8ec3714eccdb875770e to your computer and use it in GitHub Desktop.
Save cryptexvinci/59203e5b1862f8ec3714eccdb875770e to your computer and use it in GitHub Desktop.
Make all Ultimate Member User Profiles Private by Default.
<?php
/**
* Ultimate member - Make all UM User Profile Private by Default.
* URL: https://wordpress.org/plugins/ultimate-member/
*/
add_filter( 'get_user_metadata', function( $profile_privacy, $object_id, $meta_key ) {
if( $meta_key === 'profile_privacy' ) {
$profile_privacy = 'Only me';
}
return $profile_privacy;
}, 30, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment