pass object id to current_user_can check

This commit is contained in:
Jacson Passold 2018-03-01 12:34:32 -03:00
parent 4f090a1864
commit 96f0988bd8
1 changed files with 1 additions and 1 deletions

View File

@ -249,7 +249,7 @@ class Items extends Repository {
*/
if (!isset($args['post_status'])) {
$status_obj = get_post_status_object( $collection->get_status() );
if ( $status_obj->public || current_user_can( $collection->cap->read_private_posts ) ) {
if ( $status_obj->public || current_user_can( $collection->cap->read_private_posts, $collection->get_id() ) ) {
$cpt[] = $collection->get_db_identifier();
}
} else {