From a088b586ec40eef4fbac8736d9f0c0adefc26cdd Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 22 Feb 2021 13:23:04 +0000 Subject: [PATCH] Embeds: Allow posts with a public custom post status to be embedded. Previously, only posts with the `publish` status could be embedded. Props goaroundagain, peterwilsoncc, poena. Fixes #47574. Built from https://develop.svn.wordpress.org/trunk@50401 git-svn-id: http://core.svn.wordpress.org/trunk@50012 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/embed.php | 5 +++-- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-includes/embed.php b/wp-includes/embed.php index 604c76a431..2eee145b66 100644 --- a/wp-includes/embed.php +++ b/wp-includes/embed.php @@ -510,7 +510,8 @@ JS; * * @param WP_Post|int $post Post object or ID. * @param int $width The requested width. - * @return array|false Response data on success, false if post doesn't exist. + * @return array|false Response data on success, false if post doesn't exist + * or is not publicly viewable. */ function get_oembed_response_data( $post, $width ) { $post = get_post( $post ); @@ -520,7 +521,7 @@ function get_oembed_response_data( $post, $width ) { return false; } - if ( 'publish' !== get_post_status( $post ) ) { + if ( ! is_post_publicly_viewable( $post ) ) { return false; } diff --git a/wp-includes/version.php b/wp-includes/version.php index ae76de5a10..700587f389 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.7-beta3-50400'; +$wp_version = '5.7-beta3-50401'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.