REST API: Pass post type name to `rest_get_route_for_post_type_items()`.

The new `rest_get_route_for_post_type_items()` function accepts a string, not an object. This commit passes the post type name instead of the object to resolve a notice in the site editor page.

Follow-up to [52281].

Props walbo.
Fixes #54536.
Built from https://develop.svn.wordpress.org/trunk@52333


git-svn-id: http://core.svn.wordpress.org/trunk@51925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2021-12-07 16:15:02 +00:00
parent 39bff93b6b
commit 177a4d830b
2 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ if ( isset( $_GET['postType'] ) && ! isset( $_GET['postId'] ) ) {
'/',
'/wp/v2/types/' . $post_type->name . '?context=edit',
'/wp/v2/types?context=edit',
add_query_arg( 'context', 'edit', rest_get_route_for_post_type_items( $post_type ) ),
add_query_arg( 'context', 'edit', rest_get_route_for_post_type_items( $post_type->name ) ),
);
block_editor_rest_api_preload( $preload_paths, $block_editor_context );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-beta1-52332';
$wp_version = '5.9-beta1-52333';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.