Tribe__Process__Queue::stop_queue( string $queue_id )
Stops a queue that might be running.
Contents
The queue process results are not rolled back (e.g. 200 posts to create, stopped after 50, those 50 posts will persist).
See also
- Tribe__Process__Queue::save(): to get the queue unique id.
Parameters
- $queue_id
-
(string) (Required) The unique identifier of the queue that should be stopped.
Return
(bool) Whether the queue was correctly stopped, and its information deleted, or not.
Source
File: src/Tribe/Process/Queue.php
public static function stop_queue( $queue_id ) {
$meta = (array) get_transient( $queue_id . '_meta' );
delete_transient( $queue_id . '_meta' );
if ( ! empty( $meta['identifier'] ) ) {
delete_site_transient( $meta['identifier'] . '_process_lock' );
}
return delete_site_option( $queue_id );
}
Changelog
| Version | Description |
|---|---|
| 4.7.12 | Introduced. |