WP_Background_Process::is_queue_empty()

Is queue empty

Description

Return

(bool)

Source

File: bp-core/libraries/wp-background-process.php

187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
protected function is_queue_empty() {
    global $wpdb;
 
    $table  = $wpdb->options;
    $column = 'option_name';
 
    if ( is_multisite() ) {
        $table  = $wpdb->sitemeta;
        $column = 'meta_key';
    }
 
    $key = $this->identifier . '_batch_%';
 
    $count = $wpdb->get_var( $wpdb->prepare( "
    SELECT COUNT(*)
    FROM {$table}
    WHERE {$column} LIKE %s
", $key ) );
 
    return ! ( $count > 0 );
}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.