diff --git a/includes/class-woocommerce-book-chapter-tab.php b/includes/class-woocommerce-book-chapter-tab.php index 8052406..32594c6 100644 --- a/includes/class-woocommerce-book-chapter-tab.php +++ b/includes/class-woocommerce-book-chapter-tab.php @@ -149,6 +149,27 @@ public function __construct ( $file = '', $version = '1.0.0' ) { load_plugin_textdomain('wc_book_chapter', false, dirname(plugin_basename(__FILE__)).'/lang/'); add_action('woocommerce_init', array($this, 'init')); + + add_filter('woocommerce_get_sections_products',function($sections){ + + $sections['rew-tabs'] = __( 'Tabs', 'woocommerce' ); + + return $sections; + + },10,1); + + add_filter('woocommerce_product_settings', function( $settings ){ + + global $current_section; + + if( $current_section == 'rew-tabs' ){ + + return array(); + } + + return $settings; + + },9999999999); $this->woo_settings = array( @@ -292,20 +313,6 @@ public function init(){ $this->notices->add_error('WooCommerce Book Chapter Tab '.__('requires at least WooCommerce ' . $this->woo_version . ' in order to work. Please upgrade WooCommerce first.', 'wc_book_chapter')); } } - - // Adds a few settings to control the images in the tab. - - function book_chapter_admin_settings(){ - - global $settings; - - woocommerce_admin_fields($this->woo_settings); - } - - function save_book_chapter_admin_settings(){ - - woocommerce_update_options($this->woo_settings); - } /** * Add a custom product tab.