acf_delete_value()ACF 5.0.0

acf_delete_value

Deletes the value for a given field and post_id.

Хуки из функции

Возвращает

true|false..

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

acf_delete_value( $post_id, $field );
$post_id((int|string)) (обязательный)
The post id.
$field(массив) (обязательный)
The field array.

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

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

Код acf_delete_value() ACF 5.10.2

function acf_delete_value( $post_id, $field ) {

	/**
	 * Fires before a value is deleted.
	 *
	 * @date    28/09/13
	 * @since   5.0.0
	 *
	 * @param   string $post_id The post ID for this value.
	 * @param   mixed $name The meta name.
	 * @param   array $field The field array.
	 */
	do_action( 'acf/delete_value', $post_id, $field['name'], $field );

	// Delete meta.
	$return = acf_delete_metadata( $post_id, $field['name'] );

	// Delete reference.
	acf_delete_metadata( $post_id, $field['name'], true );

	// Delete stored data.
	acf_flush_value_cache( $post_id, $field['name'] );

	// Return delete status.
	return $return;
}