acf/pre_load_value
Retrieves the value for a given field and post_id.
Использование
add_filter( 'acf/pre_load_value', 'wp_kama_acf_pre_load_value_filter', 10, 2 );
/**
* Function for `acf/pre_load_value` filter-hook.
*
* @param integer|string $post_id The post id.
* @param $field
*
* @return integer|string
*/
function wp_kama_acf_pre_load_value_filter( $post_id, $field ){
// filter...
return $post_id;
}
- $post_id(int|строка)
- The post id.
- $field
- -
Список изменений
| С версии 5.0.0 | Введена. |
Где вызывается хук
acf/includes/acf-value-functions.php 72
$value = apply_filters( 'acf/pre_load_value', null, $post_id, $field );
Где используется хук в Advanced Custom Fields PRO
acf/includes/forms/form-customizer.php 214
add_filter( 'acf/pre_load_value', array( $this, 'pre_load_value' ), 10, 3 );
acf/includes/forms/form-user.php 185
add_filter( 'acf/pre_load_value', array( $this, 'filter_pre_load_value' ), 10, 3 );