🏡 index : ~doyle/koselig.git

author Jordan Doyle <jordan@doyle.wf> 2016-12-06 23:50:23.0 +00:00:00
committer Jordan Doyle <jordan@doyle.wf> 2016-12-06 23:50:23.0 +00:00:00
commit
fc42ffa347975321c5722de5da40cda0c35aa394 [patch]
tree
329060ac06e84c4d6d91ee0324400ce4dbc2a35f
parent
28fe19e0337aa93325eeb7395508e45e0516415e
download
fc42ffa347975321c5722de5da40cda0c35aa394.tar.gz

Take advantage of plugin.php being loaded using require_once in WP 3.7



Diff

 src/Support/Action.php | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/src/Support/Action.php b/src/Support/Action.php
index 8bd93a6..7e8514e 100644
--- a/src/Support/Action.php
+++ b/src/Support/Action.php
@@ -19,17 +19,7 @@ class Action
    public static function hook($tag, $function, $priority = 10, $acceptedArgs = 1)
    {
        if (!function_exists('add_filter')) {
            // we need to register this hook before wp-settings.php is included, which also means
            // that add_filter hasn't been included yet so we have to add to the wp_filter global
            // manually.
            $GLOBALS['wp_filter'][$tag][$priority][] = [
                'function' => function (...$args) use ($function) {
                    return app()->call($function, $args);
                },
                'accepted_args' => $acceptedArgs,
            ];

            return;
            require_once ABSPATH . '/wp-includes/plugin.php';
        }

        add_filter($tag, function (...$args) use ($function) {