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.

git-svn-id: https://develop.svn.wordpress.org/trunk@35471 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-10-31 15:42:01 +00:00
parent b0c7058037
commit 29f940c5b2
1 changed files with 2 additions and 2 deletions

View File

@ -510,11 +510,11 @@ JS;
*
* @since 4.4.0
*
* @param WP_Post|int $post Optional. Post object or ID. Default is global `$post`.
* @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.
*/
function get_oembed_response_data( $post = null, $width ) {
function get_oembed_response_data( $post, $width ) {
$post = get_post( $post );
if ( ! $post ) {