PHP code example of codesvault / wp-seeder

1. Go to this page and download the library: Download codesvault/wp-seeder 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/ */

    

codesvault / wp-seeder example snippets


class yourClassName extends WPSeeder
{
    public $table = "cv_users";    // db table name without prefix, default is posts.
    public $row = 5000;      // number of db table row will create, default is 1.

    public function run()
    {
        // add data that need to be inserted in database.
        // array key is the column name, value is data that will be stored.
        return array(
            'name' => $this->faker()->unique()->name(),
            'email' => $this->faker()->unique()->email(),
            'password' => $this->faker()->unique()->password()
        );
    }
}