acf_field_wysiwyg::format_valuepublicACF 3.6

This filter is applied to the $value after it is loaded from the db, and before it is returned to the template

Method of the class: acf_field_wysiwyg{}

Hooks from the method

Returns

Mixed. $value The modified value

Usage

$acf_field_wysiwyg = new acf_field_wysiwyg();
$acf_field_wysiwyg->format_value( $value, $post_id, $field );
$value(mixed) (required)
The value which was loaded from the database.
$post_id(mixed) (required)
The $post_id from which the value was loaded.
$field(array) (required)
The field array holding all the field options.

Changelog

Since 3.6 Introduced.

acf_field_wysiwyg::format_value() code ACF 6.0.4

function format_value( $value, $post_id, $field ) {
	// Bail early if no value or not a string.
	if ( empty( $value ) || ! is_string( $value ) ) {
		return $value;
	}

	$value = apply_filters( 'acf_the_content', $value );

	// Follow the_content function in /wp-includes/post-template.php
	return str_replace( ']]>', ']]>', $value );
}