acf/pre_load_value filter-hookACF 5.0.0

Retrieves the value for a given field and post_id.

Usage

add_filter( 'acf/pre_load_value', 'wp_kama_acf_pre_load_value_filter', 10, 2 );

/**
 * Function for `acf/pre_load_value` filter-hook.
 * 
 * @param int|string $post_id The post id.
 * @param            $field   
 *
 * @return int|string
 */
function wp_kama_acf_pre_load_value_filter( $post_id, $field ){

	// filter...
	return $post_id;
}
$post_id(int|string)
The post id.
$field
-

Changelog

Since 5.0.0 Introduced.

Where the hook is called

acf_get_value()
acf/pre_load_value
acf/includes/acf-value-functions.php 55
$value = apply_filters( 'acf/pre_load_value', null, $post_id, $field );

Where the hook is used in Advanced Custom Fields PRO

acf/includes/forms/form-customizer.php 236
add_filter( 'acf/pre_load_value', array( $this, 'pre_load_value' ), 10, 3 );
acf/includes/forms/form-user.php 203
add_filter( 'acf/pre_load_value', array( $this, 'filter_pre_load_value' ), 10, 3 );