2015-06-04 21:02:09 +00:00
|
|
|
=== Batch operations ===
|
2015-06-05 19:26:11 +00:00
|
|
|
Contributors: igor-v-belousov
|
2015-06-10 14:13:27 +00:00
|
|
|
Tags: batch, dev, development, prod, production
|
2015-06-08 13:29:01 +00:00
|
|
|
Requires at least: 3.5
|
2015-06-10 14:13:27 +00:00
|
|
|
Tested up to: 4.2
|
2015-08-16 01:57:15 +00:00
|
|
|
Stable tag: 0.1.0
|
|
|
|
License: GPLv2 or later
|
|
|
|
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
2015-06-04 21:02:09 +00:00
|
|
|
|
|
|
|
My version Drupal Batch API for WordPress.
|
|
|
|
|
2015-08-16 01:57:15 +00:00
|
|
|
== Description ==
|
|
|
|
|
|
|
|
Batch API need for running long-term operation without using the function
|
|
|
|
`set_time_limit` or CLI.
|
|
|
|
|
|
|
|
Long-term operation is divided into short-term sub-operations which are executed
|
|
|
|
in the order queue. Sub-operation can send a message below the progress bar.
|
2015-06-04 21:02:09 +00:00
|
|
|
|
2015-06-05 19:38:55 +00:00
|
|
|
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!';
|
|
|
|
}
|
|
|
|
|
2015-08-16 01:57:15 +00:00
|
|
|
== Installation ==
|
|
|
|
|
|
|
|
1. Upload latest stable version of code <https://github.com/IgorVBelousov/batch_operations/archive/master.zip>.
|
|
|
|
2. Unpack this archive to the `/wp-content/plugins/` directory
|
|
|
|
3. Activate the plugin through the 'Plugins' menu in WordPress
|
|
|
|
4. Use batch operations in your code.
|
|
|
|
|