- fixed restrict access;

This commit is contained in:
Nikita Sinelnikov
2021-08-02 13:46:14 +03:00
parent 7380313760
commit e5d5077c3f
+20 -15
View File
@@ -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;