acf_field::add_filter
Checks a function is_callable() before adding the filter, since classes that extend acf_field might not implement all filters.
Метод класса: acf_field{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$acf_field = new acf_field(); $acf_field->add_filter( $tag, $function_to_add, $priority, $accepted_args );
- $tag(строка)
- The name of the filter to add the callback to.
По умолчанию:'' - $function_to_add(строка)
- The callback to be run when the filter is applied.
По умолчанию:'' - $priority(int)
- The priority to add the filter on.
По умолчанию:10 - $accepted_args(int)
- The number of args to pass to the function.
По умолчанию:1
Список изменений
| С версии 5.0.0 | Введена. |
Код acf_field::add_filter() acf field::add filter ACF 6.4.2
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 );
}