[wp-trac] [WordPress Trac] #64045: /wp-json/wp/v2/menus incorrectly emits 403 for invalid `post` param

WordPress Trac noreply at wordpress.org
Sat Sep 27 02:50:51 UTC 2025


#64045: /wp-json/wp/v2/menus incorrectly emits 403 for invalid `post` param
--------------------------+-----------------------------
 Reporter:  jkmassel      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  6.8.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This endpoint expects the `post` param to be the Post ID for a
 `nav_menu_item`, but if the Post ID for a post/page/etc is provided the
 following response is returned:


 {{{
 {
   "code": "rest_forbidden_context",
   "message": "Sorry, you are not allowed to view terms for this post.",
   "data": {
     "status": 403
   }
 }
 }}}

 It should probably look more like:


 {{{
 {
   "code": "rest_post_invalid_type",
   "message": "Invalid post type.",
   "data": {
     "status": 400
   }
 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64045>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list