BP_Background_Process::delete_all_batches()

Delete all batches.

Description

Return

(WC_Background_Process)

Source

File: bp-core/classes/class-bp-background-process.php

186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
public function delete_all_batches() {
    global $wpdb;
 
    $table  = $wpdb->options;
    $column = 'option_name';
 
    if ( is_multisite() ) {
        $table  = $wpdb->sitemeta;
        $column = 'meta_key';
    }
 
    $key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%';
 
    $wpdb->query( $wpdb->prepare( "DELETE FROM {$table} WHERE {$column} LIKE %s", $key ) ); // @codingStandardsIgnoreLine.
 
    return $this;
}

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.