PluginProbe
Brizy – Page Builder / trunk
Brizy – Page Builder vtrunk
2.8.23 2.8.22 2.8.21 2.8.20 2.8.19 2.8.18 2.8.17 2.8.16 2.8.15 2.8.14 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.6.9 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.15 2.7.16 All 188 releases
brizy / import / wp-cli.php

wp-cli.php in Brizy – Page Builder trunk, at import/wp-cli.php

40 lines 807 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php defined( 'ABSPATH' ) or die();
2
3 class Brizy_Import_WpCli extends WP_CLI_Command {
4 /**
5 * Import a Demo
6 *
7 * ## OPTIONS
8 *
9 * <id>
10 * : The id of the demo to import.
11 *
12 * ## EXAMPLES
13 *
14 * 1. wp brizy demo import 33
15 * - This will import the whole demo with the id 33.
16 *
17 * @param array $args
18 * @param array $assoc_args
19 *
20 * @throws \WP_CLI\ExitException
21 */
22 public function import( array $args, array $assoc_args ) {
23
24 if ( empty( $args[0] ) ) {
25 WP_CLI::error( 'Please specify the id off the demo to import' );
26 }
27
28 WP_CLI::log( 'Demo import started...' );
29
30 $import = new Brizy_Import_Import( $args[0] );
31
32 try {
33 $import->import();
34 WP_CLI::success( 'Demo imported successfully' );
35 } catch ( Exception $e ) {
36 WP_CLI::error( $e->getMessage() );
37 }
38 }
39 }
40