acf_flush_field_cache()
acf_flush_field_cache
Deletes all caches for this field.
Хуков нет.
Возвращает
null. Ничего (null).
Использование
acf_flush_field_cache( $field );
- $field(массив) (обязательный)
- The field array.
Список изменений
| С версии 5.7.10 | Введена. |
Код acf_flush_field_cache() acf flush field cache ACF 6.4.2
function acf_flush_field_cache( $field ) {
// Delete stored data.
acf_get_store( 'fields' )->remove( $field['key'] );
// Flush cached post_id for this field's name and key.
wp_cache_delete( acf_cache_key( "acf_get_field_post:name:{$field['name']}" ), 'acf' );
wp_cache_delete( acf_cache_key( "acf_get_field_post:key:{$field['key']}" ), 'acf' );
// Flush cached array of post_ids for this field's parent.
wp_cache_delete( acf_cache_key( "acf_get_field_posts:{$field['parent']}" ), 'acf' );
}