Custom Product Tabs for WooCommerce - Version 1.7.8

Version Description

  • June 21st, 2022 =
  • Address minor vulnerability
  • Fix issue related to Divi Builder
Download this release

Release Info

Developer yikesinc
Plugin Icon 128x128 Custom Product Tabs for WooCommerce
Version 1.7.8
Comparing to
See all releases

Code changes from version 1.7.7 to 1.7.8

admin/class.settings.php CHANGED
@@ -89,7 +89,7 @@ class YIKES_Custom_Product_Tabs_Settings {
89
  array(
90
  'methods' => 'POST',
91
  'callback' => array( $this, 'rest_response' ),
92
- 'permission_callback' => '__return_true'
93
  )
94
  );
95
  }
@@ -114,6 +114,15 @@ class YIKES_Custom_Product_Tabs_Settings {
114
  return $response;
115
  }
116
 
 
 
 
 
 
 
 
 
 
117
  /**
118
  * Generate Admin Notices
119
  */
89
  array(
90
  'methods' => 'POST',
91
  'callback' => array( $this, 'rest_response' ),
92
+ 'permission_callback' => array( $this, 'permission_callback' )
93
  )
94
  );
95
  }
114
  return $response;
115
  }
116
 
117
+ /**
118
+ * Only allow admins to modify the content setting.
119
+ *
120
+ * @return bool
121
+ */
122
+ public function permission_callback(){
123
+ return current_user_can( 'manage_options' );
124
+ }
125
+
126
  /**
127
  * Generate Admin Notices
128
  */
public/class.yikes-woo-tabs-display.php CHANGED
@@ -36,7 +36,11 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Display' ) ) {
36
  * @return array | Array of this product's current tabs plus our custom tabs
37
  */
38
  public function add_custom_product_tabs( $tabs ) {
39
- global $product;
 
 
 
 
40
 
41
  $product_id = method_exists( $product, 'get_id' ) === true ? $product->get_id() : $product->ID;
42
 
36
  * @return array | Array of this product's current tabs plus our custom tabs
37
  */
38
  public function add_custom_product_tabs( $tabs ) {
39
+ $product = wc_get_product();
40
+
41
+ if ( empty( $product ) ) {
42
+ return $tabs;
43
+ }
44
 
45
  $product_id = method_exists( $product, 'get_id' ) === true ? $product->get_id() : $product->ID;
46
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://yikesinc.com
4
  Tags: woocommerce, product tabs, repeatable, duplicate, customize, custom, tabs, product, woo, commerce
5
  Requires at least: 3.8
6
  Tested up to: 6.0
7
- Stable tag: 1.7.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -75,6 +75,10 @@ Yes! Since v1.4 we've added the necessary code to ensure the custom tab data is
75
 
76
  == Changelog ==
77
 
 
 
 
 
78
  = 1.7.7 - March 8th, 2021 =
79
  * Housekeeping
80
 
4
  Tags: woocommerce, product tabs, repeatable, duplicate, customize, custom, tabs, product, woo, commerce
5
  Requires at least: 3.8
6
  Tested up to: 6.0
7
+ Stable tag: 1.7.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
75
 
76
  == Changelog ==
77
 
78
+ = 1.7.8 - June 21st, 2022 =
79
+ * Address minor vulnerability
80
+ * Fix issue related to Divi Builder
81
+
82
  = 1.7.7 - March 8th, 2021 =
83
  * Housekeeping
84