From 286d04153c842010b6a1ee97b88fc5e1da6ccbe8 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 14 Nov 2017 12:08:57 +0000 Subject: [PATCH] Add class to handle changes --- includes/class-wc-customizer.php | 59 ++++++++++++++++++++++++++++++++ includes/class-woocommerce.php | 3 +- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 includes/class-wc-customizer.php diff --git a/includes/class-wc-customizer.php b/includes/class-wc-customizer.php new file mode 100644 index 00000000000..90fd700df2d --- /dev/null +++ b/includes/class-wc-customizer.php @@ -0,0 +1,59 @@ +add_section( + 'woocommerce_display_settings', + array( + 'title' => __( 'WooCommerce', 'woocommerce' ), + 'priority' => 1000, + ) + ); + + $wp_customize->add_setting( + 'woocommerce_demo_store_notice', + array( + 'default' => __( 'This is a demo store for testing purposes — no orders shall be fulfilled.', 'woocommerce' ), + 'sanitize_callback' => 'wp_kses_post', + ) + ); + + $wp_customize->add_control( + 'control_name', + array( + 'label' => __( 'Store notice', 'mytheme' ), + 'description' => __( 'Shown at the top of your store above the header and visible to customers.', 'twentyfifteen' ), + 'section' => 'woocommerce_display_settings', + 'settings' => 'woocommerce_demo_store_notice', + 'type' => 'textarea', + ) + ); + } + + +} + +new WC_Customizer(); diff --git a/includes/class-woocommerce.php b/includes/class-woocommerce.php index 56273cffbf5..c30fa1c17ac 100644 --- a/includes/class-woocommerce.php +++ b/includes/class-woocommerce.php @@ -337,6 +337,7 @@ final class WooCommerce { include_once( WC_ABSPATH . 'includes/class-wc-background-emailer.php' ); include_once( WC_ABSPATH . 'includes/class-wc-discounts.php' ); include_once( WC_ABSPATH . 'includes/class-wc-cart-totals.php' ); + include_once( WC_ABSPATH . 'includes/class-wc-customizer.php' ); /** * Data stores - used to store and retrieve CRUD object data from the database. @@ -398,7 +399,7 @@ final class WooCommerce { } /** - * Include classes sfor theme support. + * Include classes for theme support. * * @since 3.3.0 */