Changeset 56296 for trunk/src/wp-includes/navigation-fallback.php
- Timestamp:
- 07/25/2023 06:28:28 AM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/navigation-fallback.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/navigation-fallback.php
r56052 r56296 14 14 * 15 15 * The endpoint may embed the full Navigation Menu object into the 16 * response as the `self` link. By default the Posts Controller17 * will only expose sa limited subset of fields but the editor requires18 * additional fields to be available in order to utili se the menu.16 * response as the `self` link. By default, the Posts Controller 17 * will only expose a limited subset of fields but the editor requires 18 * additional fields to be available in order to utilize the menu. 19 19 * 20 20 * @since 6.3.0 … … 23 23 * @return array the modified schema. 24 24 */ 25 function wp_add_fields_to_navigation_fallback_embed ed_links( $schema ) {25 function wp_add_fields_to_navigation_fallback_embedded_links( $schema ) { 26 26 // Expose top level fields. 27 27 $schema['properties']['status']['context'] = array_merge( $schema['properties']['status']['context'], array( 'embed' ) ); 28 28 $schema['properties']['content']['context'] = array_merge( $schema['properties']['content']['context'], array( 'embed' ) ); 29 29 30 // Expose sub properties of content field. 30 /* 31 * Exposes sub properties of content field. 32 * These sub properties aren't exposed by the posts controller by default, 33 * for requests where context is `embed`. 34 * 35 * @see WP_REST_Posts_Controller::get_item_schema() 36 */ 31 37 $schema['properties']['content']['properties']['raw']['context'] = array_merge( $schema['properties']['content']['properties']['raw']['context'], array( 'embed' ) ); 32 38 $schema['properties']['content']['properties']['rendered']['context'] = array_merge( $schema['properties']['content']['properties']['rendered']['context'], array( 'embed' ) ); 33 39 $schema['properties']['content']['properties']['block_version']['context'] = array_merge( $schema['properties']['content']['properties']['block_version']['context'], array( 'embed' ) ); 40 41 /* 42 * Exposes sub properties of title field. 43 * These sub properties aren't exposed by the posts controller by default, 44 * for requests where context is `embed`. 45 * 46 * @see WP_REST_Posts_Controller::get_item_schema() 47 */ 48 $schema['properties']['title']['properties']['raw']['context'] = array_merge( $schema['properties']['title']['properties']['raw']['context'], array( 'embed' ) ); 34 49 35 50 return $schema; … … 38 53 add_filter( 39 54 'rest_wp_navigation_item_schema', 40 'wp_add_fields_to_navigation_fallback_embed ed_links'55 'wp_add_fields_to_navigation_fallback_embedded_links' 41 56 );
Note: See TracChangeset
for help on using the changeset viewer.