action_scheduler_queue_runner_flush_cache
When an external object cache is in use, and when wp_cache_flush_runtime() is not available, then normally the cache will not be flushed after processing a batch of actions (to avoid a performance penalty for other processes).
This filter makes it possible to override this behavior and always flush the cache, even if an external object cache is in use.
Использование
add_filter( 'action_scheduler_queue_runner_flush_cache', 'wp_kama_action_scheduler_queue_runner_flush_cache_filter' ); /** * Function for `action_scheduler_queue_runner_flush_cache` filter-hook. * * @param bool $flush_cache If the cache should be flushed. * * @return bool */ function wp_kama_action_scheduler_queue_runner_flush_cache_filter( $flush_cache ){ // filter... return $flush_cache; }
- $flush_cache(true|false)
- If the cache should be flushed.
Список изменений
С версии 1.0 | Введена. |
Где вызывается хук
action_scheduler_queue_runner_flush_cache
woocommerce/packages/action-scheduler/classes/ActionScheduler_QueueRunner.php 234
|| apply_filters( 'action_scheduler_queue_runner_flush_cache', false )