Change WordPress user roles and capabilities Forums How to or FAQ Access to all Posts of a specific Custom Post Type and limit other Pages by ID Reply To: Access to all Posts of a specific Custom Post Type and limit other Pages by ID

#6734
Vladimir
Keymaster

Use ‘sdol-page-editor’ for the role ID and ‘app_tools’ for the post_type. If you return false for ‘app_tools’, URE will fully exclude this custom post type from edit restrictions.

Something like this:


if ( in_array( 'sdol-page-editor', $user->roles ) && in_array( 'applications_tools', $user->roles )) {  // user has both roles at the same time
      if ( $post_type==='app_tools' ) {
	   $restrict_it = false;  // Do not restrict editing for Applications & Tools
      }
  }