[wp-trac] [WordPress Trac] #62163: WP_REST_Request::get_params() includes unregistered args including rest_route when not using pretty permalinks

WordPress Trac noreply at wordpress.org
Mon Mar 24 23:57:24 UTC 2025


#62163: WP_REST_Request::get_params() includes unregistered args including
rest_route when not using pretty permalinks
-------------------------------------------------+-------------------------
 Reporter:  westonruter                          |       Owner:  audrasjb
     Type:  defect (bug)                         |      Status:  closed
 Priority:  low                                  |   Milestone:  6.8
Component:  REST API                             |     Version:  4.4
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  good-first-bug has-patch has-unit-   |     Focuses:
  tests commit                                   |
-------------------------------------------------+-------------------------
Changes (by audrasjb):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"60073" 60073]:
 {{{
 #!CommitTicketReference repository="" revision="60073"
 REST API: exclude `rest_route` from `get_params()` if pretty permalinks
 are disabled.

 This changeset introduces a modification to the `get_params()` method
 within the WordPress REST API. The change ensures that the `rest_route`
 parameter is excluded from the parameters returned when pretty permalinks
 are not enabled. This update enhances the developer experience by ensuring
 that the parameters returned by `get_params()` are relevant and do not
 include unnecessary values, thereby reducing potential confusion and
 errors.

 Props westonruter, TimothyBlynJacobs, audrasjb, debarghyabanerjee,
 dilip2615, shanemuir, peterwilsoncc.
 Fixes #62163.
 }}}

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


More information about the wp-trac mailing list