acf_field_url::format_valuepublicACF 6.2.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_url{}

No Hooks.

Returns

Mixed. $value The modified value

Usage

$acf_field_url = new acf_field_url();
$acf_field_url->format_value( $value, $post_id, $field, $escape_html );
$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.
$escape_html(true|false) (required)
Should the field return a HTML safe formatted value.

Changelog

Since 6.2.6 Introduced.

acf_field_url::format_value() code ACF 6.8.8

public function format_value( $value, $post_id, $field, $escape_html ) {
	if ( $escape_html ) {
		return esc_url( $value );
	}
	return $value;
}