WordPress.org

Make WordPress Core

Changeset 35471


Ignore:
Timestamp:
10/31/2015 03:42:01 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Embeds: In get_oembed_response_data(), make the $post argument required.

get_oembed_response_data() is called by the API endpoint controller and never in a context where it makes sense to use the global post object.

Props swissspidy.
See #34523.

File:
1 edited

Legend:

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

    r35466 r35471  
    511511 * @since 4.4.0
    512512 *
    513  * @param WP_Post|int $post  Optional. Post object or ID. Default is global `$post`.
     513 * @param WP_Post|int $post  Post object or ID.
    514514 * @param int         $width The requested width.
    515515 * @return array|false Response data on success, false if post doesn't exist.
    516516 */
    517 function get_oembed_response_data( $post = null, $width ) {
     517function get_oembed_response_data( $post, $width ) {
    518518    $post = get_post( $post );
    519519
Note: See TracChangeset for help on using the changeset viewer.