mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- fixed restrict access;
This commit is contained in:
@@ -1257,22 +1257,27 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
|||||||
|
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
$this->ignore_exclude = true;
|
$restricted_posts = UM()->options()->get( 'restricted_access_post_metabox' );
|
||||||
// exclude all posts assigned to current term without individual restriction settings
|
if ( ! empty( $restricted_posts ) ) {
|
||||||
$post_ids = get_posts(
|
$this->ignore_exclude = true;
|
||||||
array(
|
// exclude all posts assigned to current term without individual restriction settings
|
||||||
'fields' => 'ids',
|
$post_ids = get_posts(
|
||||||
'post_status' => 'any',
|
array(
|
||||||
'numberposts' => -1,
|
'fields' => 'ids',
|
||||||
'meta_query' => array(
|
'post_status' => 'any',
|
||||||
array(
|
'post_type' => array_keys( $restricted_posts ),
|
||||||
'key' => 'um_content_restriction',
|
'numberposts' => -1,
|
||||||
'compare' => 'EXISTS',
|
'meta_query' => array(
|
||||||
|
array(
|
||||||
|
'key' => 'um_content_restriction',
|
||||||
|
'compare' => 'EXISTS',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
)
|
);
|
||||||
);
|
|
||||||
$this->ignore_exclude = false;
|
$this->ignore_exclude = false;
|
||||||
|
}
|
||||||
|
|
||||||
$post_ids = empty( $post_ids ) ? array() : $post_ids;
|
$post_ids = empty( $post_ids ) ? array() : $post_ids;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user