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