[wp-trac] [WordPress Trac] #63669: An 'error' URL parameter erased on custom REST API requests

WordPress Trac noreply at wordpress.org
Mon Jul 7 12:54:17 UTC 2025


#63669: An 'error' URL parameter erased on custom REST API requests
--------------------------+-----------------------------
 Reporter:  stbreakpoint  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  6.8
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When following REST API request made to my custom route, 'error' URL
 parameter is not accessible nor through WP_REST_Request nor $_GET.

 https://f5soft.com/wp/wp-json/bp-
 etsy/callback?error=access_denied&error_description=The+resource+owner+denied+the+request&state=N_IVPDZljCnebage


 Problem appears to be at class-wp.php. parse_request function unsets
 'error' element in PHP global array $_GET.

 {{{#!php
 <?php
 if ( '404' === $error )
     unset( $error, $_GET['error'] );
 }}}


 But REST API rely on $_GET to initialize request parameters.

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


More information about the wp-trac mailing list