acf_field_link::update_valuepublicACF 3.6

This filter is appied to the $value before it is updated in the db

Method of the class: acf_field_link{}

No Hooks.

Returns

$value. - the modified value

Usage

$acf_field_link = new acf_field_link();
$acf_field_link->update_value( $value, $post_id, $field );
$value(required)
.
$post_id(required)
.
$field(required)
.

Changelog

Since 3.6 Introduced.

acf_field_link::update_value() code ACF 6.8.8

function update_value( $value, $post_id, $field ) {

	// Check if value is an empty array and convert to empty string.
	if ( empty( $value ) || empty( $value['url'] ) ) {
		$value = '';
	}

	// return
	return $value;
}