diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 38287dc7c3..f05c504cc1 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -241,6 +241,13 @@ function map_meta_cap( $cap, $user_id, ...$args ) { } $status_obj = get_post_status_object( $post->post_status ); + if ( ! $status_obj ) { + /* translators: 1: Post status, 2: Capability name. */ + _doing_it_wrong( __FUNCTION__, sprintf( __( 'The post status %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post with that status.' ), $post->post_status, $cap ), '5.4.0' ); + $caps[] = 'edit_others_posts'; + break; + } + if ( $status_obj->public ) { $caps[] = $post_type->cap->read; break; diff --git a/wp-includes/version.php b/wp-includes/version.php index dcdf41c1ae..54832bdbce 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-47177'; +$wp_version = '5.4-alpha-47178'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.