PHP code example of bojaghi / seed-objects

1. Go to this page and download the library: Download bojaghi/seed-objects 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/ */

    

bojaghi / seed-objects example snippets




use Bojaghi\SeedObjects\SeedObjects;

$seedObjects = new SeedObjects(
    [
        'isPlugin'             => true,  // 'true' for plugins, 'false' for themes.
        'removeOnDeactivation' => false, // 'true' if you want to delete all seed objects after the deactivation.
        'mainFile'             => '/path/to/plugin/main_file' // Required if isPlugin=true.
        'comments'             => '',    // Path or configuration array for comments/posts/terms/users.
        'posts'                => '',
        'terms'                => '',
        'users'                => '',
    ],
);


/** 
 * /path/to/posts/configuration/post-seeds.php 
 */
 
// Prevent direct access.
if (!defined('ABSPATH')) {
    exist;
}

return array(
    // #1
    array(
        'post_title' => 'Foo #1',
        'post_type'  => 'post',
        /* ... */
    ),
    // #2
    array(/* .. */),
     // #3
    array(/* .. */),
     // #4
    array(/* .. */),
);