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:
parent
b0c7058037
commit
29f940c5b2
@ -510,11 +510,11 @@ JS;
|
|||||||
*
|
*
|
||||||
* @since 4.4.0
|
* @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.
|
* @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.
|
||||||
*/
|
*/
|
||||||
function get_oembed_response_data( $post = null, $width ) {
|
function get_oembed_response_data( $post, $width ) {
|
||||||
$post = get_post( $post );
|
$post = get_post( $post );
|
||||||
|
|
||||||
if ( ! $post ) {
|
if ( ! $post ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user