mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@57659 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -743,6 +743,11 @@ class WP_REST_Server {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Embedded resources get passed context=embed.
|
||||
if ( empty( $request['context'] ) ) {
|
||||
$request['context'] = 'embed';
|
||||
}
|
||||
|
||||
if ( empty( $request['per_page'] ) ) {
|
||||
$matched = $this->match_request_to_handler( $request );
|
||||
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 );
|
||||
|
||||
/** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */
|
||||
|
||||
Reference in New Issue
Block a user