_acf_snapshot_stored_post_ids() │ ACF 6.8.11

The internal ACF function to record an object's stored post IDs during a user-submitted save, when the first field that is, or contains, a relational field is updated, before any of them are changed. Saves without relational fields don't record anything.

Внутренняя функция — эта функция рассчитана на использование самим ядром. Не рекомендуется использовать эту функцию в своем коде.

Хуков нет.

Возвращает

mixed.

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

_acf_snapshot_stored_post_ids( $check, $value, $post_id, $field );
$check(разное) (обязательный)
The short-circuit value, returned unchanged.
$value(разное) (обязательный)
The value being updated.
$post_id(int|строка) (обязательный)
The ACF post ID being saved.
$field(массив) (обязательный)
The field being updated.

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

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

Код _acf_snapshot_stored_post_ids() ACF 6.8.11

function _acf_snapshot_stored_post_ids( $check, $value, $post_id, $field ) {
	if ( ! _acf_is_checking_submitted_post_ids() ) {
		return $check;
	}

	$snapshots = (array) acf_get_data( 'acf_stored_post_ids_snapshots' );

	if ( ! isset( $snapshots[ _acf_get_stored_values_post_id( $post_id ) ] ) && is_array( $field ) && _acf_field_has_relational_fields( $field ) ) {
		_acf_get_stored_post_ids_snapshot( $post_id );
	}

	return $check;
}