Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 779 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 779 Bytes

Gravity Wiz Faker Packagist Version

A class for generating fake entry data for Gravity Forms forms. Note, this class does not actually create the entries.

Installation

Note: We recommend using Jetpack Autoloader to help prevent conflicts.

composer require gravitywiz/faker

Usage

<?php
$gwiz_faker = new \GWiz_Faker();
$form = GFAPI::get_form( 123 );
$entries_to_generate = 10;

for ( $i = 0; $i < $entries_to_generate; $i++ ) {
	$entries[] = $gwiz_faker->generate_entry( $form );
}

// Add the entries to the database.
foreach ( $entries as $entry ) {
	GFAPI::add_entry( $entry );
}