Skip to content

Commit

Permalink
hidding the setup list of woocommerce
Browse files Browse the repository at this point in the history
  • Loading branch information
ramyakrishnai committed Nov 27, 2023
1 parent dd26012 commit 8314d98
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions includes/ECommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public function __construct( Container $container ) {
add_action( 'load-toplevel_page_' . $container->plugin()->id, array( $this, 'register_assets' ) );
add_action( 'load-toplevel_page_' . $container->plugin()->id, array( $this, 'register_textdomains' ) );
add_action('wp_body_open', array( $this, 'regiester_site_preview' ));
add_action('before_woocommerce_init', array( $this,'hide_woocommerce_set_up') );

// Handle WonderCart Integrations
if ( is_plugin_active( 'wonder-cart/init.php' ) ) {
Expand Down Expand Up @@ -323,4 +324,15 @@ public function regiester_site_preview() {
echo "<div style='background-color: #e71616; padding: 0 16px;color:#ffffff;font-size:16px;text-align:center;font-weight: 590;'>" . esc_html__( 'Site Preview - This site is NOT LIVE, only admins can see this view.', 'wp-module-ecommerce' ) . "</div>";
}
}
public function hide_woocommerce_set_up() {
$hidden_list = get_option('woocommerce_task_list_hidden_lists', []);
if(! in_array("setup", $hidden_list)){
$woocommerce_list = array_merge(get_option('woocommerce_task_list_hidden_lists', []),array(
"setup"
));
// $woocommerce_list = array("setup");
update_option('woocommerce_task_list_hidden_lists', $woocommerce_list);
}

}
}

0 comments on commit 8314d98

Please sign in to comment.