🏡 index : ~doyle/koselig.git

author Jordan Doyle <jordan@doyle.wf> 2016-11-20 19:03:10.0 +00:00:00
committer Jordan Doyle <jordan@doyle.wf> 2016-11-20 19:03:10.0 +00:00:00
commit
ba57dcd48a70638cc27b9a393c44bff235335bde [patch]
tree
e99fa76be5af4d27071e984bc0d18d07c356a26d
parent
bb909bb84f1ae646dadec3cb79cfebbc3912ebef
download
ba57dcd48a70638cc27b9a393c44bff235335bde.tar.gz

add an easy way to get wordpress version



Diff

 src/Support/Action.php    |  2 +-
 src/Support/Wordpress.php | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/Support/Action.php b/src/Support/Action.php
index 44dc99f..8bd93a6 100644
--- a/src/Support/Action.php
+++ b/src/Support/Action.php
@@ -44,7 +44,7 @@ class Action
     * @param mixed $value value to run filters on
     * @param array ...$params extra params to pass to filters
     *
     * @return mixed|void
     * @return mixed
     */
    public static function filter($tag, $value, ...$params)
    {
diff --git a/src/Support/Wordpress.php b/src/Support/Wordpress.php
index 9a5aa8b..6df353f 100644
--- a/src/Support/Wordpress.php
+++ b/src/Support/Wordpress.php
@@ -110,6 +110,20 @@ class Wordpress
    }

    /**
     * Get the current Wordpress version, includes Wordpress' version.php if it has to.
     *
     * @return mixed
     */
    public static function version()
    {
        if (!isset($GLOBALS['wp_version'])) {
            require_once ABSPATH . WPINC . '/version.php';
        }

        return $GLOBALS['wp_version'];
    }

    /**
     * Get the current logged in user. Generally, you shouldn't be using this
     * function and should instead be using <code>auth()->user()</code> from Laravel to get
     * the current logged in Wordpress user.