Skip to content

Commit

Permalink
Merge pull request #298 from Ecwid/playground
Browse files Browse the repository at this point in the history
Playground
  • Loading branch information
meteor-ec authored Oct 3, 2024
2 parents 2eb4b1b + 48c28b3 commit 571d93f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ecwid-shopping-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -1638,10 +1638,11 @@ function ecwid_plugin_activation_redirect( $plugin ) {
&& count($_POST['checked']) > 1;

$is_cli_running = Ecwid_Config::is_cli_running();
$is_wp_playground = Ecwid_Config::is_wp_playground_running();

$is_newbie = ecwid_is_demo_store();

if( !$is_cli_running && !$is_bulk_activation && $is_newbie && $plugin == plugin_basename( __FILE__ ) ) {
if( !$is_cli_running && $is_wp_playground && !$is_bulk_activation && $is_newbie && $plugin == plugin_basename( __FILE__ ) ) {
wp_safe_redirect( Ecwid_Admin::get_dashboard_url() );
exit();
}
Expand Down
4 changes: 4 additions & 0 deletions includes/class-ecwid-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ public static function is_cli_running() {
return defined( 'WP_CLI' ) && WP_CLI;
}

public static function is_wp_playground_running() {
return defined( 'IS_PLAYGROUND_PREVIEW' ) && IS_PLAYGROUND_PREVIEW;
}

public static function load_from_cli( $config ) {

if ( ! $config ) {
Expand Down

0 comments on commit 571d93f

Please sign in to comment.