- avoid restriction for the post author;

This commit is contained in:
Nikita Sinelnikov
2021-08-06 14:25:05 +03:00
parent ed45cbea66
commit f2244a7383
+11
View File
@@ -946,6 +946,11 @@ if ( ! class_exists( 'um\core\Access' ) ) {
$original_post = $post; $original_post = $post;
if ( is_user_logged_in() && isset( $post->post_author ) && $post->post_author == get_current_user_id() ) {
$filtered_posts[] = $post;
continue;
}
//Woocommerce AJAX fixes....remove filtration on wc-ajax which goes to Front Page //Woocommerce AJAX fixes....remove filtration on wc-ajax which goes to Front Page
if ( ! empty( $_GET['wc-ajax'] ) && defined( 'WC_DOING_AJAX' ) && WC_DOING_AJAX ) { if ( ! empty( $_GET['wc-ajax'] ) && defined( 'WC_DOING_AJAX' ) && WC_DOING_AJAX ) {
$filtered_posts[] = $post; $filtered_posts[] = $post;
@@ -1643,6 +1648,12 @@ if ( ! class_exists( 'um\core\Access' ) ) {
return false; return false;
} }
$post = get_post( $post_id );
if ( is_user_logged_in() && isset( $post->post_author ) && $post->post_author == get_current_user_id() ) {
$cache[ $post_id ] = false;
return false;
}
$restricted = true; $restricted = true;
$restriction = $this->get_post_privacy_settings( $post_id ); $restriction = $this->get_post_privacy_settings( $post_id );