PluginProbe
Import WP – CSV & XML Import Export for WordPress / 2.7.1
Import WP – CSV & XML Import Export for WordPress v2.7.1
2.15.1 2.15.0 2.14.24 2.14.23 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.9.0 2.9.1 All 144 releases
jc-importer / class / Common / Cli / Command.php

Command.php in Import WP – CSV & XML Import Export for WordPress 2.7.1, at class/Common/Cli/Command.php

42 lines 833 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ImportWP\Common\Cli;
4
5 class Command
6 {
7 public static function register()
8 {
9 \WP_CLI::add_command('importwp', 'ImportWP\Common\Cli\Command');
10 }
11
12 /**
13 * Run a ImportWP Importer
14 *
15 * ## OPTIONS
16 *
17 * <importer-id>
18 * : ID of an existing importer.
19 *
20 * [--debug]
21 * : Log all php notices.
22 *
23 * ## EXAMPLES
24 *
25 * wp importwp import 1
26 *
27 * @param array $args
28 * @param array $assoc_args
29 */
30 public function import($args, $assoc_args)
31 {
32 $assoc_args['action'] = 'importwp';
33 $assoc_args['importer_id'] = trim($args[0]);
34
35 if (empty($assoc_args['importer_id'])) {
36 \WP_CLI::error("You must provide an importer id.");
37 }
38
39 \WP_CLI::success("Import Complete");
40 }
41 }
42