2017 © Pedro Peláez
 

wordpress-plugin seeder

Perform heavy and/or infrequent actions in a controlled manner

image

aaronholbrook/seeder

Perform heavy and/or infrequent actions in a controlled manner

  • Thursday, June 22, 2017
  • by aaronholbrook
  • Repository
  • 0 Watchers
  • 5 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 233 % Grown

The README.md

Seeder

, (*1)

Purpose

Perform heavy / infrequent actions in a controlled manner., (*2)

Usage

Use the A7\Seeder\add_seed function to register the seed., (*3)

\A7\Seeder\add_seed( [
    'name'        => 'User Roles',
    'description' => 'Build user roles',
    'callback'    => 'Dev\user_roles',
] );

This registers the seed with the callback of Dev\user_roles. Create a function with that name (in the appropriate namespace) and this will be the function that runs when you initiate the seed., (*4)

You can also just create a closure right there:, (*5)

\A7\Seeder\add_seed( [
    'name'        => 'User Roles',
    'description' => 'Build user roles',
    'callback'    => function() {
        // .. do some logic ..

        echo 'Status of logic';
    },
] );

namespace Dev; function user_roles() { // .. do some logic .. echo 'Status of the logic...'; }

Go to Tools -> Seeder and click the corresponding seed button to initialize the callback that you registered., (*6)

This could be anything such as pre-filling content, auto-creating terms, updating the database in a certain manner, talking to or updating an API, etc., (*7)

Anything output during the seed callback will get output in an admin notice., (*8)

The Versions

22/06 2017

dev-feature/v2

dev-feature/v2

Perform heavy and/or infrequent actions in a controlled manner

  Sources   Download

18/06 2017

dev-master

9999999-dev

Perform heavy and/or infrequent actions in a controlled manner

  Sources   Download

26/03 2016

1.0.0

1.0.0.0

Perform heavy and/or infrequent actions in a controlled manner

  Sources   Download

03/06 2015

0.1.0

0.1.0.0

Perform heavy and/or infrequent actions in a controlled manner

  Sources   Download