This filter is applied to the $value after it is loaded from the db and before it is returned to the template via functions such as get_field().


  • Renamed from acf/format_value_for_api in v5.0.0


Name Type Description
$value mixed the value which was loaded from the database
$post_id mixed the post ID from which the value was loaded
$field array An array containing all the field settings for the field which was used to upload the attachment


There are 2 possible ways to hook into this filter.

  1. acf/format_value – filter for every field
  2. acf/format_value/type={$field_type} – filter for a specific field based on it’s type


function my_acf_format_value( $value, $post_id, $field ) {
	// run do_shortcode on all textarea values
	$value = do_shortcode($value);
	// return
	return $value;

add_filter('acf/format_value/type=textarea', 'my_acf_format_value', 10, 3);

Hi all. Server maintenance scheduled this Sunday 28th May. Learn more