[wp-trac] [WordPress Trac] #51061: In WordPress 5.5 the rest_api_init action doesn't work in PHPUnit tests

WordPress Trac noreply at wordpress.org
Wed Aug 19 08:38:52 UTC 2020


#51061: In WordPress 5.5 the rest_api_init action doesn't work in PHPUnit tests
--------------------------+----------------------
 Reporter:  skarabeq      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  REST API      |     Version:  5.5
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+----------------------
Changes (by swissspidy):

 * status:  new => closed
 * resolution:   => invalid
 * component:  General => REST API
 * severity:  major => normal
 * milestone:  Awaiting Review =>


Comment:

 I think you need to add a `permission_callback` when registering your
 route.

 That's required since 5.5 and will cause a warning. That's why you get
 `Unexpected incorrect usage notice for register_rest_route`

 See https://make.wordpress.org/core/2020/07/22/rest-api-changes-in-
 wordpress-5-5/ for details.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51061#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list