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.
Built from https://develop.svn.wordpress.org/trunk@35471


git-svn-id: http://core.svn.wordpress.org/trunk@35435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-10-31 15:42:25 +00:00
parent 64fdde928a
commit 0b845e0364
2 changed files with 3 additions and 3 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 ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-beta2-35470';
$wp_version = '4.4-beta2-35471';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.