Make WordPress Core


Ignore:
Timestamp:
02/22/2021 01:21:26 PM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/embed.php

    r50371 r50401  
    510510 * @param WP_Post|int $post  Post object or ID.
    511511 * @param int         $width The requested width.
    512  * @return array|false Response data on success, false if post doesn't exist.
     512 * @return array|false Response data on success, false if post doesn't exist
     513 *                     or is not publicly viewable.
    513514 */
    514515function get_oembed_response_data( $post, $width ) {
     
    520521    }
    521522
    522     if ( 'publish' !== get_post_status( $post ) ) {
     523    if ( ! is_post_publicly_viewable( $post ) ) {
    523524        return false;
    524525    }
Note: See TracChangeset for help on using the changeset viewer.