[wp-trac] [WordPress Trac] #26867: Explicitly globalize some missing query globals in wp-settings.php

WordPress Trac noreply at wordpress.org
Sat Jan 18 03:43:48 UTC 2014


#26867: Explicitly globalize some missing query globals in wp-settings.php
--------------------------+-----------------------------
 Reporter:  nbachiyski    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Unit Tests    |    Version:
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 When WordPress is loaded in a function (e.g. unit tests) the variables
 initialized at the top level aren't globals, but we expect them to be.

 For example, if in a unit test there is no way to access $wp_query, either
 directly or via `get_query_var()` before some other part of the code has
 initialized it.

 This happens especially when we are testing a plugin and it uses
 `$wp_query` in its initialization routine.

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


More information about the wp-trac mailing list