From 34cb2bc16ee59feefdd5b399d71ec3334f24c15f Mon Sep 17 00:00:00 2001 From: Guilherme Capanema Date: Mon, 7 Oct 2019 09:12:21 -0300 Subject: [PATCH] =?UTF-8?q?Adiciona=20op=C3=A7=C3=A3o=20de=20desativar=20a?= =?UTF-8?q?=20folha=20de=20estilos.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/class-wc-cdp-admin.php | 6 ++++++ includes/class-wc-cdp.php | 5 +++-- public/partials/product-bundle-modal.php | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/admin/class-wc-cdp-admin.php b/admin/class-wc-cdp-admin.php index e21c39a..e99a5e9 100755 --- a/admin/class-wc-cdp-admin.php +++ b/admin/class-wc-cdp-admin.php @@ -137,6 +137,12 @@ class Wc_Cdp_Admin { 'type' => 'text', ); + $settings_wc_cdp[] = array( + 'name' => __( 'Incluir folha de estilos padrĂ£o', 'wc-cdp' ), + 'id' => 'wc_cdp_enable_stylesheet', + 'type' => 'checkbox', + ); + $settings_wc_cdp[] = array( 'type' => 'sectionend', 'id' => 'wc-cdp' ); return $settings_wc_cdp; diff --git a/includes/class-wc-cdp.php b/includes/class-wc-cdp.php index c5d073c..9e9870c 100755 --- a/includes/class-wc-cdp.php +++ b/includes/class-wc-cdp.php @@ -176,14 +176,15 @@ class Wc_Cdp { $plugin_public = new Wc_Cdp_Public( $this->get_plugin_name(), $this->get_version() ); - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); + if ( get_option( 'wc_cdp_enable_stylesheet' ) === 'yes' ) { + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); + } $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); $this->loader->add_action( 'woocommerce_add_to_cart', $plugin_public, 'maybe_display_bundle_modal', 10, 2 ); $this->loader->add_action( 'admin_post_wc_cdp_add_to_cart', $plugin_public, 'add_bundle_to_cart' ); $this->loader->add_action( 'admin_post_nopriv_wc_cdp_add_to_cart', $plugin_public, 'add_bundle_to_cart' ); - // $this->loader->add_action( 'wp_loaded', $plugin_public, 'add_to_cart_multiple' , 15); } diff --git a/public/partials/product-bundle-modal.php b/public/partials/product-bundle-modal.php index e856268..a887aec 100644 --- a/public/partials/product-bundle-modal.php +++ b/public/partials/product-bundle-modal.php @@ -105,7 +105,7 @@