Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Fix for issue #163 #164

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion inc/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ function members_can_user_view_post( $user_id, $post_id = '' ) {
// Set to `FALSE` to avoid hierarchical checking.
if ( apply_filters( 'members_check_parent_post_permission', $check_parent, $post_id, $user_id ) ) {

$parent_id = get_post( $post_id )->post_parent;
$parent_id = 0;
$post_id = get_post( $post_id );

if ( is_object( $post_id ) ) {
$parent_id = $post_id->post_parent;
}

// If the post has a parent, check if the user has permission to view it.
if ( 0 < $parent_id )
Expand Down