"Test finished_callback without errors", 'init_message' => 'Custom Init Message', 'progress_message' => 'Step %current% of %total%.', 'operations' => array( array('test_batch_operation_params',array('a',1)), array(array('TestBatch','Operations'),array()), array('test_batch_operation_context_finished',array()), array('test_batch_operation',array()), ), 'finished' => 'test_batch_operations_callback' ); batch_operations_start($batch,get_admin_url( null, 'tools.php' ) . "?page=batch-operations-test"); break; case 12: $batch = array( 'title' => "Test finished_callback with errors", 'init_message' => 'Custom Init Message', 'progress_message' => 'Step %current% of %total%.', 'operations' => array( array('test_batch_operation_params',array('a')), array('test_batch_operation_params',array('Hello','World')), array(array('TestBatch','Operations'),array()), array('test_batch_operationh',array()), ), 'finished' => 'test_batch_operations_callback' ); batch_operations_start($batch,get_admin_url( null, 'tools.php' ) . "?page=batch-operations-test"); break; default: break; } ?>
' . print_r( $results, true ) . '
' . print_r( $errors, true ) . '', 'error'); } } class TestBatch { public function Operations(&$context){ sleep(2); $context['message'] = 'class TestBatch'; } }