mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-07 09:49:04 +00:00
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:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user