From 4256c424327ab6fa51aca1ff703908b4330dbe63 Mon Sep 17 00:00:00 2001 From: Igor V Belousov Date: Fri, 5 Jun 2015 22:38:55 +0300 Subject: [PATCH] add example in readme.txt --- readme.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/readme.txt b/readme.txt index 39ff491..6d22f85 100644 --- a/readme.txt +++ b/readme.txt @@ -8,3 +8,15 @@ My version Drupal Batch API for WordPress. == Description == +Example code: + + $batch['title']='Title'; + $batch['operations'][]=array('test_batch_operation',array()); + + batch_operations_start($batch); + + function test_batch_operation(&$context) { + file_put_contents( ABSPATH . 'test.txt', "batch work" ); + $context['message'] = 'Yeap! Work!'; + } +