use globals variable rather than global
Diff
src/Providers/WordpressServiceProvider.php | 1 +
src/Support/Wordpress.php | 4 +---
2 files changed, 2 insertions(+), 3 deletions(-)
@@ -59,6 +59,7 @@ class WordpressServiceProvider extends ServiceProvider
$this->setLocationConstants();
if ($this->app->runningInConsole()) {
// allow wordpress to run, even when running from console (ie. artisan compiling)
$_SERVER['SERVER_PROTOCOL'] = 'https';
}
@@ -17,9 +17,7 @@ class Wordpress
*/
public static function query()
{
global $wp_query;
return $wp_query;
return $GLOBALS['wp_query'];
}
/**