acf_field::add_field_actionpublicACF 5.4.0

Adds an action specific to the current field type.

Method of the class: acf_field{}

No Hooks.

Returns

null. Nothing (null).

Usage

$acf_field = new acf_field();
$acf_field->add_field_action( $tag, $function_to_add, $priority, $accepted_args );
$tag(string)
The name of the action to add the callback to.
Default: ''
$function_to_add(string)
The callback to be run when the action is ran.
Default: ''
$priority(int)
The priority to add the action on.
Default: 10
$accepted_args(int)
The number of args to pass to the function.
Default: 1

Changelog

Since 5.4.0 Introduced.

acf_field::add_field_action() code ACF 6.8.8

public function add_field_action( $tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1 ) {
	// Append the field type name to the tag before adding the action.
	$tag .= '/type=' . $this->name;
	$this->add_action( $tag, $function_to_add, $priority, $accepted_args );
}