$76 GRAYBYTE WORDPRESS FILE MANAGER $21

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.157
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/home/bravrvjk/itiministry.org/wp-content/plugins/give/src/Helpers/

HOME
Current File : /home/bravrvjk/itiministry.org/wp-content/plugins/give/src/Helpers//Hooks.php
<?php

namespace Give\Helpers;

use Give\Framework\Exceptions\Primitives\InvalidArgumentException;
use Give\Log\Log;

class Hooks
{
    /**
     * A function which extends the WordPress add_action method to handle the instantiation of a class
     * once the action is fired. This prevents the need to instantiate a class before adding it to hook.
     *
     * @since 2.8.0
     *
     * @param string $tag
     * @param string $class
     * @param string $method
     * @param int    $priority
     * @param int    $acceptedArgs
     *
     * @return void
     */
    public static function addAction($tag, $class, $method = '__invoke', $priority = 10, $acceptedArgs = 1)
    {
        if ( ! method_exists($class, $method)) {
            throw new InvalidArgumentException("The method $method does not exist on $class");
        }

        add_action(
            $tag,
            static function () use ($tag, $class, $method) {
                // Provide a way of disabling the hook
                if (apply_filters("give_disable_hook-{$tag}", false) || apply_filters(
                        "give_disable_hook-{$tag}:{$class}@{$method}",
                        false
                    )) {
                    return;
                }

                $instance = give($class);

                call_user_func_array([$instance, $method], func_get_args());
            },
            $priority,
            $acceptedArgs
        );
    }

    /**
     * A function which extends the WordPress add_filter method to handle the instantiation of a class
     * once the filter is fired. This prevents the need to instantiate a class before adding it to hook.
     *
     * @since 2.8.0
     *
     * @param string $tag
     * @param string $class
     * @param string $method
     * @param int    $priority
     * @param int    $acceptedArgs
     *
     * @return void
     */
    public static function addFilter($tag, $class, $method = '__invoke', $priority = 10, $acceptedArgs = 1)
    {
        if ( ! method_exists($class, $method)) {
            throw new InvalidArgumentException("The method $method does not exist on $class");
        }

        add_filter(
            $tag,
            static function () use ($tag, $class, $method) {
                // Provide a way of disabling the hook
                if (apply_filters("give_disable_hook-{$tag}", false) || apply_filters(
                        "give_disable_hook-{$tag}:{$class}@{$method}",
                        false
                    )) {
                    return func_get_arg(0);
                }

                $instance = give($class);

                return call_user_func_array([$instance, $method], func_get_args());
            },
            $priority,
            $acceptedArgs
        );
    }

    /**
     * Calls the WordPress do_action filter and logs the execution.
     *
     * @since 2.19.6
     *
     * @param  string  $hookName  The name of the action to be executed.
     * @param  mixed  ...$args  Optional. Additional arguments which are passed on to the functions hooked to the action. Default empty.
     * @return void
     */
    public static function doAction($hookName, ...$args)
    {
        do_action($hookName, ...$args);

        Log::debug(
            "Hook Dispatched: $hookName",
            compact('hookName', 'args')
        );
    }
}


Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Form
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Frontend
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Gateways
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
ArrayDataSet.php
2.851 KB
16 Apr 2025 5.25 PM
bravrvjk / bravrvjk
0644
Call.php
0.709 KB
18 Nov 2022 3.53 AM
bravrvjk / bravrvjk
0644
Date.php
1.327 KB
12 May 2022 3.49 AM
bravrvjk / bravrvjk
0644
EnqueueScript.php
0.728 KB
1 Apr 2022 2.56 AM
bravrvjk / bravrvjk
0644
Hooks.php
3.288 KB
1 Apr 2022 2.56 AM
bravrvjk / bravrvjk
0644
Html.php
1.401 KB
24 Nov 2021 4.55 AM
bravrvjk / bravrvjk
0644
IntlTelInput.php
6.879 KB
24 Apr 2024 7.56 PM
bravrvjk / bravrvjk
0644
Language.php
2.312 KB
5 Nov 2025 7.00 PM
bravrvjk / bravrvjk
0644
Table.php
1.329 KB
24 Nov 2021 4.55 AM
bravrvjk / bravrvjk
0644
Utils.php
7.453 KB
1 May 2025 3.56 PM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF