acf_field::add_filter
Checks a function is_callable() before adding the filter, since classes that extend acf_field might not implement all filters.
Method of the class: acf_field{}
No Hooks.
Returns
null. Nothing (null).
Usage
$acf_field = new acf_field(); $acf_field->add_filter( $tag, $function_to_add, $priority, $accepted_args );
- $tag(string)
- The name of the filter to add the callback to.
Default:'' - $function_to_add(string)
- The callback to be run when the filter is applied.
Default:'' - $priority(int)
- The priority to add the filter on.
Default:10 - $accepted_args(int)
- The number of args to pass to the function.
Default:1
Changelog
| Since 5.0.0 | Introduced. |
acf_field::add_filter() acf field::add filter code ACF 6.8.8
public function add_filter( $tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1 ) {
// Bail early if not callable.
if ( ! is_callable( $function_to_add ) ) {
return;
}
add_filter( $tag, $function_to_add, $priority, $accepted_args );
}