mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- optimized access class;
This commit is contained in:
@@ -877,6 +877,10 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $posts;
|
||||
}
|
||||
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return $posts;
|
||||
}
|
||||
|
||||
$restricted_global_message = UM()->options()->get( 'restricted_access_message' );
|
||||
$restricted_global_title = UM()->options()->get( 'restricted_access_post_title' );
|
||||
|
||||
@@ -918,11 +922,6 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
continue;
|
||||
} else {
|
||||
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
$filtered_posts[] = $post;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( empty( $is_singular ) ) {
|
||||
//if not single query when exclude if set _um_access_hide_from_queries
|
||||
if ( empty( $restriction['_um_access_hide_from_queries'] ) ) {
|
||||
@@ -1007,11 +1006,6 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
//if post for logged in users and user is not logged in
|
||||
if ( is_user_logged_in() ) {
|
||||
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
$filtered_posts[] = $post;
|
||||
continue;
|
||||
}
|
||||
|
||||
$custom_restrict = $this->um_custom_restriction( $restriction );
|
||||
|
||||
if ( empty( $restriction['_um_access_roles'] ) || false === array_search( '1', $restriction['_um_access_roles'] ) ) {
|
||||
|
||||
Reference in New Issue
Block a user