final public function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1)
    {
        $callback = $function_to_add;

        if (\is_string($function_to_add) && \is_callable([$this, $function_to_add])) {
            // Bind the callback to the current child class.
            $callback = [$this, $function_to_add];
        }

        if (!\is_array($tag)) {
            $tag = [$tag];
        }

        // Add the callback to all provided hooks.
        foreach ($tag as $hook) {
            \add_filter(
                $hook,
                $callback,
                $priority ? $priority : 10,
                $this->get_argument_count($function_to_add, $accepted_args)
            );
        }
    }
final public function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1)
    {
        $callback = $function_to_add;

        if (\is_string($function_to_add) && \is_callable([$this, $function_to_add])) {
            // Bind the callback to the current child class.
            $callback = [$this, $function_to_add];
        }

        if (!\is_array($tag)) {
            $tag = [$tag];
        }

        // Add the callback to all provided hooks.
        foreach ($tag as $hook) {
            \add_filter(
                $hook,
                $callback,
                $priority ? $priority : 10,
                $this->get_argument_count($function_to_add, $accepted_args)
            );
        }
    }
final public function add_filter ( $ tag , $ function_to_add , $ priority = 10 , $ accepted_args = 1 ) { $ callback = $ function_to_add ; if ( \ is_string ( $ function_to_add ) && \ is_callable ( [ $ this , $ function_to_add ] ) ) { // Bind the callback to the current child class. $ callback = [ $ this , $ function_to_add ] ; } if ( ! \ is_array ( $ tag ) ) { $ tag = [ $ tag ] ; } // Add the callback to all provided hooks. foreach ( $ tag as $ hook ) { \ add_filter ( $ hook , $ callback , $ priority ? $ priority : 10 , $ this -> get_argument_count ( $ function_to_add , $ accepted_args ) ) ; } }
A wrapper for add_filter. Multiple hooks can be passed as an array to apply the callback
to multiple filters within the same method call.

If the supplied callback is from a child class, it will be bound to that instance automatically.

@since 1.0.0

@param string|array $tag             The name of the filter to hook the $function_to_add callback to.
Can also be an array of filters.
@param callable     $function_to_add The callback to be run when the filter is applied.
@param integer      $priority        The priority of the callback.
@param integer      $accepted_args   The amount of arguments the callback accepts.
A wrapper for add_filter . Multiple hooks can be passed as an array to apply the callback to multiple filters within the same method call .