acf/pre_load_post_id │ хук-фильтр │ ACF 5.0.0

acf_get_valid_post_id

This function will return a valid post_id based on the current screen / parameter

Использование

add_filter( 'acf/pre_load_post_id', 'wp_kama_acf_pre_load_post_id_filter', 10, 2 );

/**
 * Function for `acf/pre_load_post_id` filter-hook.
 * 
 * @param $post_id $null    (mixed)
 * @param          $post_id 
 *
 * @return $post_id
 */
function wp_kama_acf_pre_load_post_id_filter( $null, $post_id ){
	// filter...
	return $null;
}
$null($post_id)
(mixed)
$post_id
-

Список изменений

С версии 5.0.0 Введена.

Где вызывается хук

acf_get_valid_post_id()
acf/pre_load_post_id
acf/includes/api/api-helpers.php 2261
$preload = apply_filters( 'acf/pre_load_post_id', null, $post_id );

Где используется хук в Advanced Custom Fields PRO

acf/includes/local-meta.php 40
add_filter( 'acf/pre_load_post_id', array( $this, 'pre_load_post_id' ), 1, 2 );