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
This commit is contained in:
Sergey Biryukov 2021-02-22 13:23:04 +00:00
parent c55ccb3ef0
commit a088b586ec
2 changed files with 4 additions and 3 deletions

View File

@ -510,7 +510,8 @@ JS;
* *
* @param WP_Post|int $post Post object or ID. * @param WP_Post|int $post Post object or ID.
* @param int $width The requested width. * @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 ) { function get_oembed_response_data( $post, $width ) {
$post = get_post( $post ); $post = get_post( $post );
@ -520,7 +521,7 @@ function get_oembed_response_data( $post, $width ) {
return false; return false;
} }
if ( 'publish' !== get_post_status( $post ) ) { if ( ! is_post_publicly_viewable( $post ) ) {
return false; return false;
} }

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.