Skip to content

Commit

Permalink
*Fix purge bulk action
Browse files Browse the repository at this point in the history
  • Loading branch information
pcfreak30 committed Jan 24, 2017
1 parent 09d58b0 commit 6f2c87b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/class-wp-criticalcss-queue-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,14 @@ public function prepare_items() {

private function _process_bulk_action() {
if ( 'purge' == $this->current_action() ) {
$queue = new WP_CriticalCSS_Background_Process();
$queue = new WP_CriticalCSS_API_Background_Process();
while ( ( $item = $queue->get_batch() ) && ! empty( $item->data ) ) {
$queue->delete( $item->key );
delete_transient( WP_CriticalCSS::get_transient_name( $item->data ) . '_pending' );
extract( $item->data );
$type = compact( 'object_id', 'type', 'url' );
$id = md5( serialize( $type ) );
$check = get_transient( "criticalcss_web_check_$id" );
delete_transient( $check );
}
}
}
Expand Down

0 comments on commit 6f2c87b

Please sign in to comment.