mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-19 21:15:23 +00:00
REST API: Pass correct context to embedded items.
Fixes a regression introduced in [57623] where navigation embed items were missing `raw` property values. Props mamaduka, swissspidy, youknowriad, timothyblynjacobs. Fixes #43439. Built from https://develop.svn.wordpress.org/trunk@57659 git-svn-id: http://core.svn.wordpress.org/trunk@57160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
69d6a9e5a0
commit
3394082032
@ -743,6 +743,11 @@ class WP_REST_Server {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Embedded resources get passed context=embed.
|
||||||
|
if ( empty( $request['context'] ) ) {
|
||||||
|
$request['context'] = 'embed';
|
||||||
|
}
|
||||||
|
|
||||||
if ( empty( $request['per_page'] ) ) {
|
if ( empty( $request['per_page'] ) ) {
|
||||||
$matched = $this->match_request_to_handler( $request );
|
$matched = $this->match_request_to_handler( $request );
|
||||||
if ( ! is_wp_error( $matched ) && isset( $matched[1]['args']['per_page']['maximum'] ) ) {
|
if ( ! is_wp_error( $matched ) && isset( $matched[1]['args']['per_page']['maximum'] ) ) {
|
||||||
@ -750,11 +755,6 @@ class WP_REST_Server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Embedded resources get passed context=embed.
|
|
||||||
if ( empty( $request['context'] ) ) {
|
|
||||||
$request['context'] = 'embed';
|
|
||||||
}
|
|
||||||
|
|
||||||
$response = $this->dispatch( $request );
|
$response = $this->dispatch( $request );
|
||||||
|
|
||||||
/** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */
|
/** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.5-beta1-57658';
|
$wp_version = '6.5-beta1-57659';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user