Tribe__Process__Queue::delete_all_queues( string $action )
Deletes all queues for a specific action.
Contents
Parameters
- $action
-
(string) (Required) The action (prefix) of the queues to delete.
Return
(int) The number of delete queues.
Source
File: src/Tribe/Process/Queue.php
public static function delete_all_queues( $action ) {
global $wpdb;
$table = $wpdb->options;
$column = 'option_name';
if ( is_multisite() ) {
$table = $wpdb->sitemeta;
$column = 'meta_key';
}
$action = $wpdb->esc_like( 'tribe_queue_' . $action ) . '%';
$queues = $wpdb->get_col( $wpdb->prepare( "
SELECT DISTINCT({$column})
FROM {$table}
WHERE {$column} LIKE %s
", $action ) );
if ( empty( $queues ) ) {
return 0;
}
$deleted = 0;
foreach ( $queues as $queue ) {
$deleted ++;
self::delete_queue( $queue );
}
return $deleted;
}
Changelog
| Version | Description |
|---|---|
| 4.7.19 | Introduced. |