mirror of
https://github.com/proelements/proelements.git
synced 2026-04-05 20:13:47 +00:00
v3.33.1
This commit is contained in:
37
modules/wp-cli/license-command.php
Normal file
37
modules/wp-cli/license-command.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\WpCli;
|
||||
|
||||
use ElementorPro\License\Admin;
|
||||
use ElementorPro\License\API;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
/**
|
||||
* Elementor Page Builder Pro cli tools.
|
||||
*/
|
||||
class License_Command extends \WP_CLI_Command {
|
||||
|
||||
/**
|
||||
* Activate Elementor Pro License key.
|
||||
*
|
||||
* ## EXAMPLES
|
||||
*
|
||||
* 1. wp elementor-pro license activate <license-key>
|
||||
* - This will try activate your license key.
|
||||
*/
|
||||
public function activate( $args, $assoc_args ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Deactivate Elementor Pro License key.
|
||||
*
|
||||
* ## EXAMPLES
|
||||
*
|
||||
* 1. wp elementor-pro license deactivate.
|
||||
* - This will deactivate your license key.
|
||||
*/
|
||||
public function deactivate() {
|
||||
}
|
||||
}
|
||||
38
modules/wp-cli/module.php
Normal file
38
modules/wp-cli/module.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\WpCli;
|
||||
|
||||
use Elementor\Core\Base\Module as BaseModule;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class Module extends BaseModule {
|
||||
|
||||
/**
|
||||
* Get module name.
|
||||
*
|
||||
* @since 2.1.0
|
||||
* @access public
|
||||
*
|
||||
* @return string Module name.
|
||||
*/
|
||||
public function get_name() {
|
||||
return 'wp-cli';
|
||||
}
|
||||
|
||||
public static function is_active() {
|
||||
return defined( 'WP_CLI' ) && WP_CLI;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @since 2.1.0
|
||||
* @access public
|
||||
*/
|
||||
public function __construct() {
|
||||
// \WP_CLI::add_command( 'elementor-pro license', '\ElementorPro\Modules\WpCli\License_Command' );
|
||||
\WP_CLI::add_command( 'elementor-pro update', '\ElementorPro\Modules\WpCli\Update' );
|
||||
\WP_CLI::add_command( 'elementor-pro theme-builder', '\ElementorPro\Modules\WpCli\ThemeBuilder' );
|
||||
}
|
||||
}
|
||||
36
modules/wp-cli/theme-builder.php
Normal file
36
modules/wp-cli/theme-builder.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\WpCli;
|
||||
|
||||
use ElementorPro\Modules\ThemeBuilder\Classes\Conditions_Cache;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
/**
|
||||
* Elementor Pro Page Builder cli tools.
|
||||
*/
|
||||
class ThemeBuilder extends \WP_CLI_Command {
|
||||
|
||||
/**
|
||||
* Clear template conditions cache.
|
||||
*
|
||||
* ## EXAMPLES
|
||||
*
|
||||
* 1. wp elementor-pro theme-builder clear-conditions
|
||||
*
|
||||
* @since 3.13.0
|
||||
* @access public
|
||||
* @alias clear-conditions
|
||||
*/
|
||||
public function clear_conditions() {
|
||||
$cache = new Conditions_Cache();
|
||||
$cache_cleared = $cache->regenerate();
|
||||
|
||||
if ( is_wp_error( $cache_cleared ) ) {
|
||||
\WP_CLI::error( $cache_cleared->get_error_message() );
|
||||
}
|
||||
|
||||
\WP_CLI::success( 'Template conditions cache is cleared.' );
|
||||
}
|
||||
}
|
||||
18
modules/wp-cli/update.php
Normal file
18
modules/wp-cli/update.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\WpCli;
|
||||
|
||||
use Elementor\Modules\WpCli\Update as UpdateBase;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
/**
|
||||
* Elementor Page Builder Pro cli tools.
|
||||
*/
|
||||
class Update extends UpdateBase {
|
||||
|
||||
protected function get_update_db_manager_class() {
|
||||
return '\ElementorPro\Core\Upgrade\Manager';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user