HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-172-31-4-197 6.8.0-1036-aws #38~22.04.1-Ubuntu SMP Fri Aug 22 15:44:33 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wordpress/wp-content/plugins/bit-integrations/includes/Core/Util/Hooks.php
<?php

namespace BitCode\FI\Core\Util;

/**
 * A wrapper class for actions and filters.
 */
final class Hooks
{
    /**
     * A wrapper for do_action()
     *
     * @param string $tag    The name of the action to be executed.
     * @param mixed  ...$arg Optional.
     *                       Additional arguments which are passed on to the functions hooked to the action. Default empty.
     *
     * @return mixed
     */
    public function run($tag, ...$arg)
    {
        return do_action($tag, ...$arg);
    }

    /**
     * A wrapper for add_action()
     *
     * @param string   $tag             The name of the action to which the $function_to_add is hooked.
     * @param callable $function_to_add The name of the function you wish to be called.
     * @param int      $priority        Optional. Used to specify the order in which the functions associated with a particular action are executed. Default 10. Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.
     * @param int      $accepted_args   Optional. The number of arguments the function accepts. Default 1.
     *
     * @return true — Will always return true.
     */
    public static function add($tag, $function_to_add, $priority = 10, $accepted_args = 1)
    {
        return add_action(
            $tag,
            $function_to_add,
            $priority,
            $accepted_args
        );
    }

    /**
     * A wrapper for remove_action()
     *
     * @param string   $tag                The action hook to which the function to be removed is hooked.
     * @param callable $function_to_remove The name of the function which should be removed.
     * @param int      $priority           Optional. The priority of the function. Default 10.
     *
     * @return bool — Whether the function is removed.
     */
    public static function remove($tag, $function_to_remove, $priority = 10)
    {
        return remove_action($tag, $function_to_remove, $priority);
    }

    /**
     * A wrapper for add_filter()
     *
     * @param string   $tag             The name of the filter to hook the $function_to_add callback to.
     * @param callable $function_to_add The callback to be run when the filter is applied.
     * @param int      $priority        Optional. Used to specify the order in which the functions associated with a particular action are executed. Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action. Default 10.
     * @param int      $accepted_args   Optional. The number of arguments the function accepts. Default 1.
     *
     * @return true
     */
    public static function filter($tag, $function_to_add, $priority = 10, $accepted_args = 1)
    {
        return add_filter($tag, $function_to_add, $priority, $accepted_args);
    }

    /**
     * A wrapper for apply_filters()
     *
     * @param string $tag     The name of the filter hook.
     * @param mixed  $value   The default value to filter.
     * @param mixed  ...$args Additional parameters to pass to the callback functions.
     *
     * @return mixed The filtered value after all hooked functions are applied to it.
     */
    public static function apply($tag, $value, ...$args)
    {
        return apply_filters($tag, $value, ...$args);
    }
}