WP_Hook::add_filter

SummerySummery

Hooks a function or method to a specific filter action.

Syntax

WP_Hook::add_filter( string $tag, callable $function_to_add, int $priority, int $accepted_args )

ParametersParameters

$tag

(string) (Required) The name of the filter to hook the $function_to_add callback to.

$function_to_add

(callable) (Required) The callback to be run when the filter is applied.

$priority

(int) (Required) 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.

$accepted_args

(int) (Required) The number of arguments the function accepts.

SourceSource

File: wp-includes/class-wp-hook.php


			

ChangelogChangelog

Changelog
Version Description
4.7.0 Introduced.
Scroll to Top