acf/pre_load_post_id filter-hookACF 5.0.0

acf_get_valid_post_id

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

Usage

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
-

Changelog

Since 5.0.0 Introduced.

Where the hook is called

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 );

Where the hook is used in 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 );