acf_field_textarea::format_value
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_textarea{}
No Hooks.
Returns
$value. (mixed) the modified value
Usage
$acf_field_textarea = new acf_field_textarea(); $acf_field_textarea->format_value( $value, $post_id, $field );
- $value(required)
- .
- $post_id(required)
- .
- $field(required)
- .
Changelog
| Since 3.6 | Introduced. |
acf_field_textarea::format_value() acf field textarea::format value code ACF 6.8.8
function format_value( $value, $post_id, $field ) {
// bail early if no value or not for template
if ( empty( $value ) || ! is_string( $value ) ) {
return $value;
}
// new lines
if ( $field['new_lines'] == 'wpautop' ) {
$value = wpautop( $value );
} elseif ( $field['new_lines'] == 'br' ) {
$value = nl2br( $value );
}
// return
return $value;
}