Changeset 3399261
- Timestamp:
- 11/19/2025 07:53:16 PM (4 months ago)
- Location:
- wb-custom-product-tabs-for-woocommerce
- Files:
-
- 46 added
- 7 edited
-
tags/1.6.0 (added)
-
tags/1.6.0/admin (added)
-
tags/1.6.0/admin/class-wb-custom-product-tabs-for-woocommerce-admin.php (added)
-
tags/1.6.0/admin/classes (added)
-
tags/1.6.0/admin/classes/class-wb-custom-product-tabs-for-woocommerce-feedback.php (added)
-
tags/1.6.0/admin/css (added)
-
tags/1.6.0/admin/css/wb-custom-product-tabs-for-woocommerce-admin.css (added)
-
tags/1.6.0/admin/images (added)
-
tags/1.6.0/admin/images/logo-blue.png (added)
-
tags/1.6.0/admin/index.php (added)
-
tags/1.6.0/admin/js (added)
-
tags/1.6.0/admin/js/wb-custom-product-tabs-for-woocommerce-admin.js (added)
-
tags/1.6.0/admin/partials (added)
-
tags/1.6.0/admin/partials/wb-custom-product-tabs-for-woocommerce-admin-display.php (added)
-
tags/1.6.0/admin/views (added)
-
tags/1.6.0/admin/views/-general-settings.php (added)
-
tags/1.6.0/admin/views/-help.php (added)
-
tags/1.6.0/admin/views/_global_tab_metabox.php (added)
-
tags/1.6.0/admin/views/_global_tab_products_metabox.php (added)
-
tags/1.6.0/admin/views/_tab_single.php (added)
-
tags/1.6.0/admin/views/product_data_panels.php (added)
-
tags/1.6.0/admin/views/settings.php (added)
-
tags/1.6.0/includes (added)
-
tags/1.6.0/includes/class-wb-custom-product-tabs-for-woocommerce-activator.php (added)
-
tags/1.6.0/includes/class-wb-custom-product-tabs-for-woocommerce-deactivator.php (added)
-
tags/1.6.0/includes/class-wb-custom-product-tabs-for-woocommerce-i18n.php (added)
-
tags/1.6.0/includes/class-wb-custom-product-tabs-for-woocommerce-loader.php (added)
-
tags/1.6.0/includes/class-wb-custom-product-tabs-for-woocommerce.php (added)
-
tags/1.6.0/includes/index.php (added)
-
tags/1.6.0/index.php (added)
-
tags/1.6.0/languages (added)
-
tags/1.6.0/languages/wb-custom-product-tabs-for-woocommerce.pot (added)
-
tags/1.6.0/license.txt (added)
-
tags/1.6.0/public (added)
-
tags/1.6.0/public/class-wb-custom-product-tabs-for-woocommerce-public.php (added)
-
tags/1.6.0/public/css (added)
-
tags/1.6.0/public/css/wb-custom-product-tabs-for-woocommerce-public.css (added)
-
tags/1.6.0/public/index.php (added)
-
tags/1.6.0/public/js (added)
-
tags/1.6.0/public/js/wb-custom-product-tabs-for-woocommerce-public.js (added)
-
tags/1.6.0/public/partials (added)
-
tags/1.6.0/public/partials/wb-custom-product-tabs-for-woocommerce-public-display.php (added)
-
tags/1.6.0/readme.txt (added)
-
tags/1.6.0/uninstall.php (added)
-
tags/1.6.0/wb-custom-product-tabs-for-woocommerce.php (added)
-
tags/1.6.0/wpml-config.xml (added)
-
trunk/admin/class-wb-custom-product-tabs-for-woocommerce-admin.php (modified) (2 diffs)
-
trunk/admin/views/-general-settings.php (modified) (1 diff)
-
trunk/admin/views/-help.php (modified) (2 diffs)
-
trunk/includes/class-wb-custom-product-tabs-for-woocommerce.php (modified) (3 diffs)
-
trunk/public/class-wb-custom-product-tabs-for-woocommerce-public.php (modified) (1 diff)
-
trunk/readme.txt (modified) (5 diffs)
-
trunk/wb-custom-product-tabs-for-woocommerce.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wb-custom-product-tabs-for-woocommerce/trunk/admin/class-wb-custom-product-tabs-for-woocommerce-admin.php
r3381997 r3399261 990 990 ) 991 991 ); 992 993 /** 994 * Register settings to disable WooCommerce default tabs. 995 * 996 * @since 1.6.0 997 */ 998 register_setting( 999 'wb_cptb_custom_tab_settings_group', 1000 'wb_cptb_enable_default_tabs', 1001 array( 1002 'type' => 'array', 1003 'sanitize_callback' => array( $this, 'sanitize_default_tab_status' ), 1004 'default' => array('description', 'additional_information', 'reviews'), 1005 ) 1006 ); 992 1007 } 993 1008 … … 1403 1418 return $postmeta; 1404 1419 } 1420 1421 /** 1422 * Sanitize WooCommerce default tab status option. 1423 * 1424 * @since 1.6.0 1425 * @param mixed $value Array of selected tab slugs. 1426 * @return string[] Sanitized tab slugs. 1427 */ 1428 public function sanitize_default_tab_status( $value ) { 1429 1430 $allowed = array( 'description', 'additional_information', 'reviews' ); 1431 1432 // Ensure it's an array 1433 if ( ! is_array( $value ) ) { 1434 return array(); 1435 } 1436 1437 // Sanitize each value 1438 $sanitized = array(); 1439 foreach ( $value as $item ) { 1440 $item = sanitize_text_field( $item ); 1441 if ( in_array( $item, $allowed, true ) ) { 1442 $sanitized[] = $item; 1443 } 1444 } 1445 1446 return $sanitized; 1447 } 1405 1448 } -
wb-custom-product-tabs-for-woocommerce/trunk/admin/views/-general-settings.php
r3381997 r3399261 58 58 59 59 <tr valign="top"> 60 <th scope="row"><?php esc_html_e( 'Enable default tabs', 'wb-custom-product-tabs-for-woocommerce' ); ?></th> 61 62 <td> 63 <?php 64 $default_tabs_status = Wb_Custom_Product_Tabs_For_Woocommerce::get_default_woo_tab_status(); 65 ?> 66 67 <label style="display:block; margin-bottom:6px;"> 68 <input type="checkbox" name="wb_cptb_enable_default_tabs[]" value="description" 69 <?php checked( in_array( 'description', $default_tabs_status, true ) ); ?> /> 70 <?php esc_html_e( 'Description', 'wb-custom-product-tabs-for-woocommerce' ); ?> 71 </label> 72 73 <label style="display:block; margin-bottom:6px;"> 74 <input type="checkbox" name="wb_cptb_enable_default_tabs[]" value="additional_information" 75 <?php checked( in_array( 'additional_information', $default_tabs_status, true ) ); ?> /> 76 <?php esc_html_e( 'Additional Information', 'wb-custom-product-tabs-for-woocommerce' ); ?> 77 </label> 78 79 <label style="display:block; margin-bottom:6px;"> 80 <input type="checkbox" name="wb_cptb_enable_default_tabs[]" value="reviews" 81 <?php checked( in_array( 'reviews', $default_tabs_status, true ) ); ?> /> 82 <?php esc_html_e( 'Reviews', 'wb-custom-product-tabs-for-woocommerce' ); ?> 83 </label> 84 </td> 85 </tr> 86 87 88 <tr valign="top"> 60 89 <th scope="row"><?php esc_html_e( 'Default Behavior of Global Tabs', 'wb-custom-product-tabs-for-woocommerce' ); ?></th> 61 90 <td> -
wb-custom-product-tabs-for-woocommerce/trunk/admin/views/-help.php
r3381997 r3399261 245 245 </div> 246 246 247 248 247 <!-- Question: 6 --> 249 248 <div class="wb-cptb-accordion-item"> … … 262 261 <?php esc_html_e( 'Before importing the tabs, you must first import Products, Categories, Tags, and Brands. This ensures that all tab assignments are mapped correctly to the corresponding items.', 'wb-custom-product-tabs-for-woocommerce' ); ?> 263 262 </p> 263 </div> 264 </div> 265 266 <!-- Question: 7 --> 267 <div class="wb-cptb-accordion-item"> 268 <button class="wb-cptb-accordion-button"> 269 <?php esc_html_e( 'Can I disable WooCommerce default tabs?', 'wb-custom-product-tabs-for-woocommerce' ); ?> 270 </button> 271 <div class="wb-cptb-accordion-content"> 272 <p><?php esc_html_e( 'Yes. The plugin allows you to control which default WooCommerce tabs appear on product pages. You can enable or disable the Description, Additional Information, and Reviews tabs directly from the plugin settings.', 'wb-custom-product-tabs-for-woocommerce' ); ?></p> 264 273 </div> 265 274 </div> -
wb-custom-product-tabs-for-woocommerce/trunk/includes/class-wb-custom-product-tabs-for-woocommerce.php
r3381997 r3399261 70 70 $this->version = WB_CUSTOM_PRODUCT_TABS_FOR_WOOCOMMERCE_VERSION; 71 71 } else { 72 $this->version = '1. 5.3';72 $this->version = '1.6.0'; 73 73 } 74 74 $this->plugin_name = 'wb-custom-product-tabs-for-woocommerce'; … … 320 320 */ 321 321 $this->loader->add_action( 'wp_footer', $plugin_public, 'activate_tab_by_url' ); 322 323 324 /** 325 * Hide the default WooCommerce tabs based on plugin settings. 326 * 327 * @since 1.6.0 328 */ 329 $this->loader->add_filter( 'woocommerce_product_tabs', $plugin_public, 'toggle_default_tabs', 20 ); 322 330 } 323 331 … … 967 975 return $taxonomies; 968 976 } 977 978 /** 979 * Get WooCommerce default tab status. 980 * 981 * @since 1.6.0 982 * @return string[] Slugs of enabled WooCommerce default tabs. 983 */ 984 public static function get_default_woo_tab_status() { 985 return get_option( 986 'wb_cptb_enable_default_tabs', 987 array( 'description', 'additional_information', 'reviews' ) 988 ); 989 } 969 990 } -
wb-custom-product-tabs-for-woocommerce/trunk/public/class-wb-custom-product-tabs-for-woocommerce-public.php
r3352137 r3399261 287 287 } 288 288 289 /** 290 * Hide the default WooCommerce tabs based on plugin settings. 291 * 292 * @since 1.6.0 293 * @param array $tabs Array of WooCommerce tabs. 294 * @return array Modified tabs. 295 */ 296 public function toggle_default_tabs( $tabs ) { 297 298 $default_tabs_status = Wb_Custom_Product_Tabs_For_Woocommerce::get_default_woo_tab_status(); 299 300 $supported_tabs = array( 301 'description', 302 'additional_information', 303 'reviews', 304 ); 305 306 if ( is_array( $tabs ) && is_array( $default_tabs_status ) ) { 307 308 foreach ( $supported_tabs as $key ) { 309 310 if ( isset( $tabs[ $key ] ) && ! in_array( $key, $default_tabs_status, true ) ) { 311 unset( $tabs[ $key ] ); 312 } 313 314 } 315 } 316 317 return $tabs; 318 } 289 319 } -
wb-custom-product-tabs-for-woocommerce/trunk/readme.txt
r3381997 r3399261 2 2 Contributors: webbuilder143 3 3 Donate link: https://webbuilder143.com/?utm_source=wordpressorg&utm_medium=readme&utm_campaign=donate-link&utm_id=tabs-plugin&utm_content=donate 4 Tags: product tabs, tab manager, woocommerce custom tabs, woocommerce product tabs, tabs plugin4 Tags: product tabs, tabs plugin, woocommerce custom tabs, woocommerce product tabs, tabs 5 5 Requires at least: 3.5.0 6 6 Tested up to: 6.8 7 7 Requires PHP: 5.6 8 Stable tag: 1. 5.38 Stable tag: 1.6.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Add unlimited additional tabs to WooCommerce products and assign them by category, tag, brand, or product. Supports sorting, shortcode etc. 12 Create unlimited WooCommerce tabs and assign them in bulk by category, tag, brand, or product. Also disable WooCommerce’s default product tabs. 13 13 14 14 == Description == … … 25 25 ✅ Unlimited Custom Tabs – Add as many custom tabs as needed for your WooCommerce products. 26 26 ✅ Global Tabs – Create tabs that can be assigned to multiple products based on categories, tags, and WooCommerce brands. 27 ✅ Category specific Tabs. 28 ✅ Option to disable WooCommerce default product tabs such as the Description, Additional Information, and Reviews tabs. 29 ✅ Product specific Tabs. 30 ✅ Supports the default WordPress Exporter and the WordPress Importer plugin to migrate the tabs. 27 31 ✅ Brand-Specific Tabs – Fully supports WooCommerce's default brand functionality and third-party brand plugins like [Perfect Brands for WooCommerce](https://wordpress.org/plugins/perfect-woocommerce-brands/). 28 32 ✅ YouTube Embed Support – Easily embed YouTube videos directly within product tabs. … … 97 101 To add tabs to a product, navigate to the product edit screen in WooCommerce. In the left corner of the Product Data box, you will find the "Custom Tabs" option. 98 102 103 = Can I disable WooCommerce default tabs? = 104 Absolutely. The plugin allows you to control which default WooCommerce tabs appear on product pages. You can enable or disable the Description, Additional Information, and Reviews tabs directly from the plugin settings. 105 99 106 = Can I add HTML content? = 100 107 Yes, you can add HTML content. The tab content section uses the standard WP editor, allowing you to include any HTML content supported by the WordPress post editor. … … 155 162 156 163 == Changelog == 164 165 = 1.6.0 = 166 * [Add] New option to disable WooCommerce default tabs. 167 * Tested with: WooCommerce 10.3.5 157 168 158 169 = 1.5.3 = … … 352 363 == Upgrade Notice == 353 364 354 = 1. 5.3=355 * [ Improvement] Added compatibility with the WordPress Export tool and the WordPress Importer plugin by @wordpressdotorg.356 * Tested with: WooCommerce 10. 2.2365 = 1.6.0 = 366 * [Add] New option to disable WooCommerce default tabs. 367 * Tested with: WooCommerce 10.3.5 -
wb-custom-product-tabs-for-woocommerce/trunk/wb-custom-product-tabs-for-woocommerce.php
r3381997 r3399261 12 12 * Plugin URI: https://wordpress.org/plugins/wb-custom-product-tab-for-wooCommerce/ 13 13 * Description: Create your own product tabs and assign it to your WooCommerce products 14 * Version: 1. 5.314 * Version: 1.6.0 15 15 * WC requires at least: 5.0.0 16 * WC tested up to: 10. 216 * WC tested up to: 10.3 17 17 * Author: Web Builder 143 18 18 * Author URI: https://profiles.wordpress.org/webbuilder143/ … … 30 30 /** 31 31 * Currently plugin version. 32 * Start at version 1.0.0 and use SemVer - https://semver.org33 * Rename this for your plugin and update it as you release new versions.34 32 */ 35 define( 'WB_CUSTOM_PRODUCT_TABS_FOR_WOOCOMMERCE_VERSION', '1. 5.3' );33 define( 'WB_CUSTOM_PRODUCT_TABS_FOR_WOOCOMMERCE_VERSION', '1.6.0' ); 36 34 define( 'WB_TAB_PLUGIN_FILENAME', __FILE__ ); 37 35 define( 'WB_TAB_ROOT_PATH', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.