Skip to content

Instantly share code, notes, and snippets.

@nikitasinelnikov
Created April 5, 2021 12:51
Show Gist options
  • Select an option

  • Save nikitasinelnikov/2cde4af0e95e8c609be3f11334a5d2ac to your computer and use it in GitHub Desktop.

Select an option

Save nikitasinelnikov/2cde4af0e95e8c609be3f11334a5d2ac to your computer and use it in GitHub Desktop.
Ultimate Member: Unlock the ability to restrict the User Profile page
function um_custom_profile_restriction( $exclude, $post ) {
if ( $exclude ) {
if ( ! empty( $post->post_type ) && $post->post_type == 'page' ) {
if ( um_is_core_post( $post, 'user' ) ) {
$exclude = false;
}
}
}
return $exclude;
}
add_filter( 'um_exclude_posts_from_privacy', 'um_custom_profile_restriction', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment