PHP code example of gravitywiz / batcher

1. Go to this page and download the library: Download gravitywiz/batcher library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gravitywiz / batcher example snippets



/*
 * Plugin Name:  Gravity Forms Batcher Example
 * Plugin URI:   http://gravitywiz.com
 * Description:  A plugin to do XYZ.
 * Author:       Gravity Wiz
 * Version:      0.1
 * Author URI:   http://gravitywiz.com
 */

add_action( 'init', function() {
	if ( ! is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
		return;
	}

	r" value="123" name="example_additional_input" /></p>',
		'get_items'    => function ( $size, $offset ) {
			// $example_additional_input = rgpost( 'example_additional_input' );

			$paging  = array(
				'offset'    => $offset,
				'page_size' => $size,
			);

			$entries = GFAPI::get_entries( null, array(), null, $paging, $total );

			return array(
				'items' => $entries,
				'total' => $total,
			);
		},
		'process_item' => function ( $entry ) {
			// Process the item here.
		},
	) );
} );