ACF_Local_Meta::pre_load_metadata()publicACF 5.8.0

pre_load_metadata

Injects the local meta.

Метод класса: ACF_Local_Meta{}

Хуков нет.

Возвращает

Разное.

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

$ACF_Local_Meta = new ACF_Local_Meta();
$ACF_Local_Meta->pre_load_metadata( $null, $post_id, $name, $hidden );
$null(null) (обязательный)
An empty parameter. Return a non null value to short-circuit the function.
$post_id((int|string)) (обязательный)
The post id.
$name(строка) (обязательный)
The meta name.
$hidden(true|false) (обязательный)
If the meta is hidden (starts with an underscore).

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

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

Код ACF_Local_Meta::pre_load_metadata() ACF 6.0.4

function pre_load_metadata( $null, $post_id, $name, $hidden ) {
	$name = ( $hidden ? '_' : '' ) . $name;
	if ( isset( $this->meta[ $post_id ] ) ) {
		if ( isset( $this->meta[ $post_id ][ $name ] ) ) {
			return $this->meta[ $post_id ][ $name ];
		}
		return '__return_null';
	}
	return $null;
}