Allow Contributor to edit published post and filter by page id

Question

I’d like to give contributors permission to edit only some of their own published pages.

I can use the following if I want to allow them to edit all of their published posts. How do I filter it allowing only certain pageids?

//to add capability to user
$user = new WP_User( $user_id );
$user->add_cap( 'edit_published_posts');
0
, Mohit 10 months 0 Answers 48 views 0

Leave an answer