Make WordPress Core

Changeset 52333


Ignore:
Timestamp:
12/07/2021 04:13:54 PM (3 years ago)
Author:
hellofromTonya
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/site-editor.php

    r52330 r52333  
    6565        '/wp/v2/types/' . $post_type->name . '?context=edit',
    6666        '/wp/v2/types?context=edit',
    67         add_query_arg( 'context', 'edit', rest_get_route_for_post_type_items( $post_type ) ),
     67        add_query_arg( 'context', 'edit', rest_get_route_for_post_type_items( $post_type->name ) ),
    6868    );
    6969
Note: See TracChangeset for help on using the changeset viewer.