jmslbam/wp-cli-base-command

A base command for WP-CLI

1.0.0 2023-09-11 13:20 UTC

This package is auto-updated.

Last update: 2024-11-11 16:00:36 UTC


README

  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();
    }
}