acf/format_value filter-hookACF 5.0.0

Filters the $value for use in a template function.

Usage

add_filter( 'acf/format_value', 'wp_kama_acf_format_value_filter', 10, 4 );

/**
 * Function for `acf/format_value` filter-hook.
 * 
 * @param mixed   $value       The value to preview.
 * @param string  $post_id     The post ID for this value.
 * @param array   $field       The field array.
 * @param boolean $escape_html Ask the field for a HTML safe version of it's output.
 *
 * @return mixed
 */
function wp_kama_acf_format_value_filter( $value, $post_id, $field, $escape_html ){
	// filter...
	return $value;
}
$value(mixed)
The value to preview.
$post_id(string)
The post ID for this value.
$field(array)
The field array.
$escape_html(true|false)
Ask the field for a HTML safe version of it's output.

Changelog

Since 5.0.0 Introduced.

Where the hook is called

acf_format_value()
acf/format_value
acf/includes/acf-value-functions.php 200
$value = apply_filters( 'acf/format_value', $value, $post_id, $field, $escape_html );

Where the hook is used in Advanced Custom Fields PRO

acf/pro/blocks-auto-inline-editing.php 88
add_filter( 'acf/format_value', __NAMESPACE__ . '\populate_auto_inline_editing_values', 10, 3 );