From 904c233b181a0a1158184115034ec9a253788453 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Tue, 4 Oct 2016 21:27:40 +0100 Subject: [PATCH] use globals variable rather than global --- src/Providers/WordpressServiceProvider.php | 1 + src/Support/Wordpress.php | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Providers/WordpressServiceProvider.php b/src/Providers/WordpressServiceProvider.php index 93e3c02..9aff474 100644 --- a/src/Providers/WordpressServiceProvider.php +++ b/src/Providers/WordpressServiceProvider.php @@ -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'; } diff --git a/src/Support/Wordpress.php b/src/Support/Wordpress.php index 933bf60..5ab59b0 100644 --- a/src/Support/Wordpress.php +++ b/src/Support/Wordpress.php @@ -17,9 +17,7 @@ class Wordpress */ public static function query() { - global $wp_query; - - return $wp_query; + return $GLOBALS['wp_query']; } /** -- libgit2 1.7.2