Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

OK so I mostly fixed this myself I went into post.php in wp-includes. Changed the 'protected' => true, of pending to 'public' => true, but every time wordpress updates this will reset (I think) so can anybody mention a permanent way to make this change?

Previous part of the question is below

Basically I want my registered users to be able to view private posts types on the front end just like an admin can when they click view post on a draft/pending approval post.

I have this page HERE which loads the pending-approval posts. But when a user clicks one they can't read the post because they don't have the permissions.

I've tried the User Role Editor plugin and gave subscribers the permission for read_private_posts and read_private_pages but that didn't work. (apparently to get it to work they would have also needed edit permissions and I'm not willing to give them permission to edit others posts.)

Are there any solutions I could do in the function.php such as

$subRole = get_role( 'subscriber' );
$subRole->add_cap( 'read_private_pages' );
$subRole->add_cap( 'read_private_posts' );

(tried the above, it doesn't work, was just an example)

share|improve this question

1 Answer 1

up vote 0 down vote accepted

OK so I mostly fixed this myself I went into post.php in wp-includes. Changed the 'protected' => true, of pending to 'public' => true, but every time wordpress updates this will reset (I think) so can anybody mention a permanent way to make this change?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.