[wp-trac] [WordPress Trac] #51746: Add a core wrapper function to retrieve $wp->request

WordPress Trac noreply at wordpress.org
Tue Nov 10 11:37:29 UTC 2020


#51746: Add a core wrapper function to retrieve $wp->request
-----------------------------+-----------------------------
 Reporter:  apedog           |      Owner:  (none)
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  General          |    Version:
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Feature request: add a core wrapper function to retrieve global
 {{{$wp->request}}}.

 Core should provide a function {{{wp_get_uri_request()}}} (or some other
 naming convention) to reliably get the uri request. And reduce reliance on
 globals/superglobals.
 {{{#!php
 <?php
 global $wp;
 $url = $wp->request;
 }}}
 instead use:
 {{{#!php
 <?php
 $url = wp_get_uri_request();
 }}}

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


More information about the wp-trac mailing list