acf_flush_value_cache()
acf_flush_value_cache
Deletes all cached data for this value.
No Hooks.
Returns
null. Nothing (null).
Usage
acf_flush_value_cache( $post_id, $field_name );
- $post_id((int|string))
- The post id.
- $field_name(string)
- The field name.
Default:''
Changelog
| Since 5.7.10 | Introduced. |
acf_flush_value_cache() acf flush value cache code ACF 6.8.8
function acf_flush_value_cache( $post_id = 0, $field_name = '' ) {
// Delete stored data.
acf_get_store( 'values' )
->remove( "$post_id:$field_name" )
->remove( "$post_id:$field_name:formatted" )
->remove( "$post_id:$field_name:escaped" );
}