Skip to content

Instantly share code, notes, and snippets.

@nikitasinelnikov
Created September 24, 2018 14:45
Show Gist options
  • Save nikitasinelnikov/e43108f184193aaf532cc21a79727b13 to your computer and use it in GitHub Desktop.
Save nikitasinelnikov/e43108f184193aaf532cc21a79727b13 to your computer and use it in GitHub Desktop.
Return Back an ability to restrict UM predefined pages
add_filter( 'um_exclude_posts_from_privacy', 'my_exclude_posts', 10, 2 );
function my_exclude_posts( $exclude, $post ) {
if ( ! empty( $post->post_type ) && $post->post_type == 'page' ) {
if ( um_is_core_post( $post, 'login' ) || um_is_core_post( $post, 'register' ) ||
um_is_core_post( $post, 'account' ) || um_is_core_post( $post, 'logout' ) ||
um_is_core_post( $post, 'password-reset' ) || ( is_user_logged_in() && um_is_core_post( $post, 'user' ) ) )
$exclude = true;
}
return $exclude;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment