diff --git a/wp-includes/post.php b/wp-includes/post.php index 9e378b9c54..6a0af52436 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1512,7 +1512,7 @@ function register_post_status( $post_status, $args = array() ) { function get_post_status_object( $post_status ) { global $wp_post_statuses; - if ( empty( $wp_post_statuses[ $post_status ] ) ) { + if ( ! is_string( $post_status ) || empty( $wp_post_statuses[ $post_status ] ) ) { return null; } @@ -2455,6 +2455,10 @@ function is_post_type_viewable( $post_type ) { */ function is_post_status_viewable( $post_status ) { if ( is_scalar( $post_status ) ) { + if ( ! is_string( $post_status ) ) { + return false; + } + $post_status = get_post_status_object( $post_status ); if ( ! $post_status ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 7c888c54be..c87a0582ca 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.9-beta3-61170'; +$wp_version = '6.9-beta3-61171'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.