Skip to content

A WP-CLI base command to help with memory consuming processes like imports or migrations

Notifications You must be signed in to change notification settings

jmslbam/wp-cli-base-command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Usage

  1. Install via composer require jmslbam/wp-cli-base-command.

  2. Extend your own command:

<?php

use \JMSLBAM\WP_CLI\Base_Command;

class Import extends Base_Command {

    function import( $args, $assoc_args ) {

        $this->start_bulk_operation();

        // Optional: Disable a bunch of pre-defined plugin actions
        $this->disable_hooks();

        // Optional: Call "free_up_memory" after importing X amount of posts
        $this->free_up_memory();

        // Finalize your command
        $this->end_bulk_operation();
    }
}

About

A WP-CLI base command to help with memory consuming processes like imports or migrations

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages