Version Description
Download this release
Release Info
Developer | eherman24 |
Plugin | Custom Product Tabs for WooCommerce |
Version | 1.8.0 |
Comparing to | |
See all releases |
Code changes from version 1.7.9 to 1.8.0
- admin/class.premium.php +116 -104
- admin/class.settings.php +155 -154
- admin/class.support.php +24 -13
- admin/class.yikes-woo-generate-html.php +49 -52
- admin/class.yikes-woo-saved-tabs.php +20 -15
- admin/class.yikes-woo-tabs.php +27 -25
- admin/page.support.php +1 -1
- admin/page.yikes-woo-saved-tabs-single.php +87 -64
- admin/page.yikes-woo-saved-tabs.php +161 -134
- changelog.txt +213 -0
- css/dist/lity.min.css +0 -3
- css/lity.css +200 -0
- css/lity.min.css +3 -0
- css/repeatable-custom-tabs.css +502 -11
- css/repeatable-custom-tabs.min.css +1 -1
- js/lity.js +638 -0
- js/lity.min.js +4 -3
- js/repeatable-custom-tabs-settings.js +20 -5
- js/repeatable-custom-tabs-settings.min.js +1 -1
- js/repeatable-custom-tabs.js +774 -1
- js/repeatable-custom-tabs.min.js +1 -1
- js/twitter-embed.min.js +1 -0
- languages/yikes-inc-easy-custom-woocommerce-product-tabs.pot +193 -83
- readme.txt +15 -202
- yikes-inc-easy-custom-woocommerce-product-tabs.php +81 -17
admin/class.premium.php
CHANGED
@@ -1,121 +1,133 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
|
10 |
-
|
11 |
-
|
12 |
|
13 |
-
|
14 |
-
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
}
|
34 |
}
|
|
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
}
|
44 |
-
|
45 |
-
// Add our custom settings page
|
46 |
-
add_submenu_page(
|
47 |
-
YIKES_Custom_Product_Tabs_Settings_Page, // Parent menu item slug
|
48 |
-
__( 'Go Pro', 'yikes-inc-easy-custom-woocommerce-product-tabs' ), // Tab title name (HTML title)
|
49 |
-
__( 'Go Pro', 'yikes-inc-easy-custom-woocommerce-product-tabs' ), // Menu page name
|
50 |
-
apply_filters( 'yikes-woo-premium-capability', 'publish_products' ), // Capability required
|
51 |
-
YIKES_Custom_Product_Tabs_Premium_Page, // Page slug (?page=slug-name)
|
52 |
-
array( $this, 'premium_page' ) // Function to generate page
|
53 |
-
);
|
54 |
}
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
<div class="yikes-woo-all-about-us">
|
74 |
-
<div class="postbox yikes-woo-review-us">
|
75 |
-
|
76 |
-
<h3 class="yikes-woo-review-us-title">Show Us Some Love</h3>
|
77 |
-
<div class="yikes-woo-review-us-body">
|
78 |
-
<div class="yikes-woo-review-us yikes-woo-all-about-us-box" id="yikes-woo-review-us">
|
79 |
-
|
80 |
-
<p><?php _e( 'Leave a review!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?> </p>
|
81 |
-
<p class="star-container">
|
82 |
-
<a href="https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs/reviews/?rate=5#new-post" target="_blank">
|
83 |
-
<span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span>
|
84 |
-
</a>
|
85 |
-
</p>
|
86 |
-
</div>
|
87 |
-
|
88 |
-
<div class="yikes-woo-all-about-us-separator"></div>
|
89 |
-
|
90 |
-
<div class="yikes-woo-tweet-us yikes-woo-all-about-us-box" id="yikes-woo-tweet-us">
|
91 |
-
|
92 |
-
<p><?php _e( 'Tweet about us!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></p>
|
93 |
-
<a class="twitter-share-button"
|
94 |
-
href="https://twitter.com/intent/tweet?text=I use Custom Product Tabs for WooCommerce by @yikesinc to help sell products online. Awesome #WordPress #plugins &url=https://wordpress.org/plugins/yikes-inc-easy-custom-woocommerce-product-tabs/"
|
95 |
-
data-size="large">
|
96 |
-
<?php _e( 'Tweet', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></a>
|
97 |
-
</div>
|
98 |
-
|
99 |
-
<p class="yikes-woo-review-us-footer">This plugin made with <span class="dashicons dashicons-heart yikes-love"></span> by <a href="http://www.yikesinc.com" target="_blank" title="YIKES Inc.">YIKES Inc.</a></p>
|
100 |
-
</div><!-- .yikes-woo-review-us-body -->
|
101 |
-
</div>
|
102 |
-
|
103 |
-
<div class="postbox yikes-woo-buy-us yikes-woo-all-about-us-box" id="yikes-woo-buy-us">
|
104 |
-
<h3 class="yikes-woo-buy-us-title">Custom Product Tabs Pro</h3>
|
105 |
-
<div class="yikes-woo-buy-us-body">
|
106 |
-
<h4><?php _e( 'Check out Custom Product Tabs Pro!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?> </h4>
|
107 |
-
<p><?php _e( 'Create global tabs, add tabs to products based on categories or tags, add tab content to search results, and more!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></p>
|
108 |
-
<a class="button button-primary" href="https://yikesplugins.com/plugin/custom-product-tabs-pro/" target="_blank">
|
109 |
-
<?php _e( 'Custom Product Tabs Pro', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
110 |
-
</a>
|
111 |
-
</div><!-- .yikes-woo-buy-us-body -->
|
112 |
-
</div>
|
113 |
-
|
114 |
-
<?php do_action( 'yikes-woo-settings-area' ); ?>
|
115 |
</div>
|
116 |
-
|
117 |
-
|
118 |
-
|
|
|
119 |
}
|
|
|
|
|
120 |
|
121 |
-
|
1 |
<?php
|
2 |
|
3 |
+
class YIKES_Custom_Product_Tabs_Premium {
|
4 |
|
5 |
+
/**
|
6 |
+
* Constructah >:^)
|
7 |
+
*/
|
8 |
+
public function __construct() {
|
9 |
|
10 |
+
// Add our custom settings page
|
11 |
+
add_action( 'admin_menu', array( $this, 'register_premium_subpage' ), 30 );
|
12 |
|
13 |
+
// Enqueue scripts & styles
|
14 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 10, 1 );
|
15 |
|
16 |
+
// Display an ad for CPTPRO
|
17 |
+
add_action( 'yikes-woo-saved-tabs-list-ad', array( $this, 'display_cptpro_ad' ), 10 );
|
18 |
+
}
|
19 |
|
20 |
+
/**
|
21 |
+
* Enqueue our scripts and styes
|
22 |
+
*
|
23 |
+
* @param string | $page | The slug of the page we're currently on
|
24 |
+
*/
|
25 |
+
public function enqueue_scripts( $page ) {
|
26 |
+
if ( $page === 'custom-product-tabs_page_' . YIKES_Custom_Product_Tabs_Premium_Page ) {
|
27 |
+
$suffix = SCRIPT_DEBUG ? '' : '.min';
|
28 |
+
|
29 |
+
wp_enqueue_style ( 'lightslider-styles', YIKES_Custom_Product_Tabs_URI . "slider/css/lightslider{$suffix}.css" );
|
30 |
+
wp_enqueue_style ( 'repeatable-custom-tabs-styles', YIKES_Custom_Product_Tabs_URI . "css/repeatable-custom-tabs{$suffix}.css" );
|
31 |
+
wp_enqueue_script( 'lightslider-scripts', YIKES_Custom_Product_Tabs_URI . "slider/js/lightslider{$suffix}.js", array( 'jquery' ), YIKES_Custom_Product_Tabs_Version );
|
32 |
+
wp_enqueue_script( 'premium-scripts', YIKES_Custom_Product_Tabs_URI . "js/premium{$suffix}.js", array( 'lightslider-scripts' ), YIKES_Custom_Product_Tabs_Version );
|
33 |
+
wp_enqueue_style ( 'repeatable-custom-tabs-styles' , YIKES_Custom_Product_Tabs_URI . "css/repeatable-custom-tabs{$suffix}.css", array(), YIKES_Custom_Product_Tabs_Version, 'all' );
|
34 |
}
|
35 |
+
}
|
36 |
|
37 |
+
/**
|
38 |
+
* Register our premium page
|
39 |
+
*/
|
40 |
+
public function register_premium_subpage() {
|
41 |
+
|
42 |
+
if ( defined( 'YIKES_Custom_Product_Tabs_Pro_Enabled' ) ) {
|
43 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
|
46 |
+
// Add our custom settings page
|
47 |
+
add_submenu_page(
|
48 |
+
YIKES_Custom_Product_Tabs_Settings_Page, // Parent menu item slug
|
49 |
+
__( 'Go Pro', 'yikes-inc-easy-custom-woocommerce-product-tabs' ), // Tab title name (HTML title)
|
50 |
+
__( 'Go Pro', 'yikes-inc-easy-custom-woocommerce-product-tabs' ), // Menu page name
|
51 |
+
apply_filters( 'yikes-woo-premium-capability', 'publish_products' ), // Capability required
|
52 |
+
YIKES_Custom_Product_Tabs_Premium_Page, // Page slug (?page=slug-name)
|
53 |
+
array( $this, 'premium_page' ) // Function to generate page
|
54 |
+
);
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Include our settings page
|
59 |
+
*/
|
60 |
+
public function premium_page() {
|
61 |
|
62 |
+
require_once YIKES_Custom_Product_Tabs_Path . 'admin/page.premium.php';
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Display an ad for CPTPRO on the saved tabs list and saved tabs single pages
|
67 |
+
*/
|
68 |
+
public function display_cptpro_ad() {
|
69 |
+
|
70 |
+
if ( defined( 'YIKES_Custom_Product_Tabs_Pro_Enabled' ) ) {
|
71 |
+
return;
|
72 |
}
|
73 |
+
?>
|
74 |
+
<div class="yikes-woo-all-about-us">
|
75 |
+
<div class="postbox yikes-woo-review-us">
|
76 |
+
|
77 |
+
<h3 class="yikes-woo-review-us-title"><?php esc_html_e( 'Show Us Some Love', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></h3>
|
78 |
+
<div class="yikes-woo-review-us-body">
|
79 |
+
<div class="yikes-woo-review-us yikes-woo-all-about-us-box" id="yikes-woo-review-us">
|
80 |
+
|
81 |
+
<p><?php _e( 'Leave a review!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?> </p>
|
82 |
+
<p class="star-container">
|
83 |
+
<a href="https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs/reviews/?rate=5#new-post" target="_blank">
|
84 |
+
<span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span>
|
85 |
+
</a>
|
86 |
+
</p>
|
87 |
+
</div>
|
88 |
+
|
89 |
+
<div class="yikes-woo-all-about-us-separator"></div>
|
90 |
+
|
91 |
+
<div class="yikes-woo-tweet-us yikes-woo-all-about-us-box" id="yikes-woo-tweet-us">
|
92 |
+
|
93 |
+
<p><?php _e( 'Tweet about us!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></p>
|
94 |
+
<a class="twitter-share-button"
|
95 |
+
href="https://twitter.com/intent/tweet?text=I use Custom Product Tabs for WooCommerce by @yikesinc to help sell products online. Awesome #WordPress #plugins &url=https://wordpress.org/plugins/yikes-inc-easy-custom-woocommerce-product-tabs/"
|
96 |
+
data-size="large">
|
97 |
+
<?php _e( 'Tweet', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></a>
|
98 |
+
</div>
|
99 |
+
|
100 |
+
<p class="yikes-woo-review-us-footer">
|
101 |
+
<?php
|
102 |
+
printf(
|
103 |
+
wp_kses_post(
|
104 |
+
/* translators: %1$s is html markup for a heart icon. %2$s is an anchor tag (link) to https://yikesinc.com. */
|
105 |
+
__( 'This plugin made with %1$s by %2$s', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
106 |
+
),
|
107 |
+
'<span class="dashicons dashicons-heart yikes-love"></span>',
|
108 |
+
'<a href="https://www.yikesinc.com" target="_blank" title="YIKES Inc.">YIKES Inc.</a>'
|
109 |
+
);
|
110 |
+
?>
|
111 |
+
</p>
|
112 |
+
</div><!-- .yikes-woo-review-us-body -->
|
113 |
+
</div>
|
114 |
|
115 |
+
<div class="postbox yikes-woo-buy-us yikes-woo-all-about-us-box" id="yikes-woo-buy-us">
|
116 |
+
<h3 class="yikes-woo-buy-us-title"><?php esc_html_e( 'Custom Product Tabs Pro', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></h3>
|
117 |
+
<div class="yikes-woo-buy-us-body">
|
118 |
+
<h4><?php _e( 'Check out Custom Product Tabs Pro!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></h4>
|
119 |
+
<p><?php _e( 'Create global tabs, add tabs to products based on categories or tags, add tab content to search results, and more!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></p>
|
120 |
+
<a class="button button-primary" href="https://yikesplugins.com/plugin/custom-product-tabs-pro/" target="_blank">
|
121 |
+
<?php _e( 'Custom Product Tabs Pro', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
122 |
+
</a>
|
123 |
+
</div><!-- .yikes-woo-buy-us-body -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
</div>
|
125 |
+
|
126 |
+
<?php do_action( 'yikes-woo-settings-area' ); ?>
|
127 |
+
</div>
|
128 |
+
<?php
|
129 |
}
|
130 |
+
|
131 |
+
}
|
132 |
|
133 |
+
new YIKES_Custom_Product_Tabs_Premium();
|
admin/class.settings.php
CHANGED
@@ -8,164 +8,165 @@
|
|
8 |
|
9 |
class YIKES_Custom_Product_Tabs_Settings {
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
|
117 |
/**
|
118 |
-
|
119 |
-
|
120 |
* @return bool
|
121 |
*/
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
|
|
169 |
}
|
170 |
|
171 |
new YIKES_Custom_Product_Tabs_Settings();
|
8 |
|
9 |
class YIKES_Custom_Product_Tabs_Settings {
|
10 |
|
11 |
+
/**
|
12 |
+
* Constructor
|
13 |
+
*/
|
14 |
+
public function __construct() {
|
15 |
+
|
16 |
+
// Enqueue scripts & styles.
|
17 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 10, 1 );
|
18 |
+
|
19 |
+
// Render settings area.
|
20 |
+
add_action( 'yikes-woo-settings-area', array( $this, 'render_settings_area' ), 10 );
|
21 |
+
|
22 |
+
// REST API.
|
23 |
+
add_action( 'rest_api_init', array( $this, 'register_rest_route' ) );
|
24 |
+
|
25 |
+
// Admin Notice.
|
26 |
+
add_action( 'yikes-woo-display-too-many-products-warning', array( $this, 'generate_messages' ) );
|
27 |
+
|
28 |
+
if ( $this->maybe_use_the_content_filter() ) {
|
29 |
+
add_filter( 'yikes_woo_use_the_content_filter', '__return_false' );
|
30 |
+
add_filter( 'yikes_woo_filter_main_tab_content', array( $this, 'yikes_the_content_filter' ), 10, 1 );
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Replacement function for the_content
|
36 |
+
*
|
37 |
+
* @param string $content post content.
|
38 |
+
*/
|
39 |
+
public function yikes_the_content_filter( $content ) {
|
40 |
+
$content = function_exists( 'capital_P_dangit' ) ? capital_P_dangit( $content ) : $content;
|
41 |
+
$content = function_exists( 'wptexturize' ) ? wptexturize( $content ) : $content;
|
42 |
+
$content = function_exists( 'convert_smilies' ) ? convert_smilies( $content ) : $content;
|
43 |
+
$content = function_exists( 'wpautop' ) ? wpautop( $content ) : $content;
|
44 |
+
$content = function_exists( 'shortcode_unautop' ) ? shortcode_unautop( $content ) : $content;
|
45 |
+
$content = function_exists( 'prepend_attachment' ) ? prepend_attachment( $content ) : $content;
|
46 |
+
$content = function_exists( 'wp_filter_content_tags' ) ? wp_filter_content_tags( $content ) : $content;
|
47 |
+
$content = function_exists( 'do_shortcode' ) ? do_shortcode( $content ) : $content;
|
48 |
+
|
49 |
+
if ( class_exists( 'WP_Embed' ) ) {
|
50 |
+
// Deal with URLs
|
51 |
+
$embed = new WP_Embed;
|
52 |
+
$content = method_exists( $embed, 'autoembed' ) ? $embed->autoembed( $content ) : $content;
|
53 |
+
}
|
54 |
+
|
55 |
+
return $content;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Enqueue assets
|
60 |
+
*/
|
61 |
+
public function enqueue_scripts() {
|
62 |
+
if ( defined( 'YIKES_Custom_Product_Tabs_Pro_Enabled' ) ) {
|
63 |
+
return;
|
64 |
+
}
|
65 |
+
|
66 |
+
$suffix = SCRIPT_DEBUG ? '' : '.min';
|
67 |
+
|
68 |
+
wp_register_script( 'yikes-cpt-settings-modal', YIKES_Custom_Product_Tabs_URI . "js/settings{$suffix}.js", array( 'jquery' ), '1.0.0', true );
|
69 |
+
|
70 |
+
wp_localize_script(
|
71 |
+
'yikes-cpt-settings-modal',
|
72 |
+
'yikesCptSettings',
|
73 |
+
array(
|
74 |
+
'root' => esc_url_raw( rest_url() ),
|
75 |
+
'nonce' => wp_create_nonce( 'wp_rest' ),
|
76 |
+
)
|
77 |
+
);
|
78 |
+
|
79 |
+
wp_enqueue_script( 'yikes-cpt-settings-modal' );
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Register Rest API Route.
|
84 |
+
*/
|
85 |
+
public function register_rest_route() {
|
86 |
+
register_rest_route(
|
87 |
+
'yikes/cpt/v1',
|
88 |
+
'/settings',
|
89 |
+
array(
|
90 |
+
'methods' => 'POST',
|
91 |
+
'callback' => array( $this, 'rest_response' ),
|
92 |
+
'permission_callback' => array( $this, 'permission_callback' )
|
93 |
+
)
|
94 |
+
);
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* REST API Response
|
99 |
+
*
|
100 |
+
* @param WP_REST_Request $request current WP Rest Request.
|
101 |
+
*/
|
102 |
+
public function rest_response( WP_REST_Request $request ) {
|
103 |
+
$response = new WP_REST_Response();
|
104 |
+
|
105 |
+
$toggle_the_content = isset( $request['toggle_the_content'] ) ? sanitize_text_field( $request['toggle_the_content'] ) : 'false';
|
106 |
+
|
107 |
+
update_option( 'yikes_cpt_use_the_content', $toggle_the_content );
|
108 |
+
|
109 |
+
$response->set_data( array(
|
110 |
+
'status' => 'success',
|
111 |
+
'message' => 'Settings updated.'
|
112 |
+
) );
|
113 |
+
|
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 |
+
*/
|
129 |
+
public function generate_messages() {
|
130 |
+
?>
|
131 |
+
<div style="display: none;" id="settings-updated" class="updated notice is-dismissible"><p>Settings updated.</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>
|
132 |
+
<?php
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Render settings area
|
137 |
+
*/
|
138 |
+
public function render_settings_area() {
|
139 |
+
if ( defined( 'YIKES_Custom_Product_Tabs_Pro_Enabled' ) ) {
|
140 |
+
return;
|
141 |
+
}
|
142 |
+
|
143 |
+
$toggle_the_content = get_option( 'yikes_cpt_use_the_content' );
|
144 |
+
?>
|
145 |
+
<div class="postbox yikes-woo-buy-us yikes-woo-all-about-us-box" id="yikes-woo-buy-us">
|
146 |
+
<h3 class="yikes-woo-settings-title"><?php esc_html_e( 'Settings', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></h3>
|
147 |
+
<div class="yikes-woo-buy-us-body">
|
148 |
+
<h4><?php _e( 'Use a custom filter for the_content', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?> </h4>
|
149 |
+
<p><?php _e( "If you're using a page builder and you're having issues toggle this setting on. This will allow other plugins to use the WordPress 'the_content' filter will we use our own custom version.", 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></p>
|
150 |
+
<p>
|
151 |
+
<label>
|
152 |
+
<?php esc_html_e( 'Toggle the_content filter.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
153 |
+
<input id="yikes-woo-toggle-content-input" type="checkbox" name="yikes-the-content-toggle" id="yikes-the-content-toggle" <?php checked( 'true' === $toggle_the_content ); ?> />
|
154 |
+
</label>
|
155 |
+
<p>
|
156 |
+
<a id="yikes-woo-toggle-content" class="button button-primary" href="https://yikesplugins.com/plugin/custom-product-tabs-pro/" target="_blank">
|
157 |
+
<?php _e( 'Save Settings', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
158 |
+
</a>
|
159 |
+
</div><!-- .yikes-woo-buy-us-body -->
|
160 |
+
</div>
|
161 |
+
<?php
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Check if we should use the filter
|
166 |
+
*/
|
167 |
+
public function maybe_use_the_content_filter() {
|
168 |
+
return 'true' === get_option( 'yikes_cpt_use_the_content' );
|
169 |
+
}
|
170 |
}
|
171 |
|
172 |
new YIKES_Custom_Product_Tabs_Settings();
|
admin/class.support.php
CHANGED
@@ -26,7 +26,10 @@
|
|
26 |
|
27 |
if ( $page === 'custom-product-tabs_page_' . YIKES_Custom_Product_Tabs_Support_Page ) {
|
28 |
|
29 |
-
|
|
|
|
|
|
|
30 |
}
|
31 |
}
|
32 |
|
@@ -64,30 +67,38 @@
|
|
64 |
?>
|
65 |
<div class="cptpro-settings cptpro-settings-support-help-container">
|
66 |
<p>
|
67 |
-
<?php
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
70 |
?>
|
71 |
</p>
|
72 |
|
73 |
<p>
|
74 |
-
<?php
|
75 |
-
|
76 |
-
|
|
|
|
|
|
|
77 |
?>
|
78 |
</p>
|
79 |
|
80 |
-
<hr />
|
81 |
-
|
82 |
|
83 |
<h1>
|
84 |
<span class="dashicons dashicons-wordpress-alt"></span> <?php _e( 'WordPress.org Support Forums', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
85 |
</h1>
|
86 |
|
87 |
<p>
|
88 |
-
<?php
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
91 |
?>
|
92 |
</p>
|
93 |
|
@@ -98,7 +109,7 @@
|
|
98 |
</p>
|
99 |
|
100 |
<a href="https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs#new-post" target="_blank">
|
101 |
-
<img src="<?php echo YIKES_Custom_Product_Tabs_URI . 'images/support-screenshot.png' ?>" />
|
102 |
</a>
|
103 |
|
104 |
</div>
|
26 |
|
27 |
if ( $page === 'custom-product-tabs_page_' . YIKES_Custom_Product_Tabs_Support_Page ) {
|
28 |
|
29 |
+
$suffix = SCRIPT_DEBUG ? '' : '.min';
|
30 |
+
|
31 |
+
wp_enqueue_style( 'repeatable-custom-tabs-styles' , YIKES_Custom_Product_Tabs_URI . "css/repeatable-custom-tabs{$suffix}.css", array(), YIKES_Custom_Product_Tabs_Version, 'all' );
|
32 |
+
|
33 |
}
|
34 |
}
|
35 |
|
67 |
?>
|
68 |
<div class="cptpro-settings cptpro-settings-support-help-container">
|
69 |
<p>
|
70 |
+
<?php
|
71 |
+
printf(
|
72 |
+
/* translators: %s is a link to the knowledge base. */
|
73 |
+
esc_html__( 'Before submitting a support request, please visit our %s where we have step-by-step guides and troubleshooting help.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
74 |
+
'<a href="https://yikesplugins.com/support/knowledge-base/product/easy-custom-product-tabs-for-woocommerce/" target="_blank">' . esc_html__( 'Knowledge Base', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</a>'
|
75 |
+
);
|
76 |
?>
|
77 |
</p>
|
78 |
|
79 |
<p>
|
80 |
+
<?php
|
81 |
+
printf(
|
82 |
+
/* translators: %s is a link to the https://yikesplugins.com/plugin/custom-product-tabs-pro/. */
|
83 |
+
esc_html__( 'Custom Product Tabs Pro users qualify for premium support. Check out %s!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
84 |
+
'<a href="https://yikesplugins.com/plugin/custom-product-tabs-pro/" target="_blank">' . esc_html__( 'Custom Product Tabs Pro', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</a>'
|
85 |
+
);
|
86 |
?>
|
87 |
</p>
|
88 |
|
89 |
+
<hr />
|
|
|
90 |
|
91 |
<h1>
|
92 |
<span class="dashicons dashicons-wordpress-alt"></span> <?php _e( 'WordPress.org Support Forums', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
93 |
</h1>
|
94 |
|
95 |
<p>
|
96 |
+
<?php
|
97 |
+
printf(
|
98 |
+
/* translators: %s is a link to the the WordPress.org support forums. */
|
99 |
+
esc_html__( 'If you need help with free Custom Product Tabs, please post questions to %ss. We aim to respond to support requests within a week.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
100 |
+
'<a href="https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs#new-post" target="_blank">' . esc_html__( 'our support forum on the WordPress Plugin Directory', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</a>'
|
101 |
+
);
|
102 |
?>
|
103 |
</p>
|
104 |
|
109 |
</p>
|
110 |
|
111 |
<a href="https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs#new-post" target="_blank">
|
112 |
+
<img src="<?php echo esc_url( YIKES_Custom_Product_Tabs_URI . 'images/support-screenshot.png' ); ?>" />
|
113 |
</a>
|
114 |
|
115 |
</div>
|
admin/class.yikes-woo-generate-html.php
CHANGED
@@ -66,16 +66,12 @@ if ( ! class_exists( 'Yikes_Woo_Custom_Product_Tabs_HTML' ) ) {
|
|
66 |
|
67 |
// duplicate_this_row content
|
68 |
echo '<div id="duplicate_this_row">';
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
// Override Saved Tab checkbox & hidden input fields - Up & Down arrows && Remove Tab button (Duplicate)
|
77 |
-
echo $this->display_yikes_button_holder_container_duplicate();
|
78 |
-
|
79 |
echo '</div>';
|
80 |
}
|
81 |
|
@@ -161,9 +157,9 @@ if ( ! class_exists( 'Yikes_Woo_Custom_Product_Tabs_HTML' ) ) {
|
|
161 |
$return_html .= ' style="display: none;">';
|
162 |
}
|
163 |
$return_html .= '<input type="checkbox" class="_yikes_wc_override_reusable_tab" id="_yikes_wc_override_reusable_tab_' . $i . '" data-tab-number="'. $i .'"';
|
164 |
-
$return_html .= 'title="' .
|
165 |
$return_html .= '<label id="_yikes_wc_override_reusable_tab_label_' . $i . '" for="_yikes_wc_override_reusable_tab_' . $i . '" class="_yikes_wc_override_reusable_tab_label">';
|
166 |
-
$return_html .=
|
167 |
$return_html .= '</label>';
|
168 |
$return_html .= '<input type="hidden" name="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '_action" class="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_action"';
|
169 |
$return_html .= 'id="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '_action" value="none">';
|
@@ -171,14 +167,20 @@ if ( ! class_exists( 'Yikes_Woo_Custom_Product_Tabs_HTML' ) ) {
|
|
171 |
$return_html .= 'id="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '" value="' . $reusable_tab_id . '">';
|
172 |
$return_html .= '</p>';
|
173 |
|
174 |
-
$return_html .= '<
|
175 |
-
|
176 |
-
$return_html .=
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
$return_html .= '</section>';
|
183 |
|
184 |
return $return_html;
|
@@ -230,7 +232,6 @@ if ( ! class_exists( 'Yikes_Woo_Custom_Product_Tabs_HTML' ) ) {
|
|
230 |
'label' => __( 'Content', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
231 |
'placeholder' => __( 'HTML and text to display.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
232 |
'value' => $tab['content'],
|
233 |
-
'style' => 'width:100%;min-height:10rem;',
|
234 |
'class' => 'yikes_woo_tabs_content_field',
|
235 |
'number' => $i
|
236 |
) );
|
@@ -265,8 +266,7 @@ if ( ! class_exists( 'Yikes_Woo_Custom_Product_Tabs_HTML' ) ) {
|
|
265 |
* @param array $tab Array of tab data
|
266 |
*/
|
267 |
protected function display_woocommerce_wp_wysiwyg_input_duplicate() {
|
268 |
-
|
269 |
-
$this->woocommerce_wp_textarea_input( array( 'id' => 'hidden_duplicator_row_content' , 'label' => __( 'Content', 'yikes-inc-easy-custom-woocommerce-product-tabs' ), 'placeholder' => __( 'HTML and text to display.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ), 'style' => 'width:100%; min-height:10rem;' , 'class' => 'yikes_woo_tabs_content_field' ) );
|
270 |
}
|
271 |
|
272 |
/**
|
@@ -277,27 +277,32 @@ if ( ! class_exists( 'Yikes_Woo_Custom_Product_Tabs_HTML' ) ) {
|
|
277 |
* @return string HTML
|
278 |
*/
|
279 |
protected function display_yikes_button_holder_container_duplicate() {
|
280 |
-
$return_html = '';
|
281 |
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
}
|
302 |
|
303 |
/**
|
@@ -358,13 +363,7 @@ if ( ! class_exists( 'Yikes_Woo_Custom_Product_Tabs_HTML' ) ) {
|
|
358 |
if ( ! isset( $field['class'] ) ) $field['class'] = '';
|
359 |
if ( ! isset( $field['value'] ) ) $field['value'] = '';
|
360 |
|
361 |
-
echo '<
|
362 |
-
|
363 |
-
if ( isset( $field['description'] ) && $field['description'] ) {
|
364 |
-
echo '<span class="description">' . $field['description'] . '</span>';
|
365 |
-
}
|
366 |
-
|
367 |
-
echo '</p>';
|
368 |
}
|
369 |
|
370 |
/**
|
@@ -392,5 +391,3 @@ if ( ! class_exists( 'Yikes_Woo_Custom_Product_Tabs_HTML' ) ) {
|
|
392 |
/* END HTML Functions */
|
393 |
}
|
394 |
}
|
395 |
-
|
396 |
-
?>
|
66 |
|
67 |
// duplicate_this_row content
|
68 |
echo '<div id="duplicate_this_row">';
|
69 |
+
// Tab title input field
|
70 |
+
woocommerce_wp_text_input( array( 'id' => 'hidden_duplicator_row_title' , 'label' => __( 'Tab Title', 'yikes-inc-easy-custom-woocommerce-product-tabs' ), 'description' => '', 'placeholder' => __( 'Custom Tab Title' , 'yikes-inc-easy-custom-woocommerce-product-tabs' ), 'class' => 'yikes_woo_tabs_title_field yikes_woo_tabs_title_field_duplicate' ) );
|
71 |
+
// WYSIWYG Content field
|
72 |
+
$this->display_woocommerce_wp_wysiwyg_input_duplicate();
|
73 |
+
// Override Saved Tab checkbox & hidden input fields - Up & Down arrows && Remove Tab button (Duplicate)
|
74 |
+
echo $this->display_yikes_button_holder_container_duplicate();
|
|
|
|
|
|
|
|
|
75 |
echo '</div>';
|
76 |
}
|
77 |
|
157 |
$return_html .= ' style="display: none;">';
|
158 |
}
|
159 |
$return_html .= '<input type="checkbox" class="_yikes_wc_override_reusable_tab" id="_yikes_wc_override_reusable_tab_' . $i . '" data-tab-number="'. $i .'"';
|
160 |
+
$return_html .= 'title="' . esc_attr__( 'Check this box to override the saved tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '">';
|
161 |
$return_html .= '<label id="_yikes_wc_override_reusable_tab_label_' . $i . '" for="_yikes_wc_override_reusable_tab_' . $i . '" class="_yikes_wc_override_reusable_tab_label">';
|
162 |
+
$return_html .= esc_html__( ' Override Saved Tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' );
|
163 |
$return_html .= '</label>';
|
164 |
$return_html .= '<input type="hidden" name="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '_action" class="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_action"';
|
165 |
$return_html .= 'id="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '_action" value="none">';
|
167 |
$return_html .= 'id="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' . $i . '" value="' . $reusable_tab_id . '">';
|
168 |
$return_html .= '</p>';
|
169 |
|
170 |
+
$return_html .= '<a href="#" onclick="return false;" class="button-secondary remove_this_tab"><span class="dashicons dashicons-no-alt"></span>' . esc_html__( 'Remove Tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</a>';
|
171 |
+
|
172 |
+
$return_html .= '<div class="handle-actions hide-if-no-js">
|
173 |
+
<p class="yikes_wc_move_tab">' . esc_html__( 'Move tab order', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</p>
|
174 |
+
<button type="button" class="move-tab-data-up" aria-disabled="false" aria-describedby="custom-product-tabs-pro-handle-order-higher-description">
|
175 |
+
<span class="screen-reader-text">' . esc_html__( 'Move up', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</span>
|
176 |
+
</button>
|
177 |
+
<span class="hidden" id="custom-product-tabs-pro-handle-order-higher-description">' . esc_html__( 'Move tab up', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</span>
|
178 |
+
<button type="button" class="move-tab-data-down" aria-disabled="false" aria-describedby="custom-product-tabs-pro-handle-order-lower-description">
|
179 |
+
<span class="screen-reader-text">' . esc_html__( 'Move down', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</span>
|
180 |
+
</button>
|
181 |
+
<span class="hidden" id="custom-product-tabs-pro-handle-order-lower-description">' . esc_html__( 'Move tab down', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</span>
|
182 |
+
</div>';
|
183 |
+
|
184 |
$return_html .= '</section>';
|
185 |
|
186 |
return $return_html;
|
232 |
'label' => __( 'Content', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
233 |
'placeholder' => __( 'HTML and text to display.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
234 |
'value' => $tab['content'],
|
|
|
235 |
'class' => 'yikes_woo_tabs_content_field',
|
236 |
'number' => $i
|
237 |
) );
|
266 |
* @param array $tab Array of tab data
|
267 |
*/
|
268 |
protected function display_woocommerce_wp_wysiwyg_input_duplicate() {
|
269 |
+
$this->woocommerce_wp_textarea_input( array( 'id' => 'hidden_duplicator_row_content' , 'label' => __( 'Content', 'yikes-inc-easy-custom-woocommerce-product-tabs' ), 'placeholder' => __( 'HTML and text to display.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ), 'style' => 'width: 100%;', 'class' => 'yikes_woo_tabs_content_field' ) );
|
|
|
270 |
}
|
271 |
|
272 |
/**
|
277 |
* @return string HTML
|
278 |
*/
|
279 |
protected function display_yikes_button_holder_container_duplicate() {
|
|
|
280 |
|
281 |
+
ob_start();
|
282 |
+
|
283 |
+
?>
|
284 |
+
|
285 |
+
<div class="hidden_duplicator_row_button_holder">
|
286 |
+
<section class="button-holder">
|
287 |
+
<p class="yikes_wc_override_reusable_tab_container" style="display: none;"></p>
|
288 |
+
<a href="#" onclick="return false;" class="button-secondary remove_this_tab"><span class="dashicons dashicons-no-alt"></span><?php esc_html_e( 'Remove Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></a>
|
289 |
+
<div class="handle-actions hide-if-no-js">
|
290 |
+
<p class="yikes_wc_move_tab"><?php esc_html_e( 'Move tab order', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></p>
|
291 |
+
<button type="button" class="move-tab-data-up" aria-disabled="false" aria-describedby="custom-product-tabs-pro-handle-order-higher-description">
|
292 |
+
<span class="screen-reader-text"><?php esc_html_e( 'Move up', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></span>
|
293 |
+
</button>
|
294 |
+
<span class="hidden" id="custom-product-tabs-pro-handle-order-higher-description"><?php esc_html_e( 'Move tab up', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></span>
|
295 |
+
<button type="button" class="move-tab-data-down" aria-disabled="false" aria-describedby="custom-product-tabs-pro-handle-order-lower-description">
|
296 |
+
<span class="screen-reader-text"><?php esc_html_e( 'Move down', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></span>
|
297 |
+
</button>
|
298 |
+
<span class="hidden" id="custom-product-tabs-pro-handle-order-lower-description"><?php esc_html_e( 'Move tab down', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></span>
|
299 |
+
</div>
|
300 |
+
</section>
|
301 |
+
</div>
|
302 |
+
|
303 |
+
<?php
|
304 |
+
|
305 |
+
return ob_get_clean();
|
306 |
}
|
307 |
|
308 |
/**
|
363 |
if ( ! isset( $field['class'] ) ) $field['class'] = '';
|
364 |
if ( ! isset( $field['value'] ) ) $field['value'] = '';
|
365 |
|
366 |
+
echo '<div class="form-field-tinymce _yikes_wc_custom_repeatable_product_tabs_tab_content_field ' . $field['id'] . '_field"><textarea class="' . $field['class'] . '" name="' . $field['id'] . '" id="' . $field['id'] . '" placeholder="' . $field['placeholder'] . '" style="width: 100%;">' . $field['value'] . '</textarea></div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
367 |
}
|
368 |
|
369 |
/**
|
391 |
/* END HTML Functions */
|
392 |
}
|
393 |
}
|
|
|
|
admin/class.yikes-woo-saved-tabs.php
CHANGED
@@ -44,18 +44,22 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Saved_Tabs' ) ) {
|
|
44 |
|
45 |
if ( $hook === 'toplevel_page_' . YIKES_Custom_Product_Tabs_Settings_Page ) {
|
46 |
|
|
|
|
|
47 |
// JavaScript
|
48 |
-
wp_enqueue_script ( 'repeatable-custom-tabs-settings', YIKES_Custom_Product_Tabs_URI .
|
49 |
wp_localize_script( 'repeatable-custom-tabs-settings', 'repeatable_custom_tabs_settings', array(
|
50 |
-
'loading_gif'
|
51 |
-
'ajaxurl'
|
52 |
-
'tab_list_page_url'
|
53 |
-
'save_tab_as_reusable_nonce'
|
54 |
-
'delete_reusable_tab_nonce'
|
55 |
-
'is_cptpro_enabled'
|
|
|
|
|
56 |
) );
|
57 |
|
58 |
-
wp_enqueue_script ( 'repeatable-custom-tabs-shared', YIKES_Custom_Product_Tabs_URI .
|
59 |
wp_localize_script( 'repeatable-custom-tabs-shared', 'repeatable_custom_tabs_shared', array(
|
60 |
'loading_gif' => '<img src="' . admin_url( 'images/loading.gif' ) . '" alt="preloader" class="loading-wp-editor-gif" />',
|
61 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
@@ -64,10 +68,11 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Saved_Tabs' ) ) {
|
|
64 |
) );
|
65 |
|
66 |
// Twitter script for our Tweet Us button
|
67 |
-
wp_enqueue_script( 'twitter-button', YIKES_Custom_Product_Tabs_URI .
|
68 |
|
69 |
// CSS
|
70 |
-
wp_enqueue_style( 'repeatable-custom-tabs-styles' , YIKES_Custom_Product_Tabs_URI .
|
|
|
71 |
}
|
72 |
|
73 |
}
|
@@ -176,7 +181,7 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Saved_Tabs' ) ) {
|
|
176 |
update_option( 'yikes_woo_reusable_products_tabs', $yikes_custom_tab_data );
|
177 |
|
178 |
// Return redirect URL
|
179 |
-
$return_redirect_url = esc_url_raw( add_query_arg( array( 'page' => YIKES_Custom_Product_Tabs_Settings_Page, 'saved-tab-id' => $new_tab_id ), admin_url() ) );
|
180 |
|
181 |
// Send response
|
182 |
wp_send_json_success( array( 'tab_id' => $new_tab_id, 'redirect' => true, 'redirect_url' => $return_redirect_url ) );
|
@@ -265,7 +270,7 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Saved_Tabs' ) ) {
|
|
265 |
|
266 |
// Verify the nonce
|
267 |
if ( ! check_ajax_referer( 'yikes_woo_fetch_reusable_tab_nonce', 'security_nonce', false ) ) {
|
268 |
-
|
269 |
}
|
270 |
|
271 |
$tab_id = isset( $_POST['tab_id'] ) ? filter_var( $_POST['tab_id'], FILTER_SANITIZE_NUMBER_INT ) : '';
|
@@ -299,7 +304,7 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Saved_Tabs' ) ) {
|
|
299 |
|
300 |
// Verify the nonce
|
301 |
if ( ! check_ajax_referer( 'yikes_woo_fetch_reusable_tabs_nonce', 'security_nonce', false ) ) {
|
302 |
-
|
303 |
}
|
304 |
|
305 |
// Get the array of saved tabs
|
@@ -336,7 +341,7 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Saved_Tabs' ) ) {
|
|
336 |
|
337 |
// Verify the nonce
|
338 |
if ( ! check_ajax_referer( 'yikes_woo_delete_reusable_tab_nonce', 'security_nonce', false ) ) {
|
339 |
-
|
340 |
}
|
341 |
|
342 |
// Get our tab_id
|
@@ -536,7 +541,7 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Saved_Tabs' ) ) {
|
|
536 |
$tab = isset( $yikes_custom_tab_data[$saved_tab_id] ) ? $yikes_custom_tab_data[$saved_tab_id] : array();
|
537 |
|
538 |
// Redirect URL
|
539 |
-
$redirect = esc_url_raw( add_query_arg( array( 'page' => YIKES_Custom_Product_Tabs_Settings_Page ), admin_url() ) );
|
540 |
|
541 |
require_once( YIKES_Custom_Product_Tabs_Path . 'admin/page.yikes-woo-saved-tabs-single.php' );
|
542 |
|
44 |
|
45 |
if ( $hook === 'toplevel_page_' . YIKES_Custom_Product_Tabs_Settings_Page ) {
|
46 |
|
47 |
+
$suffix = SCRIPT_DEBUG ? '' : '.min';
|
48 |
+
|
49 |
// JavaScript
|
50 |
+
wp_enqueue_script ( 'repeatable-custom-tabs-settings', YIKES_Custom_Product_Tabs_URI . "js/repeatable-custom-tabs-settings{$suffix}.js", array( 'jquery' ), YIKES_Custom_Product_Tabs_Version );
|
51 |
wp_localize_script( 'repeatable-custom-tabs-settings', 'repeatable_custom_tabs_settings', array(
|
52 |
+
'loading_gif' => '<img src="' . admin_url( 'images/loading.gif' ) . '" alt="preloader" class="loading-wp-editor-gif-settings" />',
|
53 |
+
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
54 |
+
'tab_list_page_url' => esc_url_raw( add_query_arg( array( 'page' => YIKES_Custom_Product_Tabs_Settings_Page ), admin_url() ) ),
|
55 |
+
'save_tab_as_reusable_nonce' => wp_create_nonce( 'yikes_woo_save_tab_as_reusable_nonce' ),
|
56 |
+
'delete_reusable_tab_nonce' => wp_create_nonce( 'yikes_woo_delete_reusable_tab_nonce' ),
|
57 |
+
'is_cptpro_enabled' => defined( 'YIKES_Custom_Product_Tabs_Pro_Enabled' ) ? true : false,
|
58 |
+
'confirm_delete_single_tab' => __( 'Are you sure you want to delete this tab?', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
59 |
+
'confirm_delete_bulk_tabs' => __( 'Are you sure you want to delete these tabs? This cannot be undone.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
60 |
) );
|
61 |
|
62 |
+
wp_enqueue_script ( 'repeatable-custom-tabs-shared', YIKES_Custom_Product_Tabs_URI . "js/repeatable-custom-tabs-shared{$suffix}.js", array( 'jquery' ), YIKES_Custom_Product_Tabs_Version );
|
63 |
wp_localize_script( 'repeatable-custom-tabs-shared', 'repeatable_custom_tabs_shared', array(
|
64 |
'loading_gif' => '<img src="' . admin_url( 'images/loading.gif' ) . '" alt="preloader" class="loading-wp-editor-gif" />',
|
65 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
68 |
) );
|
69 |
|
70 |
// Twitter script for our Tweet Us button
|
71 |
+
wp_enqueue_script( 'twitter-button', YIKES_Custom_Product_Tabs_URI . "js/twitter-embed{$suffix}.js", array(), YIKES_Custom_Product_Tabs_Version );
|
72 |
|
73 |
// CSS
|
74 |
+
wp_enqueue_style( 'repeatable-custom-tabs-styles' , YIKES_Custom_Product_Tabs_URI . "css/repeatable-custom-tabs{$suffix}.css", array(), YIKES_Custom_Product_Tabs_Version, 'all' );
|
75 |
+
|
76 |
}
|
77 |
|
78 |
}
|
181 |
update_option( 'yikes_woo_reusable_products_tabs', $yikes_custom_tab_data );
|
182 |
|
183 |
// Return redirect URL
|
184 |
+
$return_redirect_url = esc_url_raw( add_query_arg( array( 'page' => YIKES_Custom_Product_Tabs_Settings_Page, 'saved-tab-id' => $new_tab_id ), admin_url( 'admin.php' ) ) );
|
185 |
|
186 |
// Send response
|
187 |
wp_send_json_success( array( 'tab_id' => $new_tab_id, 'redirect' => true, 'redirect_url' => $return_redirect_url ) );
|
270 |
|
271 |
// Verify the nonce
|
272 |
if ( ! check_ajax_referer( 'yikes_woo_fetch_reusable_tab_nonce', 'security_nonce', false ) ) {
|
273 |
+
wp_send_json_error();
|
274 |
}
|
275 |
|
276 |
$tab_id = isset( $_POST['tab_id'] ) ? filter_var( $_POST['tab_id'], FILTER_SANITIZE_NUMBER_INT ) : '';
|
304 |
|
305 |
// Verify the nonce
|
306 |
if ( ! check_ajax_referer( 'yikes_woo_fetch_reusable_tabs_nonce', 'security_nonce', false ) ) {
|
307 |
+
wp_send_json_error();
|
308 |
}
|
309 |
|
310 |
// Get the array of saved tabs
|
341 |
|
342 |
// Verify the nonce
|
343 |
if ( ! check_ajax_referer( 'yikes_woo_delete_reusable_tab_nonce', 'security_nonce', false ) ) {
|
344 |
+
wp_send_json_error();
|
345 |
}
|
346 |
|
347 |
// Get our tab_id
|
541 |
$tab = isset( $yikes_custom_tab_data[$saved_tab_id] ) ? $yikes_custom_tab_data[$saved_tab_id] : array();
|
542 |
|
543 |
// Redirect URL
|
544 |
+
$redirect = esc_url_raw( add_query_arg( array( 'page' => YIKES_Custom_Product_Tabs_Settings_Page ), admin_url( 'admin.php' ) ) );
|
545 |
|
546 |
require_once( YIKES_Custom_Product_Tabs_Path . 'admin/page.yikes-woo-saved-tabs-single.php' );
|
547 |
|
admin/class.yikes-woo-tabs.php
CHANGED
@@ -47,36 +47,38 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Custom_Tabs' ) ) {
|
|
47 |
wp_enqueue_editor();
|
48 |
}
|
49 |
|
|
|
|
|
50 |
// script
|
51 |
-
wp_enqueue_script ( 'repeatable-custom-tabs', YIKES_Custom_Product_Tabs_URI .
|
52 |
wp_localize_script( 'repeatable-custom-tabs', 'repeatable_custom_tabs', array(
|
53 |
-
'loading_gif'
|
54 |
-
'ajaxurl'
|
55 |
-
'get_wp_editor_security_nonce'
|
56 |
-
'save_tab_as_reusable_nonce'
|
57 |
-
'fetch_reusable_tabs_nonce'
|
58 |
-
'fetch_reusable_tab_nonce'
|
59 |
-
'delete_reusable_tab_nonce'
|
60 |
-
'save_product_tabs_nonce'
|
61 |
-
'global_post_id'
|
62 |
'get_wp_editor_failure_message' => __( 'Sorry! An error has occurred while trying to retrieve the editor. Please refresh the page and try again.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
63 |
-
'wp_version_four_eight'
|
64 |
) );
|
65 |
|
66 |
-
wp_enqueue_script ( 'repeatable-custom-tabs-shared', YIKES_Custom_Product_Tabs_URI .
|
67 |
wp_localize_script( 'repeatable-custom-tabs-shared', 'repeatable_custom_tabs_shared', array(
|
68 |
-
'loading_gif'
|
69 |
-
'ajaxurl'
|
70 |
-
'get_wp_editor_security_nonce'
|
71 |
'get_wp_editor_failure_message' => __( 'Sorry! An error has occurred while trying to retrieve the editor. Please refresh the page and try again.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
72 |
) );
|
73 |
|
74 |
// styles
|
75 |
-
wp_enqueue_style( 'repeatable-custom-tabs-styles' , YIKES_Custom_Product_Tabs_URI .
|
76 |
|
77 |
// JS lity modal library and CSS
|
78 |
-
wp_enqueue_script( 'lity-js', YIKES_Custom_Product_Tabs_URI .
|
79 |
-
wp_enqueue_style( 'lity-css', YIKES_Custom_Product_Tabs_URI .
|
80 |
}
|
81 |
}
|
82 |
}
|
@@ -85,7 +87,7 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Custom_Tabs' ) ) {
|
|
85 |
* Adds a new tab to the Product Data postbox in the admin product interface
|
86 |
*/
|
87 |
public function render_custom_product_tabs() {
|
88 |
-
echo
|
89 |
}
|
90 |
|
91 |
|
@@ -168,7 +170,7 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Custom_Tabs' ) ) {
|
|
168 |
|
169 |
// push the data to the array
|
170 |
$tab_data[$i] = array( 'title' => $tab_title, 'id' => $tab_id, 'content' => $tab_content );
|
171 |
-
}
|
172 |
|
173 |
// Deal with saving / applying globally saved tabs
|
174 |
|
@@ -284,7 +286,7 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Custom_Tabs' ) ) {
|
|
284 |
|
285 |
// Verify nonce
|
286 |
if ( ! check_ajax_referer( 'yikes_woo_get_wp_editor_nonce', 'security_nonce', false ) ) {
|
287 |
-
|
288 |
}
|
289 |
|
290 |
// Get & sanitize the $_POST var textarea_id
|
@@ -317,7 +319,7 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Custom_Tabs' ) ) {
|
|
317 |
|
318 |
// Verify the nonce
|
319 |
if ( ! check_ajax_referer( 'yikes_woo_save_product_tabs_nonce', 'security_nonce', false ) ) {
|
320 |
-
|
321 |
}
|
322 |
|
323 |
// Get our product id
|
@@ -326,16 +328,16 @@ if ( ! class_exists( 'YIKES_Custom_Product_Tabs_Custom_Tabs' ) ) {
|
|
326 |
} else {
|
327 |
|
328 |
// Fail gracefully...
|
329 |
-
wp_send_json_error( array( 'message' => 'Could not find the product!' ) );
|
330 |
}
|
331 |
|
332 |
// Save our tabs!
|
333 |
$success = $this->save_tabs( $post_id, $is_ajax = true );
|
334 |
|
335 |
if ( $success === true ) {
|
336 |
-
wp_send_json_success( array( 'message' => 'Your tabs have been saved' ) );
|
337 |
} else {
|
338 |
-
wp_send_json_error( array( 'message' => 'Uh oh! Something went wrong with saving. Please try again.' ) );
|
339 |
}
|
340 |
}
|
341 |
|
47 |
wp_enqueue_editor();
|
48 |
}
|
49 |
|
50 |
+
$suffix = SCRIPT_DEBUG ? '' : '.min';
|
51 |
+
|
52 |
// script
|
53 |
+
wp_enqueue_script ( 'repeatable-custom-tabs', YIKES_Custom_Product_Tabs_URI . "js/repeatable-custom-tabs{$suffix}.js" , array( 'jquery' ) , YIKES_Custom_Product_Tabs_Version );
|
54 |
wp_localize_script( 'repeatable-custom-tabs', 'repeatable_custom_tabs', array(
|
55 |
+
'loading_gif' => '<img src="' . admin_url( 'images/loading.gif' ) . '" alt="preloader" class="loading-wp-editor-gif" />',
|
56 |
+
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
57 |
+
'get_wp_editor_security_nonce' => wp_create_nonce( 'yikes_woo_get_wp_editor_nonce' ),
|
58 |
+
'save_tab_as_reusable_nonce' => wp_create_nonce( 'yikes_woo_save_tab_as_reusable_nonce' ),
|
59 |
+
'fetch_reusable_tabs_nonce' => wp_create_nonce( 'yikes_woo_fetch_reusable_tabs_nonce' ),
|
60 |
+
'fetch_reusable_tab_nonce' => wp_create_nonce( 'yikes_woo_fetch_reusable_tab_nonce' ),
|
61 |
+
'delete_reusable_tab_nonce' => wp_create_nonce( 'yikes_woo_delete_reusable_tab_nonce' ),
|
62 |
+
'save_product_tabs_nonce' => wp_create_nonce( 'yikes_woo_save_product_tabs_nonce' ),
|
63 |
+
'global_post_id' => $post->ID,
|
64 |
'get_wp_editor_failure_message' => __( 'Sorry! An error has occurred while trying to retrieve the editor. Please refresh the page and try again.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
65 |
+
'wp_version_four_eight' => $wp_version >= '4.8',
|
66 |
) );
|
67 |
|
68 |
+
wp_enqueue_script ( 'repeatable-custom-tabs-shared', YIKES_Custom_Product_Tabs_URI . "js/repeatable-custom-tabs-shared{$suffix}.js", array( 'jquery' ), YIKES_Custom_Product_Tabs_Version );
|
69 |
wp_localize_script( 'repeatable-custom-tabs-shared', 'repeatable_custom_tabs_shared', array(
|
70 |
+
'loading_gif' => '<img src="' . admin_url( 'images/loading.gif' ) . '" alt="preloader" class="loading-wp-editor-gif" />',
|
71 |
+
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
72 |
+
'get_wp_editor_security_nonce' => wp_create_nonce( 'yikes_woo_get_wp_editor_nonce' ),
|
73 |
'get_wp_editor_failure_message' => __( 'Sorry! An error has occurred while trying to retrieve the editor. Please refresh the page and try again.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
74 |
) );
|
75 |
|
76 |
// styles
|
77 |
+
wp_enqueue_style( 'repeatable-custom-tabs-styles' , YIKES_Custom_Product_Tabs_URI . "css/repeatable-custom-tabs{$suffix}.css", array(), YIKES_Custom_Product_Tabs_Version, 'all' );
|
78 |
|
79 |
// JS lity modal library and CSS
|
80 |
+
wp_enqueue_script( 'lity-js', YIKES_Custom_Product_Tabs_URI . "js/lity{$suffix}.js" , array( 'jquery' ) , YIKES_Custom_Product_LITY_Version );
|
81 |
+
wp_enqueue_style( 'lity-css', YIKES_Custom_Product_Tabs_URI . "css/lity{$suffix}.css", array(), YIKES_Custom_Product_LITY_Version, 'all' );
|
82 |
}
|
83 |
}
|
84 |
}
|
87 |
* Adds a new tab to the Product Data postbox in the admin product interface
|
88 |
*/
|
89 |
public function render_custom_product_tabs() {
|
90 |
+
echo '<li class="yikes_wc_product_tabs_tab"><a href="#yikes_woocommerce_custom_product_tabs"><span>' . __( 'Custom Tabs', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</span></a></li>';
|
91 |
}
|
92 |
|
93 |
|
170 |
|
171 |
// push the data to the array
|
172 |
$tab_data[$i] = array( 'title' => $tab_title, 'id' => $tab_id, 'content' => $tab_content );
|
173 |
+
}
|
174 |
|
175 |
// Deal with saving / applying globally saved tabs
|
176 |
|
286 |
|
287 |
// Verify nonce
|
288 |
if ( ! check_ajax_referer( 'yikes_woo_get_wp_editor_nonce', 'security_nonce', false ) ) {
|
289 |
+
wp_send_json_error();
|
290 |
}
|
291 |
|
292 |
// Get & sanitize the $_POST var textarea_id
|
319 |
|
320 |
// Verify the nonce
|
321 |
if ( ! check_ajax_referer( 'yikes_woo_save_product_tabs_nonce', 'security_nonce', false ) ) {
|
322 |
+
wp_send_json_error();
|
323 |
}
|
324 |
|
325 |
// Get our product id
|
328 |
} else {
|
329 |
|
330 |
// Fail gracefully...
|
331 |
+
wp_send_json_error( array( 'message' => __( 'Could not find the product!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) ) );
|
332 |
}
|
333 |
|
334 |
// Save our tabs!
|
335 |
$success = $this->save_tabs( $post_id, $is_ajax = true );
|
336 |
|
337 |
if ( $success === true ) {
|
338 |
+
wp_send_json_success( array( 'message' => __( 'Your tabs have been saved', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) ) );
|
339 |
} else {
|
340 |
+
wp_send_json_error( array( 'message' => __( 'Uh oh! Something went wrong with saving. Please try again.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) ) );
|
341 |
}
|
342 |
}
|
343 |
|
admin/page.support.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<!-- Title -->
|
4 |
<h1>
|
5 |
<span class="dashicons dashicons-exerpt-view"></span>
|
6 |
-
<?php
|
7 |
</h1>
|
8 |
|
9 |
<!-- Free Support-content Hook -->
|
3 |
<!-- Title -->
|
4 |
<h1>
|
5 |
<span class="dashicons dashicons-exerpt-view"></span>
|
6 |
+
<?php esc_html_e( 'Custom Product Tabs for WooCommerce | Support', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
7 |
</h1>
|
8 |
|
9 |
<!-- Free Support-content Hook -->
|
admin/page.yikes-woo-saved-tabs-single.php
CHANGED
@@ -6,98 +6,121 @@ if ( ! $new_tab && ( ! isset( $tab ) || empty( $tab ) ) ) {
|
|
6 |
if ( isset( $redirect ) ) {
|
7 |
echo '<p>';
|
8 |
echo sprintf( __( 'It looks like something went wrong. Please %1sgo back%2s. and try again', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
9 |
-
'<a href="' . $redirect . '" title="go back">', '</a>' );
|
10 |
echo '</p>';
|
11 |
}
|
12 |
exit;
|
13 |
}
|
14 |
|
15 |
// Set variables before using them
|
16 |
-
$tab_title
|
17 |
$tab_content = isset( $tab['tab_content'] ) && ! empty( $tab['tab_content'] ) ? $tab['tab_content'] : '';
|
18 |
-
$tab_id
|
19 |
$tab_name = isset( $tab['tab_name'] ) ? $tab['tab_name'] : '';
|
20 |
$taxonomies = isset( $tab['taxonomies'] ) && ! empty( $tab['taxonomies'] ) ? $tab['taxonomies'] : '';
|
21 |
$global = isset( $tab['global_tab'] ) && $tab['global_tab'] === true ? true : false;
|
22 |
|
23 |
?>
|
|
|
24 |
<div class="wrap woo-ct-admin-page-wrap">
|
|
|
25 |
<h1>
|
26 |
<span class="dashicons dashicons-exerpt-view"></span>
|
27 |
-
Custom Product Tabs for WooCommerce | <span id="yikes_woo_tab_title_header"><?php echo $tab_title; ?></span>
|
28 |
-
<
|
29 |
-
<a href="<?php echo $new_tab_url; ?>"> <?php _e( 'Add Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?> </a>
|
30 |
-
</span>
|
31 |
</h1>
|
32 |
|
33 |
-
<div class="
|
34 |
-
<
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
</div>
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
43 |
-
<!-- Only show this if we're updating an existing tab -->
|
44 |
-
<div class="yikes_woo_settings_info">
|
45 |
-
<p>
|
46 |
-
<?php _e( "Any updates made here will apply to all products using this tab.", 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
47 |
-
</p>
|
48 |
-
</div>
|
49 |
-
<?php } ?>
|
50 |
|
51 |
-
|
|
|
52 |
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
<
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
-
<!-- Tab Name -->
|
64 |
-
<div class="yikes_woo_reusable_tab_title">
|
65 |
-
<label class="yikes_woo_reusable_tab_title_label" for="yikes_woo_reusable_tab_name_<?php echo $tab_id; ?>">
|
66 |
-
<h3><?php _e( 'Tab Name', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></h3>
|
67 |
-
</label>
|
68 |
-
<input type="text" id="yikes_woo_reusable_tab_name_<?php echo $tab_id; ?>" value="<?php echo $tab_name; ?>" />
|
69 |
-
<div class="yikes_woo_reusable_tab_title_note"><?php _e( 'This is for your reference only.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></div>
|
70 |
-
</div>
|
71 |
-
|
72 |
-
<!-- Content -->
|
73 |
-
<div class="yikes_woo_reusable_tab_content">
|
74 |
-
<label class="yikes_woo_reusable_tab_content_label" for="yikes_woo_reusable_tab_content_<?php echo $tab_id; ?>">
|
75 |
-
<h3><?php _e( 'Tab Content', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></h3>
|
76 |
-
</label>
|
77 |
-
<?php
|
78 |
-
wp_editor( stripslashes( $tab_content ), 'yikes_woo_reusable_tab_content_' . $tab_id, array( 'textarea_name' => 'yikes_woo_reusable_tab_content_' . $tab_id, 'textarea_rows' => 8 ) );
|
79 |
-
?>
|
80 |
</div>
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
|
|
93 |
</div>
|
94 |
-
|
|
|
95 |
</div>
|
|
|
96 |
|
97 |
-
|
98 |
-
|
99 |
|
|
|
100 |
</div>
|
|
|
101 |
|
102 |
-
|
103 |
-
</div>
|
6 |
if ( isset( $redirect ) ) {
|
7 |
echo '<p>';
|
8 |
echo sprintf( __( 'It looks like something went wrong. Please %1sgo back%2s. and try again', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
9 |
+
'<a href="' . esc_url( $redirect ) . '" title="go back">', '</a>' );
|
10 |
echo '</p>';
|
11 |
}
|
12 |
exit;
|
13 |
}
|
14 |
|
15 |
// Set variables before using them
|
16 |
+
$tab_title = isset( $tab['tab_title'] ) && ! empty( $tab['tab_title'] ) ? $tab['tab_title'] : '';
|
17 |
$tab_content = isset( $tab['tab_content'] ) && ! empty( $tab['tab_content'] ) ? $tab['tab_content'] : '';
|
18 |
+
$tab_id = isset( $tab['tab_id'] ) && ! empty( $tab['tab_id'] ) ? (int) $tab['tab_id'] : 'new';
|
19 |
$tab_name = isset( $tab['tab_name'] ) ? $tab['tab_name'] : '';
|
20 |
$taxonomies = isset( $tab['taxonomies'] ) && ! empty( $tab['taxonomies'] ) ? $tab['taxonomies'] : '';
|
21 |
$global = isset( $tab['global_tab'] ) && $tab['global_tab'] === true ? true : false;
|
22 |
|
23 |
?>
|
24 |
+
|
25 |
<div class="wrap woo-ct-admin-page-wrap">
|
26 |
+
|
27 |
<h1>
|
28 |
<span class="dashicons dashicons-exerpt-view"></span>
|
29 |
+
<?php esc_html_e( 'Custom Product Tabs for WooCommerce ', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?> | <span id="yikes_woo_tab_title_header"><?php echo ! empty( $tab_title ) ? esc_html( $tab_title ) : __( 'New Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></span>
|
30 |
+
<a href="<?php echo esc_url( $new_tab_url ); ?>" class="page-title-action"> <?php _e( 'Add New', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?> </a>
|
|
|
|
|
31 |
</h1>
|
32 |
|
33 |
+
<div class="yikes_woo_go_back_url">
|
34 |
+
<a class="button" href="<?php echo esc_url( $redirect ); ?>">
|
35 |
+
<?php esc_html_e( 'Go Back to All Saved Tabs list', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
36 |
+
</a>
|
37 |
+
</div>
|
|
|
38 |
|
39 |
+
<div id="poststuff">
|
40 |
|
41 |
+
<div id="post-body" class="metabox-holder columns-2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
+
<!-- main content -->
|
44 |
+
<div id="post-body-content">
|
45 |
|
46 |
+
<!-- here -->
|
47 |
+
<?php if ( $new_tab !== true ) { ?>
|
48 |
+
<!-- Only show this if we're updating an existing tab -->
|
49 |
+
<div class="yikes_woo_settings_info">
|
50 |
+
<p>
|
51 |
+
<?php esc_html_e( 'Any updates made here will apply to all products using this tab.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
52 |
+
</p>
|
53 |
+
</div>
|
54 |
+
<?php } ?>
|
55 |
|
56 |
+
<?php do_action( 'yikes-woo-display-too-many-products-warning' ); ?>
|
57 |
+
|
58 |
+
<div class="row yikes_woo_reusable_tabs_container" id="yikes_woo_reusable_tabs_container_<?php echo esc_attr( $tab_id ); ?>" data-tab-id="<?php echo esc_attr( $tab_id ); ?>">
|
59 |
+
|
60 |
+
<!-- Title -->
|
61 |
+
<div class="yikes_woo_reusable_tab_title">
|
62 |
+
<label class="yikes_woo_reusable_tab_title_label" for="yikes_woo_reusable_tab_title_<?php echo esc_attr( $tab_id ); ?>">
|
63 |
+
<h3><?php esc_html_e( 'Tab Title', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></h3>
|
64 |
+
</label>
|
65 |
+
<input type="text" id="yikes_woo_reusable_tab_title_<?php echo esc_attr( $tab_id ); ?>" class="widefat" value="<?php echo esc_attr( $tab_title ); ?>" />
|
66 |
+
</div>
|
67 |
+
|
68 |
+
<!-- Tab Name -->
|
69 |
+
<div class="yikes_woo_reusable_tab_title">
|
70 |
+
<label class="yikes_woo_reusable_tab_title_label" for="yikes_woo_reusable_tab_name_<?php echo esc_attr( $tab_id ); ?>">
|
71 |
+
<h3><?php esc_html_e( 'Tab Name', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></h3>
|
72 |
+
</label>
|
73 |
+
<input type="text" id="yikes_woo_reusable_tab_name_<?php echo esc_attr( $tab_id ); ?>" class="widefat" value="<?php echo esc_attr( $tab_name ); ?>" />
|
74 |
+
<div class="yikes_woo_reusable_tab_title_note"><em><?php esc_html_e( 'This is for your reference only.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></em></div>
|
75 |
+
</div>
|
76 |
+
|
77 |
+
<!-- Content -->
|
78 |
+
<div class="yikes_woo_reusable_tab_content">
|
79 |
+
<label class="yikes_woo_reusable_tab_content_label" for="yikes_woo_reusable_tab_content_<?php echo $tab_id; ?>">
|
80 |
+
<h3><?php esc_html_e( 'Tab Content', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></h3>
|
81 |
+
</label>
|
82 |
+
<?php
|
83 |
+
wp_editor( stripslashes( $tab_content ), 'yikes_woo_reusable_tab_content_' . esc_attr( $tab_id ), array( 'textarea_name' => 'yikes_woo_reusable_tab_content_' . esc_attr( $tab_id ), 'textarea_rows' => 8 ) );
|
84 |
+
?>
|
85 |
+
</div>
|
86 |
+
|
87 |
+
<?php do_action( 'yikes-woo-saved-tab-before-save-buttons', $saved_tab_id, $taxonomies, $global ); ?>
|
88 |
+
|
89 |
+
<!-- Buttons -->
|
90 |
+
<div class="yikes_woo_save_and_delete_tab_buttons">
|
91 |
+
<span class="button button-primary yikes_woo_save_this_tab" id="yikes_woo_save_this_tab_<?php echo esc_attr( $tab_id ); ?>" data-tab-id="<?php echo esc_attr( $tab_id ); ?>">
|
92 |
+
<?php esc_html_e( 'Save Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
93 |
+
</span>
|
94 |
+
<span class="button button-primary yikes_woo_delete_this_tab yikes_woo_delete_this_tab_single" id="yikes_woo_delete_this_tab_<?php echo esc_attr( $tab_id ); ?>" data-tab-id="<?php echo esc_attr( $tab_id ); ?>">
|
95 |
+
<?php esc_html_e( 'Delete Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
96 |
+
</span>
|
97 |
+
</div>
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
</div>
|
100 |
|
101 |
+
</div>
|
102 |
+
<!-- post-body-content -->
|
103 |
+
|
104 |
+
<!-- sidebar -->
|
105 |
+
<div id="postbox-container-1" class="postbox-container">
|
106 |
+
|
107 |
+
<div class="meta-box-sortables">
|
108 |
+
|
109 |
+
<?php do_action( 'yikes-woo-saved-tabs-list-ad' ); ?>
|
110 |
+
|
111 |
+
<?php do_action( 'yikes-woo-saved-tab-after-save-buttons', $saved_tab_id ); ?>
|
112 |
+
|
113 |
</div>
|
114 |
+
<!-- .meta-box-sortables -->
|
115 |
+
|
116 |
</div>
|
117 |
+
<!-- #postbox-container-1 .postbox-container -->
|
118 |
|
119 |
+
</div>
|
120 |
+
<!-- #post-body .metabox-holder .columns-2 -->
|
121 |
|
122 |
+
<br class="clear">
|
123 |
</div>
|
124 |
+
<!-- #poststuff -->
|
125 |
|
126 |
+
</div> <!-- .wrap -->
|
|
admin/page.yikes-woo-saved-tabs.php
CHANGED
@@ -1,147 +1,174 @@
|
|
1 |
<div class="wrap woo-ct-admin-page-wrap">
|
2 |
|
3 |
-
<h1>
|
4 |
<span class="dashicons dashicons-exerpt-view"></span>
|
5 |
-
<?php
|
6 |
-
|
7 |
-
<a href="<?php echo $new_tab_url; ?>"> <?php _e( 'Add Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?> </a>
|
8 |
-
</span>
|
9 |
-
</h1>
|
10 |
-
|
11 |
-
<div class="cptpro-settings cptpro-savedtabs-pro-container <?php do_action( 'yikes-woo-saved-tabs-table-classes' ); ?>">
|
12 |
-
|
13 |
-
<!-- Delete-success Message -->
|
14 |
-
<div id="yikes_woo_delete_success_message" class="deleted notice notice-success is-dismissible" style="<?php echo $delete_message_display ?>">
|
15 |
-
<p>
|
16 |
-
<?php _e( 'Tab deleted!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
17 |
-
</p>
|
18 |
-
<button type="button" class="notice-dismiss">
|
19 |
-
<span class="screen-reader-text">Dismiss this notice.</span>
|
20 |
-
</button>
|
21 |
-
</div>
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
|
|
|
30 |
|
31 |
-
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
<
|
40 |
-
</
|
41 |
-
<input type="button" id="bulk-action-button" class="button action yikes_woo_handle_bulk_action" value="<?php _e( 'Apply', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) ?>">
|
42 |
</div>
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
<div class="row-actions">
|
109 |
-
<span class="">
|
110 |
-
<a href="<?php echo $edit_tab_url ?>"><?php _e( 'Edit Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></a>
|
111 |
-
</span> |
|
112 |
-
<span data-tab-id="<?php echo $tab_id; ?>" class="yikes_woo_delete_this_tab trash">
|
113 |
-
<?php _e( 'Delete Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
114 |
-
</span>
|
115 |
-
</div>
|
116 |
-
</td>
|
117 |
-
<td class="column-name"><?php echo $tab_name; ?></td>
|
118 |
-
<td class="column-content"><?php echo $tab_content_excerpt; ?></td>
|
119 |
-
<?php do_action( 'yikes-woo-saved-tabs-table-column', $tab_data ); ?>
|
120 |
-
<td class="column-edit" align="center">
|
121 |
-
<a href="<?php echo $edit_tab_url ?>" class="button-secondary view-saved-tab-button" data-entry-id="<?php echo (int) $tab_id; ?>">
|
122 |
-
<?php _e( 'Edit Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
123 |
-
</a>
|
124 |
-
</td>
|
125 |
-
</tr>
|
126 |
-
<?php
|
127 |
-
$tab_order++;
|
128 |
-
}
|
129 |
-
} else {
|
130 |
-
?>
|
131 |
-
<tr>
|
132 |
-
<td class="column-columnname" colspan="5">
|
133 |
-
<strong><?php _e( 'There are no saved tabs. Add one!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?> </strong>
|
134 |
-
</td>
|
135 |
-
</tr>
|
136 |
<?php
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
</div>
|
|
|
142 |
|
|
|
143 |
</div>
|
|
|
144 |
|
145 |
-
|
146 |
-
|
147 |
-
</div>
|
1 |
<div class="wrap woo-ct-admin-page-wrap">
|
2 |
|
3 |
+
<h1 class="wp-heading-inline">
|
4 |
<span class="dashicons dashicons-exerpt-view"></span>
|
5 |
+
<?php esc_html_e( 'Custom Product Tabs for WooCommerce | Saved Tabs', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
6 |
+
</h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
+
<a href="<?php echo esc_url( $new_tab_url ); ?>" class="page-title-action"><?php esc_html_e( 'Add New', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></a>
|
9 |
+
|
10 |
+
<div id="poststuff">
|
11 |
+
|
12 |
+
<div id="post-body" class="<?php echo esc_attr( apply_filters( 'yikes_woo_tabs_columns_container_class', 'metabox-holder columns-2' ) ); ?>">
|
13 |
|
14 |
+
<!-- main content -->
|
15 |
+
<div id="post-body-content">
|
16 |
|
17 |
+
<div class="cptpro-settings cptpro-savedtabs-pro-container <?php do_action( 'yikes-woo-saved-tabs-table-classes' ); ?>">
|
18 |
|
19 |
+
<!-- Delete-success Message -->
|
20 |
+
<div id="yikes_woo_delete_success_message" class="deleted notice notice-success is-dismissible" style="<?php echo esc_attr( $delete_message_display ); ?>">
|
21 |
+
<p>
|
22 |
+
<?php esc_html_e( 'Tab deleted!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
23 |
+
</p>
|
24 |
+
<button type="button" class="notice-dismiss">
|
25 |
+
<span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></span>
|
26 |
+
</button>
|
|
|
27 |
</div>
|
28 |
+
|
29 |
+
<div class="yikes_woo_settings_info">
|
30 |
+
<p>
|
31 |
+
<?php esc_html_e( 'Create and save tabs that you can add to multiple products.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
32 |
+
</p>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<?php do_action( 'yikes-woo-display-too-many-products-warning' ); ?>
|
36 |
+
|
37 |
+
<div id="poststuff" class="yikes-saved-tabs-row">
|
38 |
+
|
39 |
+
<!-- Bulk Actions -->
|
40 |
+
<div class="tablenav top">
|
41 |
+
<div class="alignleft actions bulkactions">
|
42 |
+
<label for="bulk-action-selector-top" class="screen-reader-text"><?php esc_html_e( 'Select bulk action', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></label>
|
43 |
+
<select name="action" id="bulk-action-selector-top">
|
44 |
+
<option value="-1"><?php esc_html_e( 'Bulk Actions', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></option>
|
45 |
+
<option value="delete" class="hide-if-no-js"><?php esc_html_e( 'Delete', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></option>
|
46 |
+
</select>
|
47 |
+
<input type="button" id="bulk-action-button" class="button action yikes_woo_handle_bulk_action" value="<?php esc_html_e( 'Apply', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) ?>">
|
48 |
+
</div>
|
49 |
+
<br class="clear">
|
50 |
+
</div>
|
51 |
+
<table id="yikes-woo-saved-tabs-list-table" class="widefat fixed striped" cellspacing="0">
|
52 |
+
<thead>
|
53 |
+
<tr>
|
54 |
+
<td id="cb" class="manage-column column-cb check-column" scope="col">
|
55 |
+
<label class="screen-reader-text" for="cb-select-all-1"><?php esc_html_e( 'Select All', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></label>
|
56 |
+
<input id="cb-select-all-1" type="checkbox">
|
57 |
+
</td>
|
58 |
+
<th class="manage-column column-tab-title" scope="col">
|
59 |
+
<?php esc_html_e( 'Tab Title', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
60 |
+
</th>
|
61 |
+
<th class="manage-column column-tab-name" scope="col">
|
62 |
+
<?php esc_html_e( 'Tab Name', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
63 |
+
</th>
|
64 |
+
<th class="manage-column column-tab-content-preview" scope="col">
|
65 |
+
<?php esc_html_e( 'Tab Content Preview', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
66 |
+
</th>
|
67 |
+
<?php do_action( 'yikes-woo-saved-tabs-table-header' ); ?>
|
68 |
+
<th class="manage-column column-edit" scope="col"> </th>
|
69 |
+
</tr>
|
70 |
+
</thead>
|
71 |
+
|
72 |
+
<tfoot>
|
73 |
+
<tr>
|
74 |
+
<td id="cb" class="manage-column column-cb check-column" scope="col">
|
75 |
+
<label class="screen-reader-text" for="cb-select-all-1"><?php esc_html_e( 'Select All', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></label>
|
76 |
+
<input id="cb-select-all-1" type="checkbox">
|
77 |
+
</td>
|
78 |
+
<th class="manage-column column-title" scope="col">
|
79 |
+
<?php esc_html_e( 'Tab Title', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
80 |
+
</th>
|
81 |
+
<th class="manage-column column-name" scope="col">
|
82 |
+
<?php esc_html_e( 'Tab Name', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
83 |
+
</th>
|
84 |
+
<th class="manage-column column-content" scope="col">
|
85 |
+
<?php esc_html_e( 'Tab Content Preview', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
86 |
+
</th>
|
87 |
+
<?php do_action( 'yikes-woo-saved-tabs-table-header' ); ?>
|
88 |
+
<th class="manage-column column-edit" scope="col"> </th>
|
89 |
+
</tr>
|
90 |
+
</tfoot>
|
91 |
+
|
92 |
+
<tbody id="yikes-woo-saved-tabs-list-tbody">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
<?php
|
94 |
+
if( ! empty( $yikes_custom_tab_data ) ) {
|
95 |
+
|
96 |
+
$yikes_custom_tab_data = apply_filters( 'yikes_woo_reorder_saved_tabs', $yikes_custom_tab_data );
|
97 |
+
$tab_order = 1;
|
98 |
+
|
99 |
+
foreach ( $yikes_custom_tab_data as $key => $tab_data ) {
|
100 |
+
|
101 |
+
// Set variables before using them.
|
102 |
+
$tab_title = isset( $tab_data['tab_title'] ) && ! empty( $tab_data['tab_title'] ) ? $tab_data['tab_title'] : '';
|
103 |
+
$tab_name = isset( $tab_data['tab_name'] ) ? $tab_data['tab_name'] : '';
|
104 |
+
$tab_content_excerpt = isset( $tab_data['tab_content'] ) && ! empty( $tab_data['tab_content'] ) ? stripslashes( substr( wp_strip_all_tags( $tab_data['tab_content'] ), 0, 150 ) ) : '';
|
105 |
+
$tab_id = isset( $tab_data['tab_id'] ) && ! empty( $tab_data['tab_id'] ) ? (int) $tab_data['tab_id'] : 0;
|
106 |
+
$edit_tab_url = esc_url_raw( add_query_arg( array( 'page' => YIKES_Custom_Product_Tabs_Settings_Page, 'saved-tab-id' => $tab_id ), admin_url( 'admin.php' ) ) );
|
107 |
+
?>
|
108 |
+
<tr class="yikes_woo_saved_tabs_row" id="yikes_woo_saved_tabs_row_<?php echo esc_attr( $tab_id ); ?>" data-tab-id="<?php echo esc_attr( $tab_id ); ?>" data-order="<?php echo esc_attr( $tab_order ); ?>">
|
109 |
+
<th class="check-column" scope="row">
|
110 |
+
<input class="entry-bulk-action-checkbox" type="checkbox" value="<?php echo esc_attr( $tab_id ); ?>" />
|
111 |
+
</th>
|
112 |
+
<td class="column-title">
|
113 |
+
<?php echo esc_html( $tab_title ); ?>
|
114 |
+
<div class="row-actions">
|
115 |
+
<span class="">
|
116 |
+
<a href="<?php echo esc_url( $edit_tab_url ); ?>"><?php esc_html_e( 'Edit Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></a>
|
117 |
+
</span> |
|
118 |
+
<span data-tab-id="<?php echo $tab_id; ?>" class="yikes_woo_delete_this_tab trash">
|
119 |
+
<a href="#" title="<?php esc_attr_e( 'Delete Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>"><?php esc_html_e( 'Delete Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
120 |
+
</span>
|
121 |
+
</div>
|
122 |
+
</td>
|
123 |
+
<td class="column-name"><?php echo esc_html( $tab_name ); ?></td>
|
124 |
+
<td class="column-content"><?php echo $tab_content_excerpt; ?></td>
|
125 |
+
<?php do_action( 'yikes-woo-saved-tabs-table-column', $tab_data ); ?>
|
126 |
+
<td class="column-edit" align="center">
|
127 |
+
<a href="<?php echo esc_url( $edit_tab_url ); ?>" class="button-secondary view-saved-tab-button" data-entry-id="<?php echo esc_attr( (int) $tab_id ); ?>">
|
128 |
+
<?php esc_html_e( 'Edit Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
|
129 |
+
</a>
|
130 |
+
</td>
|
131 |
+
</tr>
|
132 |
+
<?php
|
133 |
+
$tab_order++;
|
134 |
+
}
|
135 |
+
} else {
|
136 |
+
?>
|
137 |
+
<tr>
|
138 |
+
<td class="column-columnname" colspan="5">
|
139 |
+
<strong><?php esc_html_e( 'There are no saved tabs. Add one!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?> </strong>
|
140 |
+
</td>
|
141 |
+
</tr>
|
142 |
+
<?php
|
143 |
+
}
|
144 |
+
?>
|
145 |
+
</tbody>
|
146 |
+
</table>
|
147 |
+
</div>
|
148 |
+
|
149 |
+
</div>
|
150 |
+
|
151 |
+
</div>
|
152 |
+
<!-- post-body-content -->
|
153 |
+
|
154 |
+
<!-- sidebar -->
|
155 |
+
<div id="postbox-container-1" class="postbox-container">
|
156 |
+
|
157 |
+
<div class="meta-box-sortables">
|
158 |
+
|
159 |
+
<?php do_action( 'yikes-woo-saved-tabs-list-ad' ); ?>
|
160 |
+
|
161 |
+
</div>
|
162 |
+
<!-- .meta-box-sortables -->
|
163 |
+
|
164 |
+
</div>
|
165 |
+
<!-- #postbox-container-1 .postbox-container -->
|
166 |
+
|
167 |
</div>
|
168 |
+
<!-- #post-body .metabox-holder .columns-2 -->
|
169 |
|
170 |
+
<br class="clear">
|
171 |
</div>
|
172 |
+
<!-- #poststuff -->
|
173 |
|
174 |
+
</div> <!-- .wrap -->
|
|
|
|
changelog.txt
ADDED
@@ -0,0 +1,213 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
= 1.8.0 - October 17th, 2022 =
|
2 |
+
* Bump WC tested up to to 6.0.
|
3 |
+
* Update Custom Tabs page styles.
|
4 |
+
* Move full changelog to a changelog.txt file.
|
5 |
+
* Updated a few strings throughout the plugin.
|
6 |
+
* Tweaked README.md.
|
7 |
+
* Escape missed text, attributes and html.
|
8 |
+
* Wrap additional strings in gettext functions for translation.
|
9 |
+
* Regenerated .pot file.
|
10 |
+
* Added a conditional 2 column layout on the admin pages.
|
11 |
+
* Refactored the tab save method to account for new select2 fields in pro.
|
12 |
+
* Tweak the styles on the WooCommerce Custom Tabs section.
|
13 |
+
* Tweaked the markup so that when a new tab is added the button holder width is correct.
|
14 |
+
* Update button styles to match WooCommerce branding.
|
15 |
+
* Add custom admin footer text on our pages.
|
16 |
+
|
17 |
+
= 1.7.9 - June 21st, 2022 =
|
18 |
+
* Address minor vulnerability
|
19 |
+
* Fix issue related to Divi Builder
|
20 |
+
|
21 |
+
= 1.7.7 - March 8th, 2021 =
|
22 |
+
* Housekeeping
|
23 |
+
|
24 |
+
= 1.7.6 – October 19th, 2020 =
|
25 |
+
* WooCommerce 4.6 tested.
|
26 |
+
|
27 |
+
= 1.7.5 – September 18th, 2020 =
|
28 |
+
* Swapping (deprecated) wp_make_content_images_responsive for wp_filter_content_tags in our content filter. Thanks @stephencd!
|
29 |
+
|
30 |
+
= 1.7.4 – September 12th, 2020 =
|
31 |
+
* WooCommerce 4.5.
|
32 |
+
|
33 |
+
= 1.7.3 – August 19th, 2020 =
|
34 |
+
* WooCommerce 4.4.
|
35 |
+
* Fixes issues related to WordPress 5.5.
|
36 |
+
|
37 |
+
= 1.7.1 – March 13th, 2020 =
|
38 |
+
* Fixes a bug with product display in certain conditions.
|
39 |
+
|
40 |
+
= 1.7.0 – March 10th, 2020 =
|
41 |
+
* Toggle the content filter on or off setting added. Use this to help with compatibility.
|
42 |
+
* Support WooCommerce 4.0.
|
43 |
+
* Support WordPress 5.4.
|
44 |
+
|
45 |
+
= 1.6.13 - January 22nd, 2020 =
|
46 |
+
* Support WooCommerce 3.9.
|
47 |
+
|
48 |
+
= 1.6.12 - November 20th, 2019 =
|
49 |
+
* Support WooCommerce 3.8.
|
50 |
+
|
51 |
+
= 1.6.11 - September 25th, 2019 =
|
52 |
+
* Adding additional checks to post global before enqueueing assets.
|
53 |
+
|
54 |
+
= 1.6.10 - April 19th, 2019 =
|
55 |
+
* Updating WC compatibility.
|
56 |
+
* Fixing JS issue with WP backwards compatibility for versions < 4.7.
|
57 |
+
|
58 |
+
= 1.6.9 - January 18th, 2019 =
|
59 |
+
* Fixing an issue where the visual editor shows a small portion of the content on product edit pages.
|
60 |
+
|
61 |
+
= 1.6.8 - January 2nd, 2019 =
|
62 |
+
* Fixing some HTML markup.
|
63 |
+
* Applying PHPCS fixes.
|
64 |
+
|
65 |
+
= 1.6.7 - December 18th, 2018 =
|
66 |
+
* Adding filter to help allow importing of custom tabs.
|
67 |
+
* Changing our export filters so custom tabs work with WooCommerce's native meta export/import features.
|
68 |
+
* The default capability for all admin pages is now `publish_products`.
|
69 |
+
|
70 |
+
= 1.6.6 - October 26th, 2018 =
|
71 |
+
* Bumping WooCo Compatibility.
|
72 |
+
* Changed `wp_send_json_failure()` to `wp_send_json_error()`.
|
73 |
+
|
74 |
+
= 1.6.5 - October 3rd, 2018 =
|
75 |
+
* Bumping WooCo Compatibility.
|
76 |
+
|
77 |
+
= 1.6.4 - January 9th, 2018 =
|
78 |
+
* Happy new year!
|
79 |
+
* The editor is now vertically resizeable.
|
80 |
+
* The default capability for interacting with saved tabs is now Publish Products (publish_products)
|
81 |
+
|
82 |
+
= 1.6.3 - November 1st, 2017 =
|
83 |
+
* Declaring compatibility with WooCommerce and WordPress
|
84 |
+
|
85 |
+
= 1.6.2 - October 13th, 2017 =
|
86 |
+
* Fixed a PHP Fatal Error that was occurring for users with PHP versions < 5.5.
|
87 |
+
* Updated some of our documentation and language
|
88 |
+
|
89 |
+
= 1.6.1 - October 12th, 2017 =
|
90 |
+
* Fixed an issue with handling foreign characters. Foreign character tab titles should be working properly now. Sorry about that everyone!
|
91 |
+
* Added support for native WooCommerce exporting. You can now export and import your tabs with just WooCommerce!
|
92 |
+
* Fixed some styling issues
|
93 |
+
* Added a new "Support" page
|
94 |
+
* Added a new "Go Pro" page - check out [Custom Product Tabs Pro](https://yikesplugins.com/plugin/custom-product-tabs-pro/)
|
95 |
+
|
96 |
+
= 1.6.0 - October 9th, 2017 =
|
97 |
+
* Complete re-organization of all plugin files and removal of legacy code
|
98 |
+
* Added a "name" field for saved tabs. This field is used only on the admin as a way of identifying tabs.
|
99 |
+
* Tab "slugs" are now created via the WP Core `sanitize_title()` function. This should allow meaningful tab slugs when foreign characters are used in a title.
|
100 |
+
* Re-added the "Add Media" button to the editor when it's first initialized. This had disappeared when WP4.8 was released.
|
101 |
+
* Fixed some issues with loading saved tab content into the editor. This should fix the issue that some users were experiencing where adding a saved tab would only work the second time.
|
102 |
+
* Setting the width of the editor to 100%.
|
103 |
+
* Custom Product Tabs is now a top-level menu item instead of a sub-menu item.
|
104 |
+
* Cleaning up the saved tab's array so we don't leave orphaned data (e.g. added a hook so we delete a product's tabs when the product is deleted)
|
105 |
+
* Added a data update script to update all existing tab slugs to use `sanitize_title()` function.
|
106 |
+
* Generated new POT file.
|
107 |
+
* Added support and hooks for our new Custom Product Tabs Pro plugin!
|
108 |
+
|
109 |
+
= 1.5.17 - August 23rd, 2017 =
|
110 |
+
* Cleaning up some PHP Notices being thrown - thanks to @ZombiEquinox on GitHub for reporting this
|
111 |
+
* Updating readme compatibility values
|
112 |
+
|
113 |
+
= 1.5.16 - August 1st, 2017 =
|
114 |
+
* Adding a proper deactivation hook. The plugin will leave no trace.
|
115 |
+
|
116 |
+
= 1.5.15 - June 8th, 2017 =
|
117 |
+
* WordPress 4.8 support - using the new JavaScript Editor API functions to instantiate the editor and removed requiring WordPress' wpembed plugin
|
118 |
+
|
119 |
+
= 1.5.14 - May 8th, 2017 =
|
120 |
+
* Updating some CSS for the admin tabs table - the table should now render correctly regardless of "Visual" or "Text" tab and the saved tabs list should include a scrollbar if necessary
|
121 |
+
|
122 |
+
= 1.5.13 - April 17th, 2017 =
|
123 |
+
* Updating a WooCommerce action - now using the proper one instead of a deprecated one
|
124 |
+
|
125 |
+
= 1.5.12 - April 10th, 2017 =
|
126 |
+
* Adding some CSS to allow the editor's text mode to function properly
|
127 |
+
|
128 |
+
= 1.5.11 - April 6th, 2017 =
|
129 |
+
* Checking for the existence of the `get_id()` method before using it.
|
130 |
+
|
131 |
+
= 1.5.10 - April 5th, 2017 =
|
132 |
+
* Duplicating a product now duplicates custom product tabs and saved tabs correctly
|
133 |
+
|
134 |
+
= 1.5.9 - April 4th, 2017 =
|
135 |
+
* Tested and updated the plugin for WooCommerce v3.0.0
|
136 |
+
|
137 |
+
= 1.5.8 - March 17th, 2017 =
|
138 |
+
* Replaced the saved tab's ID w/ an "Add New" button on the single saved tab page - it should be easier to add saved tabs in bulk now
|
139 |
+
* Added a filter for all of the custom tab content - it should allow you to apply custom logic such as permissions in one central location
|
140 |
+
* Changed the way saved tabs are applied on the edit product page - it should allow embed content (especially Google Maps Embed content) to function correctly in all instances.
|
141 |
+
|
142 |
+
= 1.5.7 - February 27th, 2017 =
|
143 |
+
* Duplicating a product now duplicates the corresponding saved tabs correctly
|
144 |
+
* Added two filters (`yikes_woo_use_the_content_filter` and `yikes_woo_filter_main_tab_content`) to help provide a work-around to using the standard `the_content` filter which has caused numerous issues due to plugin conflicts.
|
145 |
+
|
146 |
+
= 1.5.6 - February 16th, 2017 =
|
147 |
+
* Fixed an issue where the "Add a Saved Tab" modal was displaying YouTube videos if a saved tab had a YouTube URL in its content
|
148 |
+
|
149 |
+
= 1.5.5 - January 23rd, 2017 =
|
150 |
+
* Re-did 1.5.4 changes - checking for function existence before using it
|
151 |
+
|
152 |
+
= 1.5.4 - January 23rd, 2017 =
|
153 |
+
* Re-did 1.5.3 changes - `the_content` filter is reapplied and the specific Site Builder plugin's filters are
|
154 |
+
|
155 |
+
= 1.5.3 - January 23rd, 2017 =
|
156 |
+
* Replaced the use of `the_content` filter with the filter's associated functions (e.g. `wptexturize`, `wpautop`)
|
157 |
+
|
158 |
+
= 1.5.2 - December 23rd, 2016 =
|
159 |
+
* The editor should only default to the 'Visual' tab for our Custom Product Tabs (no other editors)
|
160 |
+
* Added all of the default WordPress settings to the editor
|
161 |
+
|
162 |
+
= 1.5.1 - December 22nd, 2016 =
|
163 |
+
* Fixed bug that caused content to be copied incorrectly when moving tabs up / down
|
164 |
+
* Only on the product page will the editor default to 'Visual' (instead of every page)
|
165 |
+
|
166 |
+
= 1.5 - December 20th, 2016 =
|
167 |
+
* Version 1.5 includes a brand new feature - saved tabs - as well as a number of bug fixes, style tweaks, code clean-up, and comments
|
168 |
+
* UI: Complete overhaul of the custom tab interface for an easier, responsive tab creating experience.
|
169 |
+
* Saved Tabs: A new settings page has been added for users to create / update / delete saved tabs (see FAQ for more information)
|
170 |
+
* Saved Tabs: On the product edit page, a new button ('Add a Saved Tab') has been added that allows you to choose one of your saved tabs and add it to the current product
|
171 |
+
* Adding a new tab initializes a new wp_editor (WYSIWYG) instead of a plain textarea
|
172 |
+
* Added warning message when two tabs have the same title
|
173 |
+
* Tabs with empty titles are no longer shown on the product page
|
174 |
+
* Added ability to remove the first tab
|
175 |
+
* Adding, moving, and removing tabs works as expected when the user's 'Visual Editor' option is checked
|
176 |
+
* On the product & settings pages, WYSIWYG editors will default to the visual tab (this helps prevent errors with dynamic wp_editor generation)
|
177 |
+
* Added a filter `yikes_woocommerce_default_editor_mode` that can change the default-to-visual-tab behavior (use at your own risk!)
|
178 |
+
* Updated the 'How To' text, and slight modification to the style
|
179 |
+
* Changed the JavaScript methods controlling how tabs were added, deleted, and moved up/down
|
180 |
+
* Cleaned up and commented on all PHP and JavaScript files
|
181 |
+
* Added proper i18n, with languages/ folder, .pot file, and `load_plugin_textdomain` hook
|
182 |
+
* Incremented version #
|
183 |
+
|
184 |
+
= 1.4.4 - March 1st, 2016 =
|
185 |
+
* Re-named the tab ID's to support URL's with query args (eg: http://www.example.com/shop#tab-reviews)
|
186 |
+
|
187 |
+
= 1.4.3 - February 18th, 2016 =
|
188 |
+
* Wrapped missing 'Custom Tab Title' in localization/translation functions. (Plugin is now 100% translatable)
|
189 |
+
* Removed i18n class files, and old .po/.mo files (less bloat)
|
190 |
+
|
191 |
+
= 1.4.2 - February 17th, 2016 =
|
192 |
+
* Updated the internationalization strings ( `yikes-inc-woocommerce-custom-product-tabs` to `yikes-inc-easy-custom-woocommerce-product-tabs` )
|
193 |
+
|
194 |
+
= 1.4.1 - August 20th, 2015 =
|
195 |
+
* Fixed conflict with other CSV export plugins for WooCommerce
|
196 |
+
* Now custom product tab and row data/headers only get exported via 'Tools > Export > Products'
|
197 |
+
|
198 |
+
= 1.4 - July 29th, 2015 =
|
199 |
+
* Enhancement: Added the 'Custom Product Tabs for WooCommerce ' data to the standard WooCommerce export file, so custom tab data can be transferred between sites smoothly.
|
200 |
+
|
201 |
+
= 1.3 - July 21st, 2015 =
|
202 |
+
* Enhancement: Enabled WYSIWYG editor on tab content containers (enables shortcode and content to pass through the_content() filter)
|
203 |
+
* Updated repo screenshots and descriptions
|
204 |
+
|
205 |
+
= 1.2 - March 18th, 2015 =
|
206 |
+
* Enhancement: Fixed issue where non utf8 characters in tab titles caused front end not to generate the tabs
|
207 |
+
* Enhancement: When user doesn't have WooCommerce installed, they are now redirected to the plugin install search page, with WooCommerce at the top.
|
208 |
+
|
209 |
+
= 1.1 =
|
210 |
+
* Added class to the Woo tabs content title, for targeting via CSS ( `.yikes-custom-woo-tab-title` )
|
211 |
+
|
212 |
+
= 1.0.0 =
|
213 |
+
* Initial Release
|
css/dist/lity.min.css
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
/*! Lity - v3.0.0-dev - 2016-11-04
|
2 |
-
* http://sorgalla.com/lity/
|
3 |
-
* Copyright (c) 2015-2016 Jan Sorgalla; Licensed MIT */.lity{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;white-space:nowrap;background:#0b0b0b;background:rgba(0,0,0,.9);outline:none!important;opacity:0;-webkit-transition:opacity .3s ease;transition:opacity .3s ease}.lity.lity-opened{opacity:1}.lity.lity-closed{opacity:0}.lity *{box-sizing:border-box}.lity-wrap{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;text-align:center;outline:none!important}.lity-wrap:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.lity-loader{z-index:9991;color:#fff;position:absolute;top:50%;margin-top:-.8em;width:100%;text-align:center;font-size:14px;font-family:Arial,Helvetica,sans-serif;opacity:0;-webkit-transition:opacity .3s ease;transition:opacity .3s ease}.lity-loading .lity-loader{opacity:1}.lity-container{overflow: auto;z-index:9992;position:relative;text-align:left;vertical-align:middle;display:inline-block;white-space:normal;max-width:100%;max-height:100%;outline:none!important}.lity-content{z-index:9993;width:100%;-webkit-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform .3s ease;transition:-webkit-transform .3s ease;transition:transform .3s ease;transition:transform .3s ease,-webkit-transform .3s ease}.lity-closed .lity-content,.lity-loading .lity-content{-webkit-transform:scale(.8);transform:scale(.8)}.lity-content:after{content:'';position:absolute;left:0;top:0;bottom:0;display:block;right:0;width:auto;height:auto;z-index:-1;box-shadow:0 0 8px rgba(0,0,0,.6)}.lity-close{z-index:9994;width:35px;height:35px;position:fixed;right:0;top:0;-webkit-appearance:none;cursor:pointer;text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,.6);border:0;background:none;outline:none;box-shadow:none}.lity-close::-moz-focus-inner{border:0;padding:0}.lity-close:active,.lity-close:focus,.lity-close:hover,.lity-close:visited{text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,.6);border:0;background:none;outline:none;box-shadow:none}.lity-close:active{top:1px}.lity-image img{max-width:100%;display:block;line-height:0;border:0}.lity-iframe .lity-container{width:100%;max-width:964px}.lity-iframe-container{width:100%;height:0;padding-top:56.25%;overflow:auto;pointer-events:auto;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-overflow-scrolling:touch}.lity-iframe-container iframe{position:absolute;display:block;top:0;left:0;width:100%;height:100%;box-shadow:0 0 8px rgba(0,0,0,.6);background:#000}.lity-hide{display:none}
|
|
|
|
|
|
css/lity.css
ADDED
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! Lity - v2.4.1 - 2020-04-26
|
2 |
+
* http://sorgalla.com/lity/
|
3 |
+
* Copyright (c) 2015-2020 Jan Sorgalla; Licensed MIT */
|
4 |
+
.lity {
|
5 |
+
z-index: 9990;
|
6 |
+
position: fixed;
|
7 |
+
top: 0;
|
8 |
+
right: 0;
|
9 |
+
bottom: 0;
|
10 |
+
left: 0;
|
11 |
+
white-space: nowrap;
|
12 |
+
background: #0b0b0b;
|
13 |
+
background: rgba(0, 0, 0, 0.9);
|
14 |
+
outline: none !important;
|
15 |
+
opacity: 0;
|
16 |
+
-webkit-transition: opacity 0.3s ease;
|
17 |
+
-o-transition: opacity 0.3s ease;
|
18 |
+
transition: opacity 0.3s ease;
|
19 |
+
}
|
20 |
+
.lity.lity-opened {
|
21 |
+
opacity: 1;
|
22 |
+
}
|
23 |
+
.lity.lity-closed {
|
24 |
+
opacity: 0;
|
25 |
+
}
|
26 |
+
.lity * {
|
27 |
+
-webkit-box-sizing: border-box;
|
28 |
+
-moz-box-sizing: border-box;
|
29 |
+
box-sizing: border-box;
|
30 |
+
}
|
31 |
+
.lity-wrap {
|
32 |
+
z-index: 9990;
|
33 |
+
position: fixed;
|
34 |
+
top: 0;
|
35 |
+
right: 0;
|
36 |
+
bottom: 0;
|
37 |
+
left: 0;
|
38 |
+
text-align: center;
|
39 |
+
outline: none !important;
|
40 |
+
}
|
41 |
+
.lity-wrap:before {
|
42 |
+
content: '';
|
43 |
+
display: inline-block;
|
44 |
+
height: 100%;
|
45 |
+
vertical-align: middle;
|
46 |
+
margin-right: -0.25em;
|
47 |
+
}
|
48 |
+
.lity-loader {
|
49 |
+
z-index: 9991;
|
50 |
+
color: #fff;
|
51 |
+
position: absolute;
|
52 |
+
top: 50%;
|
53 |
+
margin-top: -0.8em;
|
54 |
+
width: 100%;
|
55 |
+
text-align: center;
|
56 |
+
font-size: 14px;
|
57 |
+
font-family: Arial, Helvetica, sans-serif;
|
58 |
+
opacity: 0;
|
59 |
+
-webkit-transition: opacity 0.3s ease;
|
60 |
+
-o-transition: opacity 0.3s ease;
|
61 |
+
transition: opacity 0.3s ease;
|
62 |
+
}
|
63 |
+
.lity-loading .lity-loader {
|
64 |
+
opacity: 1;
|
65 |
+
}
|
66 |
+
.lity-container {
|
67 |
+
z-index: 9992;
|
68 |
+
position: relative;
|
69 |
+
text-align: left;
|
70 |
+
vertical-align: middle;
|
71 |
+
display: inline-block;
|
72 |
+
white-space: normal;
|
73 |
+
max-width: 100%;
|
74 |
+
max-height: 100%;
|
75 |
+
outline: none !important;
|
76 |
+
}
|
77 |
+
.lity-content {
|
78 |
+
z-index: 9993;
|
79 |
+
width: 100%;
|
80 |
+
-webkit-transform: scale(1);
|
81 |
+
-ms-transform: scale(1);
|
82 |
+
-o-transform: scale(1);
|
83 |
+
transform: scale(1);
|
84 |
+
-webkit-transition: -webkit-transform 0.3s ease;
|
85 |
+
transition: -webkit-transform 0.3s ease;
|
86 |
+
-o-transition: -o-transform 0.3s ease;
|
87 |
+
transition: transform 0.3s ease;
|
88 |
+
transition: transform 0.3s ease, -webkit-transform 0.3s ease, -o-transform 0.3s ease;
|
89 |
+
}
|
90 |
+
.lity-loading .lity-content,
|
91 |
+
.lity-closed .lity-content {
|
92 |
+
-webkit-transform: scale(0.8);
|
93 |
+
-ms-transform: scale(0.8);
|
94 |
+
-o-transform: scale(0.8);
|
95 |
+
transform: scale(0.8);
|
96 |
+
}
|
97 |
+
.lity-content:after {
|
98 |
+
content: '';
|
99 |
+
position: absolute;
|
100 |
+
left: 0;
|
101 |
+
top: 0;
|
102 |
+
bottom: 0;
|
103 |
+
display: block;
|
104 |
+
right: 0;
|
105 |
+
width: auto;
|
106 |
+
height: auto;
|
107 |
+
z-index: -1;
|
108 |
+
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
109 |
+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
110 |
+
}
|
111 |
+
.lity-close {
|
112 |
+
z-index: 9994;
|
113 |
+
width: 35px;
|
114 |
+
height: 35px;
|
115 |
+
position: fixed;
|
116 |
+
right: 0;
|
117 |
+
top: 0;
|
118 |
+
-webkit-appearance: none;
|
119 |
+
cursor: pointer;
|
120 |
+
text-decoration: none;
|
121 |
+
text-align: center;
|
122 |
+
padding: 0;
|
123 |
+
color: #fff;
|
124 |
+
font-style: normal;
|
125 |
+
font-size: 35px;
|
126 |
+
font-family: Arial, Baskerville, monospace;
|
127 |
+
line-height: 35px;
|
128 |
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
|
129 |
+
border: 0;
|
130 |
+
background: none;
|
131 |
+
outline: none;
|
132 |
+
-webkit-box-shadow: none;
|
133 |
+
box-shadow: none;
|
134 |
+
}
|
135 |
+
.lity-close::-moz-focus-inner {
|
136 |
+
border: 0;
|
137 |
+
padding: 0;
|
138 |
+
}
|
139 |
+
.lity-close:hover,
|
140 |
+
.lity-close:focus,
|
141 |
+
.lity-close:active,
|
142 |
+
.lity-close:visited {
|
143 |
+
text-decoration: none;
|
144 |
+
text-align: center;
|
145 |
+
padding: 0;
|
146 |
+
color: #fff;
|
147 |
+
font-style: normal;
|
148 |
+
font-size: 35px;
|
149 |
+
font-family: Arial, Baskerville, monospace;
|
150 |
+
line-height: 35px;
|
151 |
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
|
152 |
+
border: 0;
|
153 |
+
background: none;
|
154 |
+
outline: none;
|
155 |
+
-webkit-box-shadow: none;
|
156 |
+
box-shadow: none;
|
157 |
+
}
|
158 |
+
.lity-close:active {
|
159 |
+
top: 1px;
|
160 |
+
}
|
161 |
+
/* Image */
|
162 |
+
.lity-image img {
|
163 |
+
max-width: 100%;
|
164 |
+
display: block;
|
165 |
+
line-height: 0;
|
166 |
+
border: 0;
|
167 |
+
}
|
168 |
+
/* iFrame */
|
169 |
+
.lity-iframe .lity-container,
|
170 |
+
.lity-youtube .lity-container,
|
171 |
+
.lity-vimeo .lity-container,
|
172 |
+
.lity-facebookvideo .lity-container,
|
173 |
+
.lity-googlemaps .lity-container {
|
174 |
+
width: 100%;
|
175 |
+
max-width: 964px;
|
176 |
+
}
|
177 |
+
.lity-iframe-container {
|
178 |
+
width: 100%;
|
179 |
+
height: 0;
|
180 |
+
padding-top: 56.25%;
|
181 |
+
overflow: auto;
|
182 |
+
pointer-events: auto;
|
183 |
+
-webkit-transform: translateZ(0);
|
184 |
+
transform: translateZ(0);
|
185 |
+
-webkit-overflow-scrolling: touch;
|
186 |
+
}
|
187 |
+
.lity-iframe-container iframe {
|
188 |
+
position: absolute;
|
189 |
+
display: block;
|
190 |
+
top: 0;
|
191 |
+
left: 0;
|
192 |
+
width: 100%;
|
193 |
+
height: 100%;
|
194 |
+
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
195 |
+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
196 |
+
background: #000;
|
197 |
+
}
|
198 |
+
.lity-hide {
|
199 |
+
display: none;
|
200 |
+
}
|
css/lity.min.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*! Lity - v2.4.1 - 2020-04-26
|
2 |
+
* http://sorgalla.com/lity/
|
3 |
+
* Copyright (c) 2015-2020 Jan Sorgalla; Licensed MIT */.lity{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;white-space:nowrap;background:#0b0b0b;background:rgba(0,0,0,0.9);outline:none !important;opacity:0;-webkit-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease}.lity.lity-opened{opacity:1}.lity.lity-closed{opacity:0}.lity *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lity-wrap{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;text-align:center;outline:none !important}.lity-wrap:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-0.25em}.lity-loader{z-index:9991;color:#fff;position:absolute;top:50%;margin-top:-0.8em;width:100%;text-align:center;font-size:14px;font-family:Arial,Helvetica,sans-serif;opacity:0;-webkit-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease}.lity-loading .lity-loader{opacity:1}.lity-container{z-index:9992;position:relative;text-align:left;vertical-align:middle;display:inline-block;white-space:normal;max-width:100%;max-height:100%;outline:none !important}.lity-content{z-index:9993;width:100%;-webkit-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform .3s ease;transition:-webkit-transform .3s ease;-o-transition:-o-transform .3s ease;transition:transform .3s ease;transition:transform .3s ease, -webkit-transform .3s ease, -o-transform .3s ease}.lity-loading .lity-content,.lity-closed .lity-content{-webkit-transform:scale(.8);-ms-transform:scale(.8);-o-transform:scale(.8);transform:scale(.8)}.lity-content:after{content:'';position:absolute;left:0;top:0;bottom:0;display:block;right:0;width:auto;height:auto;z-index:-1;-webkit-box-shadow:0 0 8px rgba(0,0,0,0.6);box-shadow:0 0 8px rgba(0,0,0,0.6)}.lity-close{z-index:9994;width:35px;height:35px;position:fixed;right:0;top:0;-webkit-appearance:none;cursor:pointer;text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,0.6);border:0;background:none;outline:none;-webkit-box-shadow:none;box-shadow:none}.lity-close::-moz-focus-inner{border:0;padding:0}.lity-close:hover,.lity-close:focus,.lity-close:active,.lity-close:visited{text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,0.6);border:0;background:none;outline:none;-webkit-box-shadow:none;box-shadow:none}.lity-close:active{top:1px}.lity-image img{max-width:100%;display:block;line-height:0;border:0}.lity-iframe .lity-container,.lity-youtube .lity-container,.lity-vimeo .lity-container,.lity-facebookvideo .lity-container,.lity-googlemaps .lity-container{width:100%;max-width:964px}.lity-iframe-container{width:100%;height:0;padding-top:56.25%;overflow:auto;pointer-events:auto;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-overflow-scrolling:touch}.lity-iframe-container iframe{position:absolute;display:block;top:0;left:0;width:100%;height:100%;-webkit-box-shadow:0 0 8px rgba(0,0,0,0.6);box-shadow:0 0 8px rgba(0,0,0,0.6);background:#000}.lity-hide{display:none}
|
css/repeatable-custom-tabs.css
CHANGED
@@ -1 +1,502 @@
|
|
1 |
-
|
2 |
Global
|
3 |
========================================================================== */
|
4 |
-
---------------------------------------------- */
|
5 |
Woo Product Editing Screen
|
6 |
========================================================================== */
|
7 |
font-family: Dashicons;
|
8 |
content: '\f164';
|
9 |
min-height: 150px;
|
10 |
-
---------------------------------------------- */
|
11 |
position: absolute;
|
12 |
right: 1em;
|
13 |
top: 12px;
|
14 |
-
---------------------------------------------- */
|
15 |
border-top: 1px solid #a0a5aa;
|
16 |
-
---------------------------------------------- */
|
17 |
width: 100%;
|
18 |
white-space: nowrap;
|
19 |
-
---------------------------------------------- */
|
20 |
Settings Pages
|
21 |
========================================================================== */
|
22 |
-
---------------------------------------------- */
|
23 |
-
---------------------------------------------- */
|
24 |
-
---------------------------------------------- */
|
25 |
border-top: 1px solid #ccc;
|
26 |
margin-top: 2rem;
|
27 |
padding-top: 1rem;
|
28 |
Promotional Items
|
29 |
========================================================================== */
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
Global
|
2 |
========================================================================== */
|
|
|
3 |
Woo Product Editing Screen
|
4 |
========================================================================== */
|
5 |
font-family: Dashicons;
|
6 |
content: '\f164';
|
7 |
min-height: 150px;
|
|
|
8 |
position: absolute;
|
9 |
right: 1em;
|
10 |
top: 12px;
|
|
|
11 |
border-top: 1px solid #a0a5aa;
|
|
|
12 |
width: 100%;
|
13 |
white-space: nowrap;
|
|
|
14 |
Settings Pages
|
15 |
========================================================================== */
|
|
|
|
|
|
|
16 |
border-top: 1px solid #ccc;
|
17 |
margin-top: 2rem;
|
18 |
padding-top: 1rem;
|
19 |
Promotional Items
|
20 |
========================================================================== */
|
21 |
+
|
22 |
+
/* ==========================================================================
|
23 |
+
Global
|
24 |
+
========================================================================== */
|
25 |
+
|
26 |
+
/* =Misc
|
27 |
+
----------------------------------------------- */
|
28 |
+
|
29 |
+
.loading-wp-editor-gif {
|
30 |
+
margin-left: 50%;
|
31 |
+
margin-right: 50%;
|
32 |
+
}
|
33 |
+
|
34 |
+
.loading-wp-editor-gif-settings {
|
35 |
+
padding-left: 50px;
|
36 |
+
}
|
37 |
+
|
38 |
+
.dashicons.inline-button-dashicons {
|
39 |
+
font-size: 15px;
|
40 |
+
vertical-align: bottom;
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
+
/* ==========================================================================
|
46 |
+
Woo Product Editing Screen
|
47 |
+
========================================================================== */
|
48 |
+
|
49 |
+
.yikes_woo_tabs_title_field {
|
50 |
+
width: 70% !important;
|
51 |
+
}
|
52 |
+
|
53 |
+
#duplicate_this_row {
|
54 |
+
display: none;
|
55 |
+
}
|
56 |
+
|
57 |
+
#woocommerce-product-data ul.wc-tabs li.yikes_wc_product_tabs_tab a::before {
|
58 |
+
font-family: Dashicons;
|
59 |
+
content: '\f164';
|
60 |
+
}
|
61 |
+
|
62 |
+
#yikes_woocommerce_custom_product_tabs hr {
|
63 |
+
margin: 1.5em 0;
|
64 |
+
}
|
65 |
+
|
66 |
+
#yikes_woocommerce_custom_product_tabs .options_group {
|
67 |
+
padding: 0 1em;
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
+
#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field {
|
72 |
+
max-width: 100%;
|
73 |
+
padding-left: 0;
|
74 |
+
}
|
75 |
+
|
76 |
+
#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field-tinymce,
|
77 |
+
#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel div.form-field-tinymce {
|
78 |
+
display: inline-block;
|
79 |
+
padding-left: 0;
|
80 |
+
vertical-align: top;
|
81 |
+
width: 80%;
|
82 |
+
}
|
83 |
+
|
84 |
+
#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field-tinymce .mce-edit-area.mce-container,
|
85 |
+
#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel div.form-field-tinymce div.form-field-tinymce,
|
86 |
+
._yikes_wc_custom_repeatable_product_tabs_tab_content_field .mce-edit-area.mce-container {
|
87 |
+
min-height: 10rem
|
88 |
+
}
|
89 |
+
|
90 |
+
textarea.yikes_woo_custom_editor_styles {
|
91 |
+
border: 1px solid #ddd;
|
92 |
+
min-height: 10rem
|
93 |
+
}
|
94 |
+
|
95 |
+
.yikes_woo_custom_editor_styles {
|
96 |
+
position: relative;
|
97 |
+
z-index: 9;
|
98 |
+
}
|
99 |
+
|
100 |
+
iframe[id^=_yikes_wc_custom_repeatable_product_tabs_tab_content_] {
|
101 |
+
min-height: 150px;
|
102 |
+
}
|
103 |
+
|
104 |
+
._yikes_wc_custom_repeatable_product_tabs_tab_content_field {
|
105 |
+
display: inline-block;
|
106 |
+
}
|
107 |
+
|
108 |
+
.button-holder {
|
109 |
+
display: inline-block;
|
110 |
+
text-align: center;
|
111 |
+
width: 20%;
|
112 |
+
}
|
113 |
+
|
114 |
+
.yikes_wc_move_tab_container {
|
115 |
+
margin-top: 0.5em;
|
116 |
+
text-align: center;
|
117 |
+
}
|
118 |
+
|
119 |
+
.woocommerce_options_panel p.yikes_wc_move_tab {
|
120 |
+
line-height: 1;
|
121 |
+
padding: 0;
|
122 |
+
}
|
123 |
+
|
124 |
+
.button-holder .button-secondary.remove_this_tab {
|
125 |
+
background: #e35b5b;
|
126 |
+
border-color: #dc3232;
|
127 |
+
box-shadow: 0 1px 0 #dc3232;
|
128 |
+
color: #fff;
|
129 |
+
cursor: pointer;
|
130 |
+
margin-bottom: 1.5rem;
|
131 |
+
}
|
132 |
+
|
133 |
+
.button-holder .button-secondary.remove_this_tab .dashicons {
|
134 |
+
margin-top: -2px;
|
135 |
+
vertical-align: middle;
|
136 |
+
}
|
137 |
+
|
138 |
+
.move-tab-data-up ,
|
139 |
+
.move-tab-data-down {
|
140 |
+
font-size: 25px;
|
141 |
+
transition: color .2s;
|
142 |
+
width: 36px;
|
143 |
+
height: 36px;
|
144 |
+
margin: 0;
|
145 |
+
padding: 0;
|
146 |
+
border: 0;
|
147 |
+
background: none;
|
148 |
+
cursor: pointer;
|
149 |
+
}
|
150 |
+
|
151 |
+
.move-tab-data-up:focus,
|
152 |
+
.move-tab-data-down:focus {
|
153 |
+
box-shadow: 0 0 0 1px #4f94d4, 0 0 2px 1px rgb(79 148 212 / 80%);
|
154 |
+
outline: 1px solid transparent;
|
155 |
+
}
|
156 |
+
|
157 |
+
.move-tab-data-up:hover,
|
158 |
+
.move-tab-data-down:hover {
|
159 |
+
cursor: pointer;
|
160 |
+
color: rgb(76, 156, 206);
|
161 |
+
}
|
162 |
+
|
163 |
+
.move-tab-data-up:before {
|
164 |
+
content: "\f343";
|
165 |
+
color: inherit;
|
166 |
+
font: normal 20px/1 dashicons;
|
167 |
+
}
|
168 |
+
|
169 |
+
.move-tab-data-down:before {
|
170 |
+
content: "\f347";
|
171 |
+
color: inherit;
|
172 |
+
font: normal 20px/1 dashicons;
|
173 |
+
}
|
174 |
+
|
175 |
+
#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field {
|
176 |
+
padding: 5px 0 5px !important;
|
177 |
+
}
|
178 |
+
|
179 |
+
#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel .form-field label {
|
180 |
+
font-size: 1.1em;
|
181 |
+
font-weight: 700;
|
182 |
+
margin: 2px 8px 0 0;
|
183 |
+
width: auto;
|
184 |
+
}
|
185 |
+
|
186 |
+
.yikes-woo-custom-tab-divider {
|
187 |
+
display: block;
|
188 |
+
height: 2px;
|
189 |
+
margin: 2em 0 1.5em;;
|
190 |
+
border-bottom: 1px solid #eee;
|
191 |
+
}
|
192 |
+
|
193 |
+
|
194 |
+
/* =How to info icon
|
195 |
+
----------------------------------------------- */
|
196 |
+
|
197 |
+
.yikes-woo-tabs-hidden-how-to-info {
|
198 |
+
display: none;
|
199 |
+
font-family: "Open Sans" , sans-serif !important;
|
200 |
+
margin-right: 30px;
|
201 |
+
}
|
202 |
+
|
203 |
+
.woocommerce_options_panel p.yikes_woo_how_to_info {
|
204 |
+
margin: 9px 0 0 0;
|
205 |
+
padding: 0;
|
206 |
+
text-align: right;
|
207 |
+
}
|
208 |
+
|
209 |
+
.yikes-tabs-how-to-toggle {
|
210 |
+
font-size: 20px;
|
211 |
+
position: absolute;
|
212 |
+
right: 1em;
|
213 |
+
top: 12px;
|
214 |
+
}
|
215 |
+
|
216 |
+
.yikes-tabs-how-to-toggle:hover {
|
217 |
+
cursor: pointer;
|
218 |
+
}
|
219 |
+
|
220 |
+
.yikes_woo_how_to_info {
|
221 |
+
padding-left: 23px !important;
|
222 |
+
}
|
223 |
+
|
224 |
+
|
225 |
+
/* =Add Tabs Container
|
226 |
+
----------------------------------------------- */
|
227 |
+
|
228 |
+
.yikes_woo_save_success {
|
229 |
+
color: #31843f;
|
230 |
+
float: left;
|
231 |
+
padding-top: 1em;
|
232 |
+
}
|
233 |
+
|
234 |
+
.add_tabs_container,
|
235 |
+
._yikes_wc_add_tab_center {
|
236 |
+
border-top: 1px solid #eee;
|
237 |
+
margin: 2em 2px 0 0;
|
238 |
+
text-align: right;
|
239 |
+
width: 100%;
|
240 |
+
}
|
241 |
+
|
242 |
+
.add_tabs_container .button.button-primary {
|
243 |
+
margin-top: 10px;
|
244 |
+
}
|
245 |
+
|
246 |
+
._yikes_wc_add_tab_center {
|
247 |
+
border-top: none;
|
248 |
+
text-align: center;
|
249 |
+
}
|
250 |
+
|
251 |
+
.add_tabs_container._yikes_wc_add_tab_center_new .button.button-primary {
|
252 |
+
display: none;
|
253 |
+
}
|
254 |
+
|
255 |
+
#add_another_tab {
|
256 |
+
background: #bb77ae;
|
257 |
+
border-color: #a36597;
|
258 |
+
box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%), 0 1px 0 #a36597;
|
259 |
+
color: #fff;
|
260 |
+
text-shadow: 0 -1px 1px #a36597, 1px 0 1px #a36597, 0 1px 1px #a36597, -1px 0 1px #a36597;
|
261 |
+
margin-bottom: 10px;
|
262 |
+
margin-top: 10px;
|
263 |
+
}
|
264 |
+
|
265 |
+
#_yikes_wc_apply_a_saved_tab {
|
266 |
+
background: #bb77ae;
|
267 |
+
border-color: #a36597;
|
268 |
+
box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%), 0 1px 0 #a36597;
|
269 |
+
color: #fff;
|
270 |
+
text-shadow: 0 -1px 1px #a36597, 1px 0 1px #a36597, 0 1px 1px #a36597, -1px 0 1px #a36597;
|
271 |
+
margin: 10px 0 0 8px;
|
272 |
+
}
|
273 |
+
|
274 |
+
#add_another_tab:hover,
|
275 |
+
#add_another_tab:active,
|
276 |
+
#add_another_tab:focus,
|
277 |
+
#_yikes_wc_apply_a_saved_tab:hover,
|
278 |
+
#_yikes_wc_apply_a_saved_tab:active,
|
279 |
+
#_yikes_wc_apply_a_saved_tab:focus {
|
280 |
+
background: #a36597;
|
281 |
+
border-color: #a36597;
|
282 |
+
box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%), 0 1px 0 #a36597;
|
283 |
+
}
|
284 |
+
|
285 |
+
.yikes_woo_using_reusable_tab {
|
286 |
+
opacity: 0.6;
|
287 |
+
pointer-events: none;
|
288 |
+
}
|
289 |
+
|
290 |
+
|
291 |
+
/* =Saved Tabs Pop-up Box
|
292 |
+
----------------------------------------------- */
|
293 |
+
|
294 |
+
.lity-container {
|
295 |
+
background: #fff;
|
296 |
+
border-radius: 6px;
|
297 |
+
padding: 0.6em 1em 1em;
|
298 |
+
}
|
299 |
+
|
300 |
+
.lity-container .lity-content::after {
|
301 |
+
box-shadow: none;
|
302 |
+
}
|
303 |
+
|
304 |
+
[class*='yikes_wc_lity_col'] {
|
305 |
+
float: left;
|
306 |
+
}
|
307 |
+
|
308 |
+
.yikes_wc_lity_col_title {
|
309 |
+
width: 93%;
|
310 |
+
padding: 4px 20px 4px 2px;
|
311 |
+
white-space: nowrap;
|
312 |
+
}
|
313 |
+
|
314 |
+
.yikes_wc_lity_col_select {
|
315 |
+
width: 7%;
|
316 |
+
padding-right: 8px;
|
317 |
+
padding-top: 4px;
|
318 |
+
cursor: pointer;
|
319 |
+
}
|
320 |
+
|
321 |
+
.yikes_wc_lity_header {
|
322 |
+
border-bottom: 1px solid #555d66;
|
323 |
+
margin-bottom: 0.4em;
|
324 |
+
line-height: 1;
|
325 |
+
font-size: 1.2em;
|
326 |
+
font-weight: 700;
|
327 |
+
padding: 0 0 8px 0;
|
328 |
+
text-align: center;
|
329 |
+
width: 100%;
|
330 |
+
}
|
331 |
+
|
332 |
+
.yikes_wc_lity_header > span {
|
333 |
+
width: 100px;
|
334 |
+
text-align: center;
|
335 |
+
white-space: nowrap;
|
336 |
+
}
|
337 |
+
|
338 |
+
.display_saved_tabs_lity {
|
339 |
+
min-width: 300px;
|
340 |
+
}
|
341 |
+
|
342 |
+
|
343 |
+
|
344 |
+
/* =Feedback Success / Error Messages
|
345 |
+
----------------------------------------------- */
|
346 |
+
|
347 |
+
._yikes_wc_feedback_message {
|
348 |
+
display: none;
|
349 |
+
padding-left: 3px;
|
350 |
+
}
|
351 |
+
|
352 |
+
#yikes_woo_tab_error_message {
|
353 |
+
color: #FF0000;
|
354 |
+
}
|
355 |
+
|
356 |
+
#yikes_woo_tab_success_message {
|
357 |
+
color: #31843f;
|
358 |
+
margin-top: 4px;
|
359 |
+
}
|
360 |
+
|
361 |
+
|
362 |
+
|
363 |
+
|
364 |
+
/* ==========================================================================
|
365 |
+
Settings Pages
|
366 |
+
========================================================================== */
|
367 |
+
|
368 |
+
|
369 |
+
/* =General
|
370 |
+
----------------------------------------------- */
|
371 |
+
|
372 |
+
|
373 |
+
.yikes_woo_settings_info {
|
374 |
+
font-family: "Open Sans" , sans-serif;
|
375 |
+
}
|
376 |
+
|
377 |
+
.woo-ct-admin-page-wrap h1 .dashicons {
|
378 |
+
font-size: 30px;
|
379 |
+
height: 30px;
|
380 |
+
width: 30px;
|
381 |
+
}
|
382 |
+
|
383 |
+
.yikes-star {
|
384 |
+
color: goldenrod;
|
385 |
+
}
|
386 |
+
|
387 |
+
|
388 |
+
|
389 |
+
/* =Saved Tabs Main Page
|
390 |
+
----------------------------------------------- */
|
391 |
+
|
392 |
+
.cptpro-savedtabs-pro-container {
|
393 |
+
display: inline-block;
|
394 |
+
vertical-align: top;
|
395 |
+
}
|
396 |
+
|
397 |
+
.yikes_woo_delete_this_tab {
|
398 |
+
color: #0073aa;
|
399 |
+
cursor: pointer;
|
400 |
+
}
|
401 |
+
|
402 |
+
.yikes_woo_delete_this_tab:hover {
|
403 |
+
color: #00a0d2;
|
404 |
+
}
|
405 |
+
|
406 |
+
|
407 |
+
|
408 |
+
/* =Single Saved Tab Page
|
409 |
+
----------------------------------------------- */
|
410 |
+
|
411 |
+
.yikes_woo_go_back_url {
|
412 |
+
margin-top: 0.4rem;
|
413 |
+
}
|
414 |
+
|
415 |
+
.yikes_woo_reusable_tab_title > label h3, .yikes_woo_reusable_tab_content > label h3 {
|
416 |
+
margin-bottom: 6px;
|
417 |
+
}
|
418 |
+
|
419 |
+
.yikes_woo_reusable_tab_title, .yikes_woo_reusable_tab_content {
|
420 |
+
margin-bottom: 1.5em;
|
421 |
+
}
|
422 |
+
|
423 |
+
.wp-core-ui .button-primary.yikes_woo_delete_this_tab {
|
424 |
+
background: #e35b5b;
|
425 |
+
border-color: #e35b5b;
|
426 |
+
color: #fff;
|
427 |
+
cursor: pointer;
|
428 |
+
}
|
429 |
+
|
430 |
+
.wp-core-ui .button-primary.yikes_woo_delete_this_tab:hover,
|
431 |
+
.wp-core-ui .button-primary.yikes_woo_delete_this_tab:active {
|
432 |
+
background: #c55353;
|
433 |
+
border-color: #c55353;
|
434 |
+
}
|
435 |
+
|
436 |
+
.yikes_woo_add_another_tab:hover > a {
|
437 |
+
color: white;
|
438 |
+
}
|
439 |
+
|
440 |
+
|
441 |
+
.yikes_woo_number_of_products {
|
442 |
+
font-weight: bold;
|
443 |
+
}
|
444 |
+
|
445 |
+
.yikes_woo_save_and_delete_tab_buttons {
|
446 |
+
border-top: 1px solid #ccc;
|
447 |
+
margin-top: 2rem;
|
448 |
+
padding-top: 1rem;
|
449 |
+
}
|
450 |
+
|
451 |
+
._yikes_wc_title_red_overlay {
|
452 |
+
background-color: #e68989 !important;
|
453 |
+
}
|
454 |
+
|
455 |
+
.woocommerce_options_panel p.yikes_wc_override_reusable_tab_container {
|
456 |
+
line-height: 1.1;
|
457 |
+
margin-top: 0;
|
458 |
+
font-weight: 600;
|
459 |
+
font-size: 14px;
|
460 |
+
margin-bottom: 20px;
|
461 |
+
}
|
462 |
+
|
463 |
+
.woocommerce_options_panel label._yikes_wc_override_reusable_tab_label {
|
464 |
+
margin: 0 0 0 4px;
|
465 |
+
float: none;
|
466 |
+
}
|
467 |
+
|
468 |
+
|
469 |
+
/* ==========================================================================
|
470 |
+
Promotional Items
|
471 |
+
========================================================================== */
|
472 |
+
|
473 |
+
/* =Review/Tweet/Premium Promo Section on Saved Tab Main and Single Page
|
474 |
+
----------------------------------------------- */
|
475 |
+
|
476 |
+
.yikes-woo-all-about-us {
|
477 |
+
text-align: center;
|
478 |
+
}
|
479 |
+
|
480 |
+
.yikes-woo-all-about-us .yikes-woo-review-us-body,
|
481 |
+
.yikes-woo-all-about-us .yikes-woo-buy-us-body {
|
482 |
+
padding: 0 1rem 1rem;
|
483 |
+
}
|
484 |
+
|
485 |
+
.yikes-woo-all-about-us h3 {
|
486 |
+
margin: 0;
|
487 |
+
padding: 8px 12px;
|
488 |
+
color: #fff;
|
489 |
+
background-color: #00a0d2;
|
490 |
+
font-weight: 800;
|
491 |
+
font-size: 14px;
|
492 |
+
}
|
493 |
+
|
494 |
+
.yikes-woo-review-us .star-container .dashicons.dashicons-star-filled {
|
495 |
+
color: #E6B800;
|
496 |
+
}
|
497 |
+
|
498 |
+
.yikes-woo-review-us .star-container a {
|
499 |
+
text-decoration: none;
|
500 |
+
}
|
501 |
+
.yikes-woo-review-us-footer .yikes-love {
|
502 |
+
color: pink;
|
503 |
+
}
|
504 |
+
|
505 |
+
|
506 |
+
/* =Pro Page
|
507 |
+
----------------------------------------------- */
|
508 |
+
|
509 |
+
.cptpro-settings-pro-container {
|
510 |
+
max-width: 800px;
|
511 |
+
}
|
512 |
+
|
513 |
+
#lightslider {
|
514 |
+
text-align: center;
|
515 |
+
}
|
516 |
+
|
517 |
+
.cptpro-image {
|
518 |
+
max-width: 800px;
|
519 |
+
max-height: 600px;
|
520 |
+
}
|
521 |
+
|
522 |
+
|
css/repeatable-custom-tabs.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.loading-wp-editor-gif{margin-left:50%;margin-right:50%}.loading-wp-editor-gif-settings{padding-left:50px}.dashicons.inline-button-dashicons{font-size:15px;vertical-align:bottom}.yikes_woo_tabs_title_field{width:70%!important}#duplicate_this_row{display:none}#woocommerce-product-data ul.wc-tabs li.yikes_wc_product_tabs_tab a::before{font-family:Dashicons;content:'\f164'}#yikes_woocommerce_custom_product_tabs hr{margin:1.5em 0}#yikes_woocommerce_custom_product_tabs .options_group{padding:0 1em}#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field{max-width:100%;padding-left:0}#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel div.form-field-tinymce,#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field-tinymce{display:inline-block;padding-left:0;vertical-align:top;width:80%}#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel div.form-field-tinymce div.form-field-tinymce,#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field-tinymce .mce-edit-area.mce-container,._yikes_wc_custom_repeatable_product_tabs_tab_content_field .mce-edit-area.mce-container{min-height:10rem}textarea.yikes_woo_custom_editor_styles{border:1px solid #ddd;min-height:10rem}.yikes_woo_custom_editor_styles{position:relative;z-index:9}iframe[id^=_yikes_wc_custom_repeatable_product_tabs_tab_content_]
|
1 |
+
.loading-wp-editor-gif{margin-left:50%;margin-right:50%}.loading-wp-editor-gif-settings{padding-left:50px}.dashicons.inline-button-dashicons{font-size:15px;vertical-align:bottom}.yikes_woo_tabs_title_field{width:70%!important}#duplicate_this_row{display:none}#woocommerce-product-data ul.wc-tabs li.yikes_wc_product_tabs_tab a::before{font-family:Dashicons;content:'\f164'}#yikes_woocommerce_custom_product_tabs hr{margin:1.5em 0}#yikes_woocommerce_custom_product_tabs .options_group{padding:0 1em}#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field{max-width:100%;padding-left:0}#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel div.form-field-tinymce,#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field-tinymce{display:inline-block;padding-left:0;vertical-align:top;width:80%}#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel div.form-field-tinymce div.form-field-tinymce,#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field-tinymce .mce-edit-area.mce-container,._yikes_wc_custom_repeatable_product_tabs_tab_content_field .mce-edit-area.mce-container{min-height:10rem}textarea.yikes_woo_custom_editor_styles{border:1px solid #ddd;min-height:10rem}.yikes_woo_custom_editor_styles{position:relative;z-index:9}iframe[id^=_yikes_wc_custom_repeatable_product_tabs_tab_content_]{min-height:150px}._yikes_wc_custom_repeatable_product_tabs_tab_content_field{display:inline-block}.button-holder{display:inline-block;text-align:center;width:20%}.yikes_wc_move_tab_container{margin-top:.5em;text-align:center}.woocommerce_options_panel p.yikes_wc_move_tab{line-height:1;padding:0}.button-holder .button-secondary.remove_this_tab{background:#e35b5b;border-color:#dc3232;box-shadow:0 1px 0 #dc3232;color:#fff;cursor:pointer;margin-bottom:1.5rem}.button-holder .button-secondary.remove_this_tab .dashicons{margin-top:-2px;vertical-align:middle}.move-tab-data-down,.move-tab-data-up{font-size:25px;transition:color .2s;width:36px;height:36px;margin:0;padding:0;border:0;background:0 0;cursor:pointer}.move-tab-data-down:focus,.move-tab-data-up:focus{box-shadow:0 0 0 1px #4f94d4,0 0 2px 1px rgb(79 148 212 / 80%);outline:1px solid transparent}.move-tab-data-down:hover,.move-tab-data-up:hover{cursor:pointer;color:#4c9cce}.move-tab-data-up:before{content:"\f343";color:inherit;font:normal 20px/1 dashicons}.move-tab-data-down:before{content:"\f347";color:inherit;font:normal 20px/1 dashicons}#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel p.form-field{padding:5px 0 5px!important}#yikes_woocommerce_custom_product_tabs.woocommerce_options_panel .form-field label{font-size:1.1em;font-weight:700;margin:2px 8px 0 0;width:auto}.yikes-woo-custom-tab-divider{display:block;height:2px;margin:2em 0 1.5em;border-bottom:1px solid #eee}.yikes-woo-tabs-hidden-how-to-info{display:none;font-family:"Open Sans",sans-serif!important;margin-right:30px}.woocommerce_options_panel p.yikes_woo_how_to_info{margin:9px 0 0 0;padding:0;text-align:right}.yikes-tabs-how-to-toggle{font-size:20px;position:absolute;right:1em;top:12px}.yikes-tabs-how-to-toggle:hover{cursor:pointer}.yikes_woo_how_to_info{padding-left:23px!important}.yikes_woo_save_success{color:#31843f;float:left;padding-top:1em}._yikes_wc_add_tab_center,.add_tabs_container{border-top:1px solid #eee;margin:2em 2px 0 0;text-align:right;width:100%}.add_tabs_container .button.button-primary{margin-top:10px}._yikes_wc_add_tab_center{border-top:none;text-align:center}.add_tabs_container._yikes_wc_add_tab_center_new .button.button-primary{display:none}#add_another_tab{background:#bb77ae;border-color:#a36597;box-shadow:inset 0 1px 0 rgb(255 255 255 / 25%),0 1px 0 #a36597;color:#fff;text-shadow:0 -1px 1px #a36597,1px 0 1px #a36597,0 1px 1px #a36597,-1px 0 1px #a36597;margin-bottom:10px;margin-top:10px}#_yikes_wc_apply_a_saved_tab{background:#bb77ae;border-color:#a36597;box-shadow:inset 0 1px 0 rgb(255 255 255 / 25%),0 1px 0 #a36597;color:#fff;text-shadow:0 -1px 1px #a36597,1px 0 1px #a36597,0 1px 1px #a36597,-1px 0 1px #a36597;margin:10px 0 0 8px}#_yikes_wc_apply_a_saved_tab:active,#_yikes_wc_apply_a_saved_tab:focus,#_yikes_wc_apply_a_saved_tab:hover,#add_another_tab:active,#add_another_tab:focus,#add_another_tab:hover{background:#a36597;border-color:#a36597;box-shadow:inset 0 1px 0 rgb(255 255 255 / 25%),0 1px 0 #a36597}.yikes_woo_using_reusable_tab{opacity:.6;pointer-events:none}.lity-container{background:#fff;border-radius:6px;padding:.6em 1em 1em}.lity-container .lity-content::after{box-shadow:none}[class*=yikes_wc_lity_col]{float:left}.yikes_wc_lity_col_title{width:93%;padding:4px 20px 4px 2px;white-space:nowrap}.yikes_wc_lity_col_select{width:7%;padding-right:8px;padding-top:4px;cursor:pointer}.yikes_wc_lity_header{border-bottom:1px solid #555d66;margin-bottom:.4em;line-height:1;font-size:1.2em;font-weight:700;padding:0 0 8px 0;text-align:center;width:100%}.yikes_wc_lity_header>span{width:100px;text-align:center;white-space:nowrap}.display_saved_tabs_lity{min-width:300px}._yikes_wc_feedback_message{display:none;padding-left:3px}#yikes_woo_tab_error_message{color:red}#yikes_woo_tab_success_message{color:#31843f;margin-top:4px}.yikes_woo_settings_info{font-family:"Open Sans",sans-serif}.woo-ct-admin-page-wrap h1 .dashicons{font-size:30px;height:30px;width:30px}.yikes-star{color:#daa520}.cptpro-savedtabs-pro-container{display:inline-block;vertical-align:top}.yikes_woo_delete_this_tab{color:#0073aa;cursor:pointer}.yikes_woo_delete_this_tab:hover{color:#00a0d2}.yikes_woo_go_back_url{margin-top:.4rem}.yikes_woo_reusable_tab_content>label h3,.yikes_woo_reusable_tab_title>label h3{margin-bottom:6px}.yikes_woo_reusable_tab_content,.yikes_woo_reusable_tab_title{margin-bottom:1.5em}.wp-core-ui .button-primary.yikes_woo_delete_this_tab{background:#e35b5b;border-color:#e35b5b;color:#fff;cursor:pointer}.wp-core-ui .button-primary.yikes_woo_delete_this_tab:active,.wp-core-ui .button-primary.yikes_woo_delete_this_tab:hover{background:#c55353;border-color:#c55353}.yikes_woo_add_another_tab:hover>a{color:#fff}.yikes_woo_number_of_products{font-weight:700}.yikes_woo_save_and_delete_tab_buttons{border-top:1px solid #ccc;margin-top:2rem;padding-top:1rem}._yikes_wc_title_red_overlay{background-color:#e68989!important}.woocommerce_options_panel p.yikes_wc_override_reusable_tab_container{line-height:1.1;margin-top:0;font-weight:600;font-size:14px;margin-bottom:20px}.woocommerce_options_panel label._yikes_wc_override_reusable_tab_label{margin:0 0 0 4px;float:none}.yikes-woo-all-about-us{text-align:center}.yikes-woo-all-about-us .yikes-woo-buy-us-body,.yikes-woo-all-about-us .yikes-woo-review-us-body{padding:0 1rem 1rem}.yikes-woo-all-about-us h3{margin:0;padding:8px 12px;color:#fff;background-color:#00a0d2;font-weight:800;font-size:14px}.yikes-woo-review-us .star-container .dashicons.dashicons-star-filled{color:#e6b800}.yikes-woo-review-us .star-container a{text-decoration:none}.yikes-woo-review-us-footer .yikes-love{color:pink}.cptpro-settings-pro-container{max-width:800px}#lightslider{text-align:center}.cptpro-image{max-width:800px;max-height:600px}
|
js/lity.js
ADDED
@@ -0,0 +1,638 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! Lity - v2.4.1 - 2020-04-26
|
2 |
+
* http://sorgalla.com/lity/
|
3 |
+
* Copyright (c) 2015-2020 Jan Sorgalla; Licensed MIT */
|
4 |
+
(function(window, factory) {
|
5 |
+
if (typeof define === 'function' && define.amd) {
|
6 |
+
define(['jquery'], function($) {
|
7 |
+
return factory(window, $);
|
8 |
+
});
|
9 |
+
} else if (typeof module === 'object' && typeof module.exports === 'object') {
|
10 |
+
module.exports = factory(window, require('jquery'));
|
11 |
+
} else {
|
12 |
+
window.lity = factory(window, window.jQuery || window.Zepto);
|
13 |
+
}
|
14 |
+
}(typeof window !== "undefined" ? window : this, function(window, $) {
|
15 |
+
'use strict';
|
16 |
+
|
17 |
+
var document = window.document;
|
18 |
+
|
19 |
+
var _win = $(window);
|
20 |
+
var _deferred = $.Deferred;
|
21 |
+
var _html = $('html');
|
22 |
+
var _instances = [];
|
23 |
+
|
24 |
+
var _attrAriaHidden = 'aria-hidden';
|
25 |
+
var _dataAriaHidden = 'lity-' + _attrAriaHidden;
|
26 |
+
|
27 |
+
var _focusableElementsSelector = 'a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])';
|
28 |
+
|
29 |
+
var _defaultOptions = {
|
30 |
+
esc: true,
|
31 |
+
handler: null,
|
32 |
+
handlers: {
|
33 |
+
image: imageHandler,
|
34 |
+
inline: inlineHandler,
|
35 |
+
youtube: youtubeHandler,
|
36 |
+
vimeo: vimeoHandler,
|
37 |
+
googlemaps: googlemapsHandler,
|
38 |
+
facebookvideo: facebookvideoHandler,
|
39 |
+
iframe: iframeHandler
|
40 |
+
},
|
41 |
+
template: '<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>×</button></div></div></div>'
|
42 |
+
};
|
43 |
+
|
44 |
+
var _imageRegexp = /(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i;
|
45 |
+
var _youtubeRegex = /(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i;
|
46 |
+
var _vimeoRegex = /(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/;
|
47 |
+
var _googlemapsRegex = /((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i;
|
48 |
+
var _facebookvideoRegex = /(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i;
|
49 |
+
|
50 |
+
var _transitionEndEvent = (function() {
|
51 |
+
var el = document.createElement('div');
|
52 |
+
|
53 |
+
var transEndEventNames = {
|
54 |
+
WebkitTransition: 'webkitTransitionEnd',
|
55 |
+
MozTransition: 'transitionend',
|
56 |
+
OTransition: 'oTransitionEnd otransitionend',
|
57 |
+
transition: 'transitionend'
|
58 |
+
};
|
59 |
+
|
60 |
+
for (var name in transEndEventNames) {
|
61 |
+
if (el.style[name] !== undefined) {
|
62 |
+
return transEndEventNames[name];
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
return false;
|
67 |
+
})();
|
68 |
+
|
69 |
+
function transitionEnd(element) {
|
70 |
+
var deferred = _deferred();
|
71 |
+
|
72 |
+
if (!_transitionEndEvent || !element.length) {
|
73 |
+
deferred.resolve();
|
74 |
+
} else {
|
75 |
+
element.one(_transitionEndEvent, deferred.resolve);
|
76 |
+
setTimeout(deferred.resolve, 500);
|
77 |
+
}
|
78 |
+
|
79 |
+
return deferred.promise();
|
80 |
+
}
|
81 |
+
|
82 |
+
function settings(currSettings, key, value) {
|
83 |
+
if (arguments.length === 1) {
|
84 |
+
return $.extend({}, currSettings);
|
85 |
+
}
|
86 |
+
|
87 |
+
if (typeof key === 'string') {
|
88 |
+
if (typeof value === 'undefined') {
|
89 |
+
return typeof currSettings[key] === 'undefined'
|
90 |
+
? null
|
91 |
+
: currSettings[key];
|
92 |
+
}
|
93 |
+
|
94 |
+
currSettings[key] = value;
|
95 |
+
} else {
|
96 |
+
$.extend(currSettings, key);
|
97 |
+
}
|
98 |
+
|
99 |
+
return this;
|
100 |
+
}
|
101 |
+
|
102 |
+
function parseQueryParams(params) {
|
103 |
+
var pairs = decodeURI(params.split('#')[0]).split('&');
|
104 |
+
var obj = {}, p;
|
105 |
+
|
106 |
+
for (var i = 0, n = pairs.length; i < n; i++) {
|
107 |
+
if (!pairs[i]) {
|
108 |
+
continue;
|
109 |
+
}
|
110 |
+
|
111 |
+
p = pairs[i].split('=');
|
112 |
+
obj[p[0]] = p[1];
|
113 |
+
}
|
114 |
+
|
115 |
+
return obj;
|
116 |
+
}
|
117 |
+
|
118 |
+
function appendQueryParams(url, params) {
|
119 |
+
return url + (url.indexOf('?') > -1 ? '&' : '?') + $.param(params);
|
120 |
+
}
|
121 |
+
|
122 |
+
function transferHash(originalUrl, newUrl) {
|
123 |
+
var pos = originalUrl.indexOf('#');
|
124 |
+
|
125 |
+
if (-1 === pos) {
|
126 |
+
return newUrl;
|
127 |
+
}
|
128 |
+
|
129 |
+
if (pos > 0) {
|
130 |
+
originalUrl = originalUrl.substr(pos);
|
131 |
+
}
|
132 |
+
|
133 |
+
return newUrl + originalUrl;
|
134 |
+
}
|
135 |
+
|
136 |
+
function error(msg) {
|
137 |
+
return $('<span class="lity-error"></span>').append(msg);
|
138 |
+
}
|
139 |
+
|
140 |
+
function imageHandler(target, instance) {
|
141 |
+
var desc = (instance.opener() && instance.opener().data('lity-desc')) || 'Image with no description';
|
142 |
+
var img = $('<img src="' + target + '" alt="' + desc + '"/>');
|
143 |
+
var deferred = _deferred();
|
144 |
+
var failed = function() {
|
145 |
+
deferred.reject(error('Failed loading image'));
|
146 |
+
};
|
147 |
+
|
148 |
+
img
|
149 |
+
.on('load', function() {
|
150 |
+
if (this.naturalWidth === 0) {
|
151 |
+
return failed();
|
152 |
+
}
|
153 |
+
|
154 |
+
deferred.resolve(img);
|
155 |
+
})
|
156 |
+
.on('error', failed)
|
157 |
+
;
|
158 |
+
|
159 |
+
return deferred.promise();
|
160 |
+
}
|
161 |
+
|
162 |
+
imageHandler.test = function(target) {
|
163 |
+
return _imageRegexp.test(target);
|
164 |
+
};
|
165 |
+
|
166 |
+
function inlineHandler(target, instance) {
|
167 |
+
var el, placeholder, hasHideClass;
|
168 |
+
|
169 |
+
try {
|
170 |
+
el = $(target);
|
171 |
+
} catch (e) {
|
172 |
+
return false;
|
173 |
+
}
|
174 |
+
|
175 |
+
if (!el.length) {
|
176 |
+
return false;
|
177 |
+
}
|
178 |
+
|
179 |
+
placeholder = $('<i style="display:none !important"></i>');
|
180 |
+
hasHideClass = el.hasClass('lity-hide');
|
181 |
+
|
182 |
+
instance
|
183 |
+
.element()
|
184 |
+
.one('lity:remove', function() {
|
185 |
+
placeholder
|
186 |
+
.before(el)
|
187 |
+
.remove()
|
188 |
+
;
|
189 |
+
|
190 |
+
if (hasHideClass && !el.closest('.lity-content').length) {
|
191 |
+
el.addClass('lity-hide');
|
192 |
+
}
|
193 |
+
})
|
194 |
+
;
|
195 |
+
|
196 |
+
return el
|
197 |
+
.removeClass('lity-hide')
|
198 |
+
.after(placeholder)
|
199 |
+
;
|
200 |
+
}
|
201 |
+
|
202 |
+
function youtubeHandler(target) {
|
203 |
+
var matches = _youtubeRegex.exec(target);
|
204 |
+
|
205 |
+
if (!matches) {
|
206 |
+
return false;
|
207 |
+
}
|
208 |
+
|
209 |
+
return iframeHandler(
|
210 |
+
transferHash(
|
211 |
+
target,
|
212 |
+
appendQueryParams(
|
213 |
+
'https://www.youtube' + (matches[2] || '') + '.com/embed/' + matches[4],
|
214 |
+
$.extend(
|
215 |
+
{
|
216 |
+
autoplay: 1
|
217 |
+
},
|
218 |
+
parseQueryParams(matches[5] || '')
|
219 |
+
)
|
220 |
+
)
|
221 |
+
)
|
222 |
+
);
|
223 |
+
}
|
224 |
+
|
225 |
+
function vimeoHandler(target) {
|
226 |
+
var matches = _vimeoRegex.exec(target);
|
227 |
+
|
228 |
+
if (!matches) {
|
229 |
+
return false;
|
230 |
+
}
|
231 |
+
|
232 |
+
return iframeHandler(
|
233 |
+
transferHash(
|
234 |
+
target,
|
235 |
+
appendQueryParams(
|
236 |
+
'https://player.vimeo.com/video/' + matches[3],
|
237 |
+
$.extend(
|
238 |
+
{
|
239 |
+
autoplay: 1
|
240 |
+
},
|
241 |
+
parseQueryParams(matches[4] || '')
|
242 |
+
)
|
243 |
+
)
|
244 |
+
)
|
245 |
+
);
|
246 |
+
}
|
247 |
+
|
248 |
+
function facebookvideoHandler(target) {
|
249 |
+
var matches = _facebookvideoRegex.exec(target);
|
250 |
+
|
251 |
+
if (!matches) {
|
252 |
+
return false;
|
253 |
+
}
|
254 |
+
|
255 |
+
if (0 !== target.indexOf('http')) {
|
256 |
+
target = 'https:' + target;
|
257 |
+
}
|
258 |
+
|
259 |
+
return iframeHandler(
|
260 |
+
transferHash(
|
261 |
+
target,
|
262 |
+
appendQueryParams(
|
263 |
+
'https://www.facebook.com/plugins/video.php?href=' + target,
|
264 |
+
$.extend(
|
265 |
+
{
|
266 |
+
autoplay: 1
|
267 |
+
},
|
268 |
+
parseQueryParams(matches[4] || '')
|
269 |
+
)
|
270 |
+
)
|
271 |
+
)
|
272 |
+
);
|
273 |
+
}
|
274 |
+
|
275 |
+
function googlemapsHandler(target) {
|
276 |
+
var matches = _googlemapsRegex.exec(target);
|
277 |
+
|
278 |
+
if (!matches) {
|
279 |
+
return false;
|
280 |
+
}
|
281 |
+
|
282 |
+
return iframeHandler(
|
283 |
+
transferHash(
|
284 |
+
target,
|
285 |
+
appendQueryParams(
|
286 |
+
'https://www.google.' + matches[3] + '/maps?' + matches[6],
|
287 |
+
{
|
288 |
+
output: matches[6].indexOf('layer=c') > 0 ? 'svembed' : 'embed'
|
289 |
+
}
|
290 |
+
)
|
291 |
+
)
|
292 |
+
);
|
293 |
+
}
|
294 |
+
|
295 |
+
function iframeHandler(target) {
|
296 |
+
return '<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen allow="autoplay; fullscreen" src="' + target + '"/></div>';
|
297 |
+
}
|
298 |
+
|
299 |
+
function winHeight() {
|
300 |
+
return document.documentElement.clientHeight
|
301 |
+
? document.documentElement.clientHeight
|
302 |
+
: Math.round(_win.height());
|
303 |
+
}
|
304 |
+
|
305 |
+
function keydown(e) {
|
306 |
+
var current = currentInstance();
|
307 |
+
|
308 |
+
if (!current) {
|
309 |
+
return;
|
310 |
+
}
|
311 |
+
|
312 |
+
// ESC key
|
313 |
+
if (e.keyCode === 27 && !!current.options('esc')) {
|
314 |
+
current.close();
|
315 |
+
}
|
316 |
+
|
317 |
+
// TAB key
|
318 |
+
if (e.keyCode === 9) {
|
319 |
+
handleTabKey(e, current);
|
320 |
+
}
|
321 |
+
}
|
322 |
+
|
323 |
+
function handleTabKey(e, instance) {
|
324 |
+
var focusableElements = instance.element().find(_focusableElementsSelector);
|
325 |
+
var focusedIndex = focusableElements.index(document.activeElement);
|
326 |
+
|
327 |
+
if (e.shiftKey && focusedIndex <= 0) {
|
328 |
+
focusableElements.get(focusableElements.length - 1).focus();
|
329 |
+
e.preventDefault();
|
330 |
+
} else if (!e.shiftKey && focusedIndex === focusableElements.length - 1) {
|
331 |
+
focusableElements.get(0).focus();
|
332 |
+
e.preventDefault();
|
333 |
+
}
|
334 |
+
}
|
335 |
+
|
336 |
+
function resize() {
|
337 |
+
$.each(_instances, function(i, instance) {
|
338 |
+
instance.resize();
|
339 |
+
});
|
340 |
+
}
|
341 |
+
|
342 |
+
function registerInstance(instanceToRegister) {
|
343 |
+
if (1 === _instances.unshift(instanceToRegister)) {
|
344 |
+
_html.addClass('lity-active');
|
345 |
+
|
346 |
+
_win
|
347 |
+
.on({
|
348 |
+
resize: resize,
|
349 |
+
keydown: keydown
|
350 |
+
})
|
351 |
+
;
|
352 |
+
}
|
353 |
+
|
354 |
+
$('body > *').not(instanceToRegister.element())
|
355 |
+
.addClass('lity-hidden')
|
356 |
+
.each(function() {
|
357 |
+
var el = $(this);
|
358 |
+
|
359 |
+
if (undefined !== el.data(_dataAriaHidden)) {
|
360 |
+
return;
|
361 |
+
}
|
362 |
+
|
363 |
+
el.data(_dataAriaHidden, el.attr(_attrAriaHidden) || null);
|
364 |
+
})
|
365 |
+
.attr(_attrAriaHidden, 'true')
|
366 |
+
;
|
367 |
+
}
|
368 |
+
|
369 |
+
function removeInstance(instanceToRemove) {
|
370 |
+
var show;
|
371 |
+
|
372 |
+
instanceToRemove
|
373 |
+
.element()
|
374 |
+
.attr(_attrAriaHidden, 'true')
|
375 |
+
;
|
376 |
+
|
377 |
+
if (1 === _instances.length) {
|
378 |
+
_html.removeClass('lity-active');
|
379 |
+
|
380 |
+
_win
|
381 |
+
.off({
|
382 |
+
resize: resize,
|
383 |
+
keydown: keydown
|
384 |
+
})
|
385 |
+
;
|
386 |
+
}
|
387 |
+
|
388 |
+
_instances = $.grep(_instances, function(instance) {
|
389 |
+
return instanceToRemove !== instance;
|
390 |
+
});
|
391 |
+
|
392 |
+
if (!!_instances.length) {
|
393 |
+
show = _instances[0].element();
|
394 |
+
} else {
|
395 |
+
show = $('.lity-hidden');
|
396 |
+
}
|
397 |
+
|
398 |
+
show
|
399 |
+
.removeClass('lity-hidden')
|
400 |
+
.each(function() {
|
401 |
+
var el = $(this), oldAttr = el.data(_dataAriaHidden);
|
402 |
+
|
403 |
+
if (!oldAttr) {
|
404 |
+
el.removeAttr(_attrAriaHidden);
|
405 |
+
} else {
|
406 |
+
el.attr(_attrAriaHidden, oldAttr);
|
407 |
+
}
|
408 |
+
|
409 |
+
el.removeData(_dataAriaHidden);
|
410 |
+
})
|
411 |
+
;
|
412 |
+
}
|
413 |
+
|
414 |
+
function currentInstance() {
|
415 |
+
if (0 === _instances.length) {
|
416 |
+
return null;
|
417 |
+
}
|
418 |
+
|
419 |
+
return _instances[0];
|
420 |
+
}
|
421 |
+
|
422 |
+
function factory(target, instance, handlers, preferredHandler) {
|
423 |
+
var handler = 'inline', content;
|
424 |
+
|
425 |
+
var currentHandlers = $.extend({}, handlers);
|
426 |
+
|
427 |
+
if (preferredHandler && currentHandlers[preferredHandler]) {
|
428 |
+
content = currentHandlers[preferredHandler](target, instance);
|
429 |
+
handler = preferredHandler;
|
430 |
+
} else {
|
431 |
+
// Run inline and iframe handlers after all other handlers
|
432 |
+
$.each(['inline', 'iframe'], function(i, name) {
|
433 |
+
delete currentHandlers[name];
|
434 |
+
|
435 |
+
currentHandlers[name] = handlers[name];
|
436 |
+
});
|
437 |
+
|
438 |
+
$.each(currentHandlers, function(name, currentHandler) {
|
439 |
+
// Handler might be "removed" by setting callback to null
|
440 |
+
if (!currentHandler) {
|
441 |
+
return true;
|
442 |
+
}
|
443 |
+
|
444 |
+
if (
|
445 |
+
currentHandler.test &&
|
446 |
+
!currentHandler.test(target, instance)
|
447 |
+
) {
|
448 |
+
return true;
|
449 |
+
}
|
450 |
+
|
451 |
+
content = currentHandler(target, instance);
|
452 |
+
|
453 |
+
if (false !== content) {
|
454 |
+
handler = name;
|
455 |
+
return false;
|
456 |
+
}
|
457 |
+
});
|
458 |
+
}
|
459 |
+
|
460 |
+
return {handler: handler, content: content || ''};
|
461 |
+
}
|
462 |
+
|
463 |
+
function Lity(target, options, opener, activeElement) {
|
464 |
+
var self = this;
|
465 |
+
var result;
|
466 |
+
var isReady = false;
|
467 |
+
var isClosed = false;
|
468 |
+
var element;
|
469 |
+
var content;
|
470 |
+
|
471 |
+
options = $.extend(
|
472 |
+
{},
|
473 |
+
_defaultOptions,
|
474 |
+
options
|
475 |
+
);
|
476 |
+
|
477 |
+
element = $(options.template);
|
478 |
+
|
479 |
+
// -- API --
|
480 |
+
|
481 |
+
self.element = function() {
|
482 |
+
return element;
|
483 |
+
};
|
484 |
+
|
485 |
+
self.opener = function() {
|
486 |
+
return opener;
|
487 |
+
};
|
488 |
+
|
489 |
+
self.options = $.proxy(settings, self, options);
|
490 |
+
self.handlers = $.proxy(settings, self, options.handlers);
|
491 |
+
|
492 |
+
self.resize = function() {
|
493 |
+
if (!isReady || isClosed) {
|
494 |
+
return;
|
495 |
+
}
|
496 |
+
|
497 |
+
content
|
498 |
+
.css('max-height', winHeight() + 'px')
|
499 |
+
.trigger('lity:resize', [self])
|
500 |
+
;
|
501 |
+
};
|
502 |
+
|
503 |
+
self.close = function() {
|
504 |
+
if (!isReady || isClosed) {
|
505 |
+
return;
|
506 |
+
}
|
507 |
+
|
508 |
+
isClosed = true;
|
509 |
+
|
510 |
+
removeInstance(self);
|
511 |
+
|
512 |
+
var deferred = _deferred();
|
513 |
+
|
514 |
+
// We return focus only if the current focus is inside this instance
|
515 |
+
if (
|
516 |
+
activeElement &&
|
517 |
+
(
|
518 |
+
document.activeElement === element[0] ||
|
519 |
+
$.contains(element[0], document.activeElement)
|
520 |
+
)
|
521 |
+
) {
|
522 |
+
try {
|
523 |
+
activeElement.focus();
|
524 |
+
} catch (e) {
|
525 |
+
// Ignore exceptions, eg. for SVG elements which can't be
|
526 |
+
// focused in IE11
|
527 |
+
}
|
528 |
+
}
|
529 |
+
|
530 |
+
content.trigger('lity:close', [self]);
|
531 |
+
|
532 |
+
element
|
533 |
+
.removeClass('lity-opened')
|
534 |
+
.addClass('lity-closed')
|
535 |
+
;
|
536 |
+
|
537 |
+
transitionEnd(content.add(element))
|
538 |
+
.always(function() {
|
539 |
+
content.trigger('lity:remove', [self]);
|
540 |
+
element.remove();
|
541 |
+
element = undefined;
|
542 |
+
deferred.resolve();
|
543 |
+
})
|
544 |
+
;
|
545 |
+
|
546 |
+
return deferred.promise();
|
547 |
+
};
|
548 |
+
|
549 |
+
// -- Initialization --
|
550 |
+
|
551 |
+
result = factory(target, self, options.handlers, options.handler);
|
552 |
+
|
553 |
+
element
|
554 |
+
.attr(_attrAriaHidden, 'false')
|
555 |
+
.addClass('lity-loading lity-opened lity-' + result.handler)
|
556 |
+
.appendTo('body')
|
557 |
+
.focus()
|
558 |
+
.on('click', '[data-lity-close]', function(e) {
|
559 |
+
if ($(e.target).is('[data-lity-close]')) {
|
560 |
+
self.close();
|
561 |
+
}
|
562 |
+
})
|
563 |
+
.trigger('lity:open', [self])
|
564 |
+
;
|
565 |
+
|
566 |
+
registerInstance(self);
|
567 |
+
|
568 |
+
$.when(result.content)
|
569 |
+
.always(ready)
|
570 |
+
;
|
571 |
+
|
572 |
+
function ready(result) {
|
573 |
+
content = $(result)
|
574 |
+
.css('max-height', winHeight() + 'px')
|
575 |
+
;
|
576 |
+
|
577 |
+
element
|
578 |
+
.find('.lity-loader')
|
579 |
+
.each(function() {
|
580 |
+
var loader = $(this);
|
581 |
+
|
582 |
+
transitionEnd(loader)
|
583 |
+
.always(function() {
|
584 |
+
loader.remove();
|
585 |
+
})
|
586 |
+
;
|
587 |
+
})
|
588 |
+
;
|
589 |
+
|
590 |
+
element
|
591 |
+
.removeClass('lity-loading')
|
592 |
+
.find('.lity-content')
|
593 |
+
.empty()
|
594 |
+
.append(content)
|
595 |
+
;
|
596 |
+
|
597 |
+
isReady = true;
|
598 |
+
|
599 |
+
content
|
600 |
+
.trigger('lity:ready', [self])
|
601 |
+
;
|
602 |
+
}
|
603 |
+
}
|
604 |
+
|
605 |
+
function lity(target, options, opener) {
|
606 |
+
if (!target.preventDefault) {
|
607 |
+
opener = $(opener);
|
608 |
+
} else {
|
609 |
+
target.preventDefault();
|
610 |
+
opener = $(this);
|
611 |
+
target = opener.data('lity-target') || opener.attr('href') || opener.attr('src');
|
612 |
+
}
|
613 |
+
|
614 |
+
var instance = new Lity(
|
615 |
+
target,
|
616 |
+
$.extend(
|
617 |
+
{},
|
618 |
+
opener.data('lity-options') || opener.data('lity'),
|
619 |
+
options
|
620 |
+
),
|
621 |
+
opener,
|
622 |
+
document.activeElement
|
623 |
+
);
|
624 |
+
|
625 |
+
if (!target.preventDefault) {
|
626 |
+
return instance;
|
627 |
+
}
|
628 |
+
}
|
629 |
+
|
630 |
+
lity.version = '2.4.1';
|
631 |
+
lity.options = $.proxy(settings, lity, _defaultOptions);
|
632 |
+
lity.handlers = $.proxy(settings, lity, _defaultOptions.handlers);
|
633 |
+
lity.current = currentInstance;
|
634 |
+
|
635 |
+
$(document).on('click.lity', '[data-lity]', lity);
|
636 |
+
|
637 |
+
return lity;
|
638 |
+
}));
|
js/lity.min.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
-
/*! Lity -
|
2 |
* http://sorgalla.com/lity/
|
3 |
-
* Copyright (c) 2015-
|
4 |
-
|
|
1 |
+
/*! Lity - v2.4.1 - 2020-04-26
|
2 |
* http://sorgalla.com/lity/
|
3 |
+
* Copyright (c) 2015-2020 Jan Sorgalla; Licensed MIT */
|
4 |
+
|
5 |
+
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return b(a,c)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=b(a,require("jquery")):a.lity=b(a,a.jQuery||a.Zepto)}("undefined"!=typeof window?window:this,function(a,b){"use strict";function c(a){var b=B();return N&&a.length?(a.one(N,b.resolve),setTimeout(b.resolve,500)):b.resolve(),b.promise()}function d(a,c,d){if(1===arguments.length)return b.extend({},a);if("string"==typeof c){if(void 0===d)return void 0===a[c]?null:a[c];a[c]=d}else b.extend(a,c);return this}function e(a){for(var b,c=decodeURI(a.split("#")[0]).split("&"),d={},e=0,f=c.length;e<f;e++)c[e]&&(b=c[e].split("="),d[b[0]]=b[1]);return d}function f(a,c){return a+(a.indexOf("?")>-1?"&":"?")+b.param(c)}function g(a,b){var c=a.indexOf("#");return-1===c?b:(c>0&&(a=a.substr(c)),b+a)}function h(a){return b('<span class="lity-error"></span>').append(a)}function i(a,c){var d=c.opener()&&c.opener().data("lity-desc")||"Image with no description",e=b('<img src="'+a+'" alt="'+d+'"/>'),f=B(),g=function(){f.reject(h("Failed loading image"))};return e.on("load",function(){if(0===this.naturalWidth)return g();f.resolve(e)}).on("error",g),f.promise()}function j(a,c){var d,e,f;try{d=b(a)}catch(a){return!1}return!!d.length&&(e=b('<i style="display:none !important"></i>'),f=d.hasClass("lity-hide"),c.element().one("lity:remove",function(){e.before(d).remove(),f&&!d.closest(".lity-content").length&&d.addClass("lity-hide")}),d.removeClass("lity-hide").after(e))}function k(a){var c=J.exec(a);return!!c&&o(g(a,f("https://www.youtube"+(c[2]||"")+".com/embed/"+c[4],b.extend({autoplay:1},e(c[5]||"")))))}function l(a){var c=K.exec(a);return!!c&&o(g(a,f("https://player.vimeo.com/video/"+c[3],b.extend({autoplay:1},e(c[4]||"")))))}function m(a){var c=M.exec(a);return!!c&&(0!==a.indexOf("http")&&(a="https:"+a),o(g(a,f("https://www.facebook.com/plugins/video.php?href="+a,b.extend({autoplay:1},e(c[4]||""))))))}function n(a){var b=L.exec(a);return!!b&&o(g(a,f("https://www.google."+b[3]+"/maps?"+b[6],{output:b[6].indexOf("layer=c")>0?"svembed":"embed"})))}function o(a){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen allow="autoplay; fullscreen" src="'+a+'"/></div>'}function p(){return z.documentElement.clientHeight?z.documentElement.clientHeight:Math.round(A.height())}function q(a){var b=v();b&&(27===a.keyCode&&b.options("esc")&&b.close(),9===a.keyCode&&r(a,b))}function r(a,b){var c=b.element().find(G),d=c.index(z.activeElement);a.shiftKey&&d<=0?(c.get(c.length-1).focus(),a.preventDefault()):a.shiftKey||d!==c.length-1||(c.get(0).focus(),a.preventDefault())}function s(){b.each(D,function(a,b){b.resize()})}function t(a){1===D.unshift(a)&&(C.addClass("lity-active"),A.on({resize:s,keydown:q})),b("body > *").not(a.element()).addClass("lity-hidden").each(function(){var a=b(this);void 0===a.data(F)&&a.data(F,a.attr(E)||null)}).attr(E,"true")}function u(a){var c;a.element().attr(E,"true"),1===D.length&&(C.removeClass("lity-active"),A.off({resize:s,keydown:q})),D=b.grep(D,function(b){return a!==b}),c=D.length?D[0].element():b(".lity-hidden"),c.removeClass("lity-hidden").each(function(){var a=b(this),c=a.data(F);c?a.attr(E,c):a.removeAttr(E),a.removeData(F)})}function v(){return 0===D.length?null:D[0]}function w(a,c,d,e){var f,g="inline",h=b.extend({},d);return e&&h[e]?(f=h[e](a,c),g=e):(b.each(["inline","iframe"],function(a,b){delete h[b],h[b]=d[b]}),b.each(h,function(b,d){return!d||(!(!d.test||d.test(a,c))||(f=d(a,c),!1!==f?(g=b,!1):void 0))})),{handler:g,content:f||""}}function x(a,e,f,g){function h(a){k=b(a).css("max-height",p()+"px"),j.find(".lity-loader").each(function(){var a=b(this);c(a).always(function(){a.remove()})}),j.removeClass("lity-loading").find(".lity-content").empty().append(k),m=!0,k.trigger("lity:ready",[l])}var i,j,k,l=this,m=!1,n=!1;e=b.extend({},H,e),j=b(e.template),l.element=function(){return j},l.opener=function(){return f},l.options=b.proxy(d,l,e),l.handlers=b.proxy(d,l,e.handlers),l.resize=function(){m&&!n&&k.css("max-height",p()+"px").trigger("lity:resize",[l])},l.close=function(){if(m&&!n){n=!0,u(l);var a=B();if(g&&(z.activeElement===j[0]||b.contains(j[0],z.activeElement)))try{g.focus()}catch(a){}return k.trigger("lity:close",[l]),j.removeClass("lity-opened").addClass("lity-closed"),c(k.add(j)).always(function(){k.trigger("lity:remove",[l]),j.remove(),j=void 0,a.resolve()}),a.promise()}},i=w(a,l,e.handlers,e.handler),j.attr(E,"false").addClass("lity-loading lity-opened lity-"+i.handler).appendTo("body").focus().on("click","[data-lity-close]",function(a){b(a.target).is("[data-lity-close]")&&l.close()}).trigger("lity:open",[l]),t(l),b.when(i.content).always(h)}function y(a,c,d){a.preventDefault?(a.preventDefault(),d=b(this),a=d.data("lity-target")||d.attr("href")||d.attr("src")):d=b(d);var e=new x(a,b.extend({},d.data("lity-options")||d.data("lity"),c),d,z.activeElement);if(!a.preventDefault)return e}var z=a.document,A=b(a),B=b.Deferred,C=b("html"),D=[],E="aria-hidden",F="lity-"+E,G='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',H={esc:!0,handler:null,handlers:{image:i,inline:j,youtube:k,vimeo:l,googlemaps:n,facebookvideo:m,iframe:o},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>×</button></div></div></div>'},I=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,J=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,K=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,L=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,M=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,N=function(){var a=z.createElement("div"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return b[c];return!1}();return i.test=function(a){return I.test(a)},y.version="2.4.1",y.options=b.proxy(d,y,H),y.handlers=b.proxy(d,y,H.handlers),y.current=v,b(z).on("click.lity","[data-lity]",y),y});
|
js/repeatable-custom-tabs-settings.js
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
jQuery( '.yikes_woo_delete_this_tab' ).click( function() {
|
17 |
|
18 |
// Confirm: Are you sure?
|
19 |
-
var continue_delete = confirm(
|
20 |
|
21 |
if ( continue_delete === false ) {
|
22 |
return;
|
@@ -45,6 +45,12 @@
|
|
45 |
return;
|
46 |
}
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
// Set up an array of IDs to delete
|
49 |
var tab_ids_to_delete = [];
|
50 |
|
@@ -110,10 +116,19 @@
|
|
110 |
var taxonomy = jQuery( this ).data( 'taxonomy' );
|
111 |
taxonomies[ taxonomy ] = {};
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
}
|
118 |
|
119 |
// CPTPRO: Grab global value
|
16 |
jQuery( '.yikes_woo_delete_this_tab' ).click( function() {
|
17 |
|
18 |
// Confirm: Are you sure?
|
19 |
+
var continue_delete = confirm( repeatable_custom_tabs_settings.confirm_delete_single_tab );
|
20 |
|
21 |
if ( continue_delete === false ) {
|
22 |
return;
|
45 |
return;
|
46 |
}
|
47 |
|
48 |
+
var continue_bulk_delete = confirm( repeatable_custom_tabs_settings.confirm_delete_bulk_tabs );
|
49 |
+
|
50 |
+
if ( continue_bulk_delete === false ) {
|
51 |
+
return;
|
52 |
+
}
|
53 |
+
|
54 |
// Set up an array of IDs to delete
|
55 |
var tab_ids_to_delete = [];
|
56 |
|
116 |
var taxonomy = jQuery( this ).data( 'taxonomy' );
|
117 |
taxonomies[ taxonomy ] = {};
|
118 |
|
119 |
+
console.log( taxonomy );
|
120 |
+
|
121 |
+
// fuck.
|
122 |
+
const data = jQuery( 'select[name="' + taxonomy + '[]"]' ).select2( 'data' );
|
123 |
+
|
124 |
+
for ( var key in data ) {
|
125 |
+
const obj = data[ key ];
|
126 |
+
console.log( obj.element );
|
127 |
+
taxonomies[ taxonomy ][ obj.id ] = obj.element.dataset['slug'];
|
128 |
+
}
|
129 |
+
|
130 |
+
} );
|
131 |
+
|
132 |
}
|
133 |
|
134 |
// CPTPRO: Grab global value
|
js/repeatable-custom-tabs-settings.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function yikes_woo_handle_saving_reusable_tab(e){yikes_woo_display_feedback_messages("#yikes_woo_delete_this_tab_"+e,"yikes_woo_tab_success_message",repeatable_custom_tabs_settings.loading_gif,{time:1e5});var _=jQuery("#yikes_woo_reusable_tab_title_"+e).val(),t=jQuery("#yikes_woo_reusable_tab_name_"+e).val(),s="",a={},o=!1;if(s="undefined"!=typeof tinymce&&jQuery("#wp-yikes_woo_reusable_tab_content_"+e+"-wrap").hasClass("tmce-active")?tinymce.get("yikes_woo_reusable_tab_content_"+e).getContent():jQuery("#yikes_woo_reusable_tab_content_"+e).val(),0!==_.length)if(0!==s.length){jQuery(".cptpro-taxonomies").length>0&&jQuery(".taxonomy-label").each(function(){var e=jQuery(this).data("taxonomy");a[e]={},jQuery('
|
1 |
+
function yikes_woo_handle_saving_reusable_tab(e){yikes_woo_display_feedback_messages("#yikes_woo_delete_this_tab_"+e,"yikes_woo_tab_success_message",repeatable_custom_tabs_settings.loading_gif,{time:1e5});var _=jQuery("#yikes_woo_reusable_tab_title_"+e).val(),t=jQuery("#yikes_woo_reusable_tab_name_"+e).val(),s="",a={},o=!1;if(s="undefined"!=typeof tinymce&&jQuery("#wp-yikes_woo_reusable_tab_content_"+e+"-wrap").hasClass("tmce-active")?tinymce.get("yikes_woo_reusable_tab_content_"+e).getContent():jQuery("#yikes_woo_reusable_tab_content_"+e).val(),0!==_.length)if(0!==s.length){jQuery(".cptpro-taxonomies").length>0&&jQuery(".taxonomy-label").each(function(){var e=jQuery(this).data("taxonomy");a[e]={},console.log(e);const _=jQuery('select[name="'+e+'[]"]').select2("data");for(var t in _){const s=_[t];console.log(s.element),a[e][s.id]=s.element.dataset.slug}}),jQuery(".global-section").length>0&&(o=jQuery("#global-checkbox").prop("checked"));var i={action:"yikes_woo_save_tab_as_reusable",tab_title:_,tab_content:s,tab_id:e,tab_name:t,taxonomies:a,global_tab:o,security_nonce:repeatable_custom_tabs_settings.save_tab_as_reusable_nonce};jQuery.post(repeatable_custom_tabs_settings.ajaxurl,i,function(t){void 0!==t.success&&!0===t.success?(void 0!==t.data&&void 0!==t.data.redirect&&!0===t.data.redirect&&(t.data.redirect_url,1)?location.href=t.data.redirect_url:(yikes_woo_display_feedback_messages("#yikes_woo_delete_this_tab_"+e,"yikes_woo_tab_success_message","Tab saved successfully.",{}),"1"===repeatable_custom_tabs_settings.is_cptpro_enabled&&"function"==typeof cptpro_show_products_using_this_tab&&cptpro_show_products_using_this_tab(e)),jQuery("#yikes_woo_tab_title_header").text(_)):void 0!==t.data&&void 0!==t.data.message?yikes_woo_display_feedback_messages("#yikes_woo_delete_this_tab_"+e,"yikes_woo_tab_error_message",t.data.message,{}):console.log(t)})}else yikes_woo_display_feedback_messages("#yikes_woo_delete_this_tab_"+e,"yikes_woo_tab_error_message","Please fill out the tab content before saving.",{});else yikes_woo_display_feedback_messages("#yikes_woo_delete_this_tab_"+e,"yikes_woo_tab_error_message","Please fill out the tab title before saving.",{})}function yikes_woo_handle_deleting_reusable_tab(e,_){"single"===_&&yikes_woo_display_feedback_messages("#yikes_woo_delete_this_tab_"+e,"yikes_woo_tab_success_message",repeatable_custom_tabs_settings.loading_gif,{time:1e5});var t={action:"yikes_woo_delete_reusable_tab_handler",tab_id:e,security_nonce:repeatable_custom_tabs_settings.delete_reusable_tab_nonce};jQuery.post(repeatable_custom_tabs_settings.ajaxurl,t,function(t){t.success?"bulk"===_?jQuery(".yikes_woo_bulk_delete_this_row").fadeOut("600",function(){jQuery(".yikes_woo_bulk_delete_this_row").remove()}):"single"===_?void 0!==t.data&&void 0!==t.data.redirect_url&&(location.href=t.data.redirect_url):jQuery("#yikes_woo_saved_tabs_row_"+e).fadeOut("600",function(){jQuery("#yikes_woo_saved_tabs_row_"+e).remove(),jQuery("#yikes_woo_delete_success_message").show()}):console.log(t)})}jQuery(document).ready(function(){jQuery(".yikes_woo_save_this_tab").click(function(){yikes_woo_handle_saving_reusable_tab(jQuery(this).data("tab-id"))}),jQuery(".yikes_woo_delete_this_tab").click(function(){if(!1!==confirm(repeatable_custom_tabs_settings.confirm_delete_single_tab)){var e=jQuery(this).data("tab-id");jQuery(this).hasClass("yikes_woo_delete_this_tab_single")?("new"===e&&(location.href=repeatable_custom_tabs_settings.tab_list_page_url),yikes_woo_handle_deleting_reusable_tab(e,"single")):yikes_woo_handle_deleting_reusable_tab(e,!1)}}),jQuery(".yikes_woo_handle_bulk_action").click(function(){if("delete"===jQuery("#bulk-action-selector-top").val()&&!1!==confirm(repeatable_custom_tabs_settings.confirm_delete_bulk_tabs)){var e=[];jQuery(".entry-bulk-action-checkbox").each(function(){!0===jQuery(this).is(":checked")&&(e.push(jQuery(this).val()),jQuery(this).parents("th").parents(".yikes_woo_saved_tabs_row").addClass("yikes_woo_bulk_delete_this_row"))}),yikes_woo_handle_deleting_reusable_tab(e,"bulk")}})});
|
js/repeatable-custom-tabs.js
CHANGED
@@ -1 +1,774 @@
|
|
1 |
-
/*
|
2 |
jQuery( '#_yikes_wc_apply_a_saved_tab' ).removeClass( 'disabled' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
jQuery( '#_yikes_wc_apply_a_saved_tab' ).removeClass( 'disabled' );
|
2 |
+
/*
|
3 |
+
* jQuery for repeatable woo commerce tabs (on product page)
|
4 |
+
* somewhat cool / very cool
|
5 |
+
* YIKES Inc. / Evan Herman / Kevin Utz
|
6 |
+
*/
|
7 |
+
jQuery(document).ready(function() {
|
8 |
+
// Disable fields on-load if necessary (delay 4 seconds to allow wp_editor to initialize)
|
9 |
+
setTimeout( function() {
|
10 |
+
yikes_woo_check_for_reusable_tabs_and_disable();
|
11 |
+
yikes_woo_set_editor_specific_styles();
|
12 |
+
}, 4000 );
|
13 |
+
|
14 |
+
// Slide down / slide up our how-to info
|
15 |
+
jQuery( '.yikes-tabs-how-to-toggle' ).on( 'click' , function( e ) {
|
16 |
+
yikes_woo_toggle_how_to();
|
17 |
+
});
|
18 |
+
|
19 |
+
// Add a new tab
|
20 |
+
jQuery( '#add_another_tab' ).click( function( e ) {
|
21 |
+
yikes_woo_add_another_tab( '' );
|
22 |
+
e.preventDefault();
|
23 |
+
});
|
24 |
+
|
25 |
+
// Remove tab
|
26 |
+
jQuery( 'body' ).on( 'click' , '.remove_this_tab' , function( e ) {
|
27 |
+
|
28 |
+
// We remove the last tab and apply that content
|
29 |
+
var clicked_button = jQuery( this );
|
30 |
+
var clicked_position = clicked_button.parents( '.button-holder' ).attr( 'alt' );
|
31 |
+
var last_post_position = jQuery( '#number_of_tabs' ).val();
|
32 |
+
var tab_title_prefix = '_yikes_wc_custom_repeatable_product_tabs_tab_title_';
|
33 |
+
var tab_content_prefix = '_yikes_wc_custom_repeatable_product_tabs_tab_content_';
|
34 |
+
|
35 |
+
// If we're removing the last tab already, skip this step
|
36 |
+
// If not, then swap all the content so the last tab is empty
|
37 |
+
if ( clicked_position !== last_post_position ) {
|
38 |
+
|
39 |
+
// Apply the content of the subsequent posts to the correct boxes
|
40 |
+
var x = parseInt( clicked_position );
|
41 |
+
while ( x < last_post_position ) {
|
42 |
+
var tab_title = '';
|
43 |
+
var tab_content = '';
|
44 |
+
var next_tab_number = x + 1;
|
45 |
+
|
46 |
+
// Switch tab title
|
47 |
+
tab_title = jQuery( '#' + tab_title_prefix + next_tab_number ).val();
|
48 |
+
jQuery( '#' + tab_title_prefix + x ).val( tab_title );
|
49 |
+
|
50 |
+
tab_content = yikes_woo_get_content_from_wysiwyg( tab_content_prefix + next_tab_number );
|
51 |
+
yikes_woo_set_content_for_wysiwyg( tab_content_prefix + x, tab_content );
|
52 |
+
|
53 |
+
// Check global / reusable tab stuff
|
54 |
+
|
55 |
+
// Switch hidden input fields
|
56 |
+
var next_saved_tab_action = jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + next_tab_number + '_action' ).val();
|
57 |
+
var next_saved_tab_id = jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + next_tab_number ).val();
|
58 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + x + '_action' ).val( next_saved_tab_action );
|
59 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + x ).val( next_saved_tab_id );
|
60 |
+
|
61 |
+
// Check / Uncheck checkbox
|
62 |
+
var next_override_checkbox = jQuery( '#_yikes_wc_override_reusable_tab_' + next_tab_number ).is( ':checked' );
|
63 |
+
jQuery( '#_yikes_wc_override_reusable_tab_' + x ).prop( 'checked', next_override_checkbox );
|
64 |
+
|
65 |
+
// Show / Hide checkbox container
|
66 |
+
if ( jQuery( '#_yikes_wc_override_reusable_tab_container_' + next_tab_number ).is( ':visible' ) ) {
|
67 |
+
jQuery( '#_yikes_wc_override_reusable_tab_container_' + x ).show();
|
68 |
+
} else {
|
69 |
+
jQuery( '#_yikes_wc_override_reusable_tab_container_' + x ).hide();
|
70 |
+
}
|
71 |
+
|
72 |
+
// Add / Remove disabled classes
|
73 |
+
if ( jQuery( '._yikes_wc_custom_repeatable_product_tabs_tab_title_' + next_tab_number + '_field' ).hasClass( 'yikes_woo_using_reusable_tab' ) ) {
|
74 |
+
yikes_woo_toggle_reusable_override_overlay( 'disable', x );
|
75 |
+
} else {
|
76 |
+
yikes_woo_toggle_reusable_override_overlay( 'enable', x );
|
77 |
+
}
|
78 |
+
|
79 |
+
x++;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
// Now remove the last tab (we always remove the last tab to prevent WYSIWYG errors)
|
84 |
+
|
85 |
+
// Set up our id and name vars
|
86 |
+
var tab_title_prefix = '_yikes_wc_custom_repeatable_product_tabs_tab_title_';
|
87 |
+
var tab_content_prefix = '_yikes_wc_custom_repeatable_product_tabs_tab_content_';
|
88 |
+
var removed_textarea_id = tab_content_prefix + last_post_position;
|
89 |
+
|
90 |
+
// Set up our DOM elements to be removed
|
91 |
+
var tab_reusable_container_to_remove = jQuery( '#_yikes_wc_override_reusable_tab_container_' + last_post_position );
|
92 |
+
var tab_title_to_remove = jQuery( '.' + tab_title_prefix + last_post_position + '_field' );
|
93 |
+
var tab_content_to_remove = jQuery( '.' + tab_content_prefix + last_post_position + '_field' );
|
94 |
+
var divider_to_remove = jQuery( '.yikes-woo-custom-tab-divider' ).last();
|
95 |
+
var button_holder_to_remove = jQuery( '.' + tab_content_prefix + last_post_position + '_field' ).next( '.button-holder' );
|
96 |
+
var number_of_tabs = parseInt( last_post_position ) - parseInt( 1 );
|
97 |
+
|
98 |
+
// Destroy our tinymce instance (this enables us to re-add it later if we need to)
|
99 |
+
if ( typeof( tinymce ) != 'undefined' ) {
|
100 |
+
tinymce.execCommand( 'mceRemoveEditor', false, removed_textarea_id );
|
101 |
+
}
|
102 |
+
|
103 |
+
// Remove the DOM elements
|
104 |
+
tab_reusable_container_to_remove.remove();
|
105 |
+
tab_title_to_remove.remove();
|
106 |
+
tab_content_to_remove.remove();
|
107 |
+
divider_to_remove.remove();
|
108 |
+
button_holder_to_remove.remove();
|
109 |
+
|
110 |
+
// Store the new number of tabs
|
111 |
+
jQuery( '#number_of_tabs' ).val( number_of_tabs );
|
112 |
+
|
113 |
+
// If we've removed all the tabs, let's add a class to the Add Another Tab button so we can style it
|
114 |
+
if ( parseInt( number_of_tabs ) === 0 ) {
|
115 |
+
jQuery( '#add_another_tab' ).parent( '.add_tabs_container' ).addClass( '_yikes_wc_add_tab_center' );
|
116 |
+
}
|
117 |
+
|
118 |
+
e.preventDefault();
|
119 |
+
});
|
120 |
+
|
121 |
+
// Move tab selected tab up, move above-tab below
|
122 |
+
jQuery( 'body' ).on( 'click' , '.move-tab-data-up' , function() {
|
123 |
+
var clicked_button = jQuery( this );
|
124 |
+
var clicked_position = clicked_button.parents( '.button-holder' ).attr( 'alt' );
|
125 |
+
|
126 |
+
// If we're trying to move the top tab, bail
|
127 |
+
if ( clicked_position == 1 ) {
|
128 |
+
return false;
|
129 |
+
}
|
130 |
+
|
131 |
+
// Set up name variables for succinctness
|
132 |
+
var tab_title_prefix = '_yikes_wc_custom_repeatable_product_tabs_tab_title_';
|
133 |
+
var tab_content_prefix = '_yikes_wc_custom_repeatable_product_tabs_tab_content_';
|
134 |
+
|
135 |
+
// Store our clicked element variables
|
136 |
+
var clicked_title = jQuery( '#' + tab_title_prefix + clicked_position ).val();
|
137 |
+
var clicked_content = yikes_woo_get_content_from_wysiwyg( tab_content_prefix + clicked_position );
|
138 |
+
|
139 |
+
// Store the previous element variables
|
140 |
+
var previous_position = parseInt( clicked_position ) - parseInt( 1 );
|
141 |
+
var previous_title = jQuery( '#' + tab_title_prefix + previous_position ).val();
|
142 |
+
var previous_content = yikes_woo_get_content_from_wysiwyg( tab_content_prefix + previous_position );
|
143 |
+
|
144 |
+
// Deal with saved tab disabled overlay classes
|
145 |
+
if ( jQuery( '.' + tab_title_prefix + clicked_position + '_field' ).hasClass( 'yikes_woo_using_reusable_tab' )
|
146 |
+
&& ! jQuery( '.' + tab_title_prefix + previous_position + '_field' ).hasClass( 'yikes_woo_using_reusable_tab' ) ) {
|
147 |
+
|
148 |
+
// Add overlay to the previous tab && remove it from the current one
|
149 |
+
yikes_woo_toggle_reusable_override_overlay( 'enable', clicked_position );
|
150 |
+
yikes_woo_toggle_reusable_override_overlay( 'disable', previous_position );
|
151 |
+
} else if ( jQuery( '.' + tab_title_prefix + previous_position + '_field' ).hasClass( 'yikes_woo_using_reusable_tab' )
|
152 |
+
&& ! jQuery( '.' + tab_title_prefix + clicked_position + '_field' ).hasClass( 'yikes_woo_using_reusable_tab' ) ) {
|
153 |
+
|
154 |
+
// Add overlay to the current tab && remove it from the previous one
|
155 |
+
yikes_woo_toggle_reusable_override_overlay( 'disable', clicked_position );
|
156 |
+
yikes_woo_toggle_reusable_override_overlay( 'enable', previous_position );
|
157 |
+
}
|
158 |
+
|
159 |
+
// Deal with saved tab hidden input fields
|
160 |
+
var clicked_saved_tab_action = jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + clicked_position + '_action' ).val();
|
161 |
+
var clicked_saved_tab_id = jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + clicked_position ).val();
|
162 |
+
var previous_saved_tab_action = jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + previous_position + '_action' ).val();
|
163 |
+
var previous_saved_tab_id = jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + previous_position ).val();
|
164 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + clicked_position + '_action' ).val( previous_saved_tab_action );
|
165 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + previous_position + '_action' ).val( clicked_saved_tab_action );
|
166 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + clicked_position ).val( previous_saved_tab_id );
|
167 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + previous_position ).val( clicked_saved_tab_id );
|
168 |
+
|
169 |
+
// Deal with saved tab checkbox
|
170 |
+
|
171 |
+
// Checked / Unchecked
|
172 |
+
if ( jQuery( '#_yikes_wc_override_reusable_tab_' + clicked_position ).is( ':checked' ) === true
|
173 |
+
&& jQuery( '#_yikes_wc_override_reusable_tab_' + previous_position ).is( ':checked' ) === false ) {
|
174 |
+
jQuery( '#_yikes_wc_override_reusable_tab_' + previous_position ).prop( 'checked', true );
|
175 |
+
jQuery( '#_yikes_wc_override_reusable_tab_' + clicked_position ).prop( 'checked', false );
|
176 |
+
} else if ( jQuery( '#_yikes_wc_override_reusable_tab_' + clicked_position ).is( ':checked' ) === false
|
177 |
+
&& jQuery( '#_yikes_wc_override_reusable_tab_' + previous_position ).is( ':checked' ) === true ) {
|
178 |
+
jQuery( '#_yikes_wc_override_reusable_tab_' + previous_position ).prop( 'checked', false );
|
179 |
+
jQuery( '#_yikes_wc_override_reusable_tab_' + clicked_position ).prop( 'checked', true );
|
180 |
+
}
|
181 |
+
|
182 |
+
// Shown / Hidden
|
183 |
+
if ( jQuery( '#_yikes_wc_override_reusable_tab_container_' + clicked_position ).is( ':visible' ) === true
|
184 |
+
&& jQuery( '#_yikes_wc_override_reusable_tab_container_' + previous_position ).is( ':visible' ) === false ) {
|
185 |
+
jQuery( '#_yikes_wc_override_reusable_tab_container_' + previous_position ).show();
|
186 |
+
jQuery( '#_yikes_wc_override_reusable_tab_container_' + clicked_position ).hide();
|
187 |
+
} else if ( jQuery( '#_yikes_wc_override_reusable_tab_container_' + clicked_position ).is( ':visible' ) === false
|
188 |
+
&& jQuery( '#_yikes_wc_override_reusable_tab_container_' + previous_position ).is( ':visible' ) === true ) {
|
189 |
+
jQuery( '#_yikes_wc_override_reusable_tab_container_' + previous_position ).hide();
|
190 |
+
jQuery( '#_yikes_wc_override_reusable_tab_container_' + clicked_position ).show();
|
191 |
+
}
|
192 |
+
|
193 |
+
// Swap title
|
194 |
+
jQuery( '#' + tab_title_prefix + clicked_position ).val( previous_title );
|
195 |
+
jQuery( '#' + tab_title_prefix + previous_position ).val( clicked_title );
|
196 |
+
|
197 |
+
// Swap content
|
198 |
+
yikes_woo_set_content_for_wysiwyg( tab_content_prefix + clicked_position, previous_content );
|
199 |
+
yikes_woo_set_content_for_wysiwyg( tab_content_prefix + previous_position, clicked_content );
|
200 |
+
});
|
201 |
+
|
202 |
+
// Move tab selected tab down, move below-tab above
|
203 |
+
jQuery( 'body' ).on( 'click' , '.move-tab-data-down' , function( ) {
|
204 |
+
var clicked_button = jQuery( this );
|
205 |
+
var clicked_position = clicked_button.parents( '.button-holder' ).attr( 'alt' );
|
206 |
+
var number_of_tabs = jQuery( '#number_of_tabs' ).val();
|
207 |
+
|
208 |
+
// If we're trying to move the bottom tab, bail
|
209 |
+
if ( clicked_position == number_of_tabs ) {
|
210 |
+
return false;
|
211 |
+
}
|
212 |
+
|
213 |
+
// Set up name variables for succinctness
|
214 |
+
var tab_title_prefix = '_yikes_wc_custom_repeatable_product_tabs_tab_title_';
|
215 |
+
var tab_content_prefix = '_yikes_wc_custom_repeatable_product_tabs_tab_content_';
|
216 |
+
|
217 |
+
// Store our clicked element variables
|
218 |
+
var clicked_title = jQuery( '#' + tab_title_prefix + clicked_position ).val();
|
219 |
+
var clicked_content = yikes_woo_get_content_from_wysiwyg( tab_content_prefix + clicked_position );
|
220 |
+
|
221 |
+
// Store the previous element variables
|
222 |
+
var next_position = parseInt( clicked_position ) + parseInt( 1 );
|
223 |
+
var next_title = jQuery( '#' + tab_title_prefix + next_position ).val();
|
224 |
+
var next_content = yikes_woo_get_content_from_wysiwyg( tab_content_prefix + next_position );
|
225 |
+
|
226 |
+
// Deal with saved tab disabled overlay classes
|
227 |
+
if ( jQuery( '.' + tab_title_prefix + clicked_position + '_field' ).hasClass( 'yikes_woo_using_reusable_tab' )
|
228 |
+
&& ! jQuery( '.' + tab_title_prefix + next_position + '_field' ).hasClass( 'yikes_woo_using_reusable_tab' ) ) {
|
229 |
+
|
230 |
+
// Add overlay to the next tab && remove it from the current one
|
231 |
+
yikes_woo_toggle_reusable_override_overlay( 'enable', clicked_position );
|
232 |
+
yikes_woo_toggle_reusable_override_overlay( 'disable', next_position );
|
233 |
+
} else if ( jQuery( '.' + tab_title_prefix + next_position + '_field' ).hasClass( 'yikes_woo_using_reusable_tab' )
|
234 |
+
&& ! jQuery( '.' + tab_title_prefix + clicked_position + '_field' ).hasClass( 'yikes_woo_using_reusable_tab' ) ) {
|
235 |
+
|
236 |
+
// Add overlay to the current tab && remove it from the next one
|
237 |
+
yikes_woo_toggle_reusable_override_overlay( 'disable', clicked_position );
|
238 |
+
yikes_woo_toggle_reusable_override_overlay( 'enable', next_position );
|
239 |
+
}
|
240 |
+
|
241 |
+
// Deal with saved tab hidden input fields
|
242 |
+
var clicked_saved_tab_action = jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + clicked_position + '_action' ).val();
|
243 |
+
var clicked_saved_tab_id = jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + clicked_position ).val();
|
244 |
+
var next_saved_tab_action = jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + next_position + '_action' ).val();
|
245 |
+
var next_saved_tab_id = jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + next_position ).val();
|
246 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + clicked_position + '_action' ).val( next_saved_tab_action );
|
247 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + next_position + '_action' ).val( clicked_saved_tab_action );
|
248 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + clicked_position ).val( next_saved_tab_id );
|
249 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + next_position ).val( clicked_saved_tab_id );
|
250 |
+
|
251 |
+
// Deal with saved tab checkbox
|
252 |
+
|
253 |
+
// Checked / Unchecked
|
254 |
+
if ( jQuery( '#_yikes_wc_override_reusable_tab_' + clicked_position ).is( ':checked' ) === true
|
255 |
+
&& jQuery( '#_yikes_wc_override_reusable_tab_' + next_position ).is( ':checked' ) === false ) {
|
256 |
+
jQuery( '#_yikes_wc_override_reusable_tab_' + next_position ).prop( 'checked', true );
|
257 |
+
jQuery( '#_yikes_wc_override_reusable_tab_' + clicked_position ).prop( 'checked', false );
|
258 |
+
} else if ( jQuery( '#_yikes_wc_override_reusable_tab_' + clicked_position ).is( ':checked' ) === false
|
259 |
+
&& jQuery( '#_yikes_wc_override_reusable_tab_' + next_position ).is( ':checked' ) === true ) {
|
260 |
+
jQuery( '#_yikes_wc_override_reusable_tab_' + next_position ).prop( 'checked', false );
|
261 |
+
jQuery( '#_yikes_wc_override_reusable_tab_' + clicked_position ).prop( 'checked', true );
|
262 |
+
}
|
263 |
+
|
264 |
+
// Shown / Hidden
|
265 |
+
if ( jQuery( '#_yikes_wc_override_reusable_tab_container_' + clicked_position ).is( ':visible' ) === true
|
266 |
+
&& jQuery( '#_yikes_wc_override_reusable_tab_container_' + next_position ).is( ':visible' ) === false ) {
|
267 |
+
jQuery( '#_yikes_wc_override_reusable_tab_container_' + next_position ).show();
|
268 |
+
jQuery( '#_yikes_wc_override_reusable_tab_container_' + clicked_position ).hide();
|
269 |
+
} else if ( jQuery( '#_yikes_wc_override_reusable_tab_container_' + clicked_position ).is( ':visible' ) === false
|
270 |
+
&& jQuery( '#_yikes_wc_override_reusable_tab_container_' + next_position ).is( ':visible' ) === true ) {
|
271 |
+
jQuery( '#_yikes_wc_override_reusable_tab_container_' + next_position ).hide();
|
272 |
+
jQuery( '#_yikes_wc_override_reusable_tab_container_' + clicked_position ).show();
|
273 |
+
}
|
274 |
+
|
275 |
+
|
276 |
+
// Swap titles
|
277 |
+
jQuery( '#' + tab_title_prefix + clicked_position ).val( next_title );
|
278 |
+
jQuery( '#' + tab_title_prefix + next_position ).val( clicked_title );
|
279 |
+
|
280 |
+
// Swap content
|
281 |
+
yikes_woo_set_content_for_wysiwyg( tab_content_prefix + clicked_position, next_content );
|
282 |
+
yikes_woo_set_content_for_wysiwyg( tab_content_prefix + next_position, clicked_content );
|
283 |
+
});
|
284 |
+
|
285 |
+
// Show pop-up box with reusable tabs
|
286 |
+
jQuery( 'body' ).on( 'click', '#_yikes_wc_apply_a_saved_tab', function() {
|
287 |
+
|
288 |
+
// Disable button to prevent double-clicks
|
289 |
+
if ( jQuery( this ).hasClass( 'disabled' ) ) {
|
290 |
+
return false;
|
291 |
+
}
|
292 |
+
jQuery( this ).addClass( 'disabled' );
|
293 |
+
|
294 |
+
yikes_woo_fetch_reusable_tabs( false, yikes_woo_handle_reusable_tabs );
|
295 |
+
});
|
296 |
+
|
297 |
+
// Handle clicking on a reusable tab in pop-up box
|
298 |
+
jQuery( 'body' ).on( 'click', '.yikes_woo_saved_tab_selector_lity', function() {
|
299 |
+
|
300 |
+
var saved_tab_number = jQuery( this ).data( 'saved-tab-number' );
|
301 |
+
var tab_id = jQuery( '#saved_tab_container_' + saved_tab_number ).data( 'tab-id' );
|
302 |
+
|
303 |
+
// Replace the lity box with a spinner because some tabs take a while to load
|
304 |
+
jQuery( '.lity-content' ).html( repeatable_custom_tabs.loading_gif ).css( 'width', '50px' ).children( 'img' ).css( 'margin-left', '37%' );
|
305 |
+
|
306 |
+
yikes_woo_fetch_reusable_tab( tab_id, yikes_woo_apply_resuable_tab );
|
307 |
+
});
|
308 |
+
|
309 |
+
// Handle clicking of the 'Override Saved Tab' checkbox
|
310 |
+
jQuery( 'body' ).on( 'click', '._yikes_wc_override_reusable_tab', function() {
|
311 |
+
var tab_number = jQuery( this ).data( 'tab-number' );
|
312 |
+
|
313 |
+
// Enable reusable tab override
|
314 |
+
if ( jQuery( this ).is( ':checked' ) === true ) {
|
315 |
+
|
316 |
+
// Show message explaining what this means
|
317 |
+
yikes_woo_display_feedback_messages( '_yikes_wc_override_reusable_tab_container_' + tab_number, '_yikes_wc_override_reusable_tab_message', 'If you override this tab it will no longer recognize global tab changes.', false );
|
318 |
+
|
319 |
+
// Set the hidden input field action to remove
|
320 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + tab_number + '_action' ).val( 'remove' );
|
321 |
+
|
322 |
+
// Remove disabled overlay
|
323 |
+
yikes_woo_toggle_reusable_override_overlay( 'enable', tab_number );
|
324 |
+
} else {
|
325 |
+
|
326 |
+
// Disable reusable tab override
|
327 |
+
|
328 |
+
// Set the hidden input field action to add
|
329 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + tab_number + '_action' ).val( 'add' );
|
330 |
+
|
331 |
+
// Add disabled overlay
|
332 |
+
yikes_woo_toggle_reusable_override_overlay( 'disable', tab_number );
|
333 |
+
}
|
334 |
+
});
|
335 |
+
|
336 |
+
// Handle two tabs with the same name by creating an overlay and showing an error message
|
337 |
+
// To-do: make this function more robust - it doesn't handle multiple duplicates well
|
338 |
+
jQuery( 'body' ).on( 'focusout', '.yikes_woo_tabs_title_field', function() {
|
339 |
+
|
340 |
+
var current_element = jQuery( this );
|
341 |
+
|
342 |
+
// If we have only one tab, don't bother
|
343 |
+
if ( parseInt( jQuery("#number_of_tabs").val() ) === 1 ) {
|
344 |
+
current_element.removeClass( '_yikes_wc_title_red_overlay' );
|
345 |
+
current_element.parent( '.form-field' ).children( '._yikes_wc_duplicate_title_message' ).remove();
|
346 |
+
return;
|
347 |
+
}
|
348 |
+
|
349 |
+
// Current element ID and value
|
350 |
+
var current_element_id = jQuery( this ).attr( 'id' );
|
351 |
+
var current_element_val = jQuery( this ).val();
|
352 |
+
|
353 |
+
// Flag indicating whether we detected a duplicate
|
354 |
+
var dupe_detected = false;
|
355 |
+
|
356 |
+
// Loop through each title element
|
357 |
+
jQuery( '.yikes_woo_tabs_title_field' ).each( function( index, element ) {
|
358 |
+
|
359 |
+
// Make sure we're not looking at the current element (this) and that the element has a value
|
360 |
+
if ( jQuery( element ).attr( 'id' ) != current_element_id && jQuery( element ).val() != '' ) {
|
361 |
+
|
362 |
+
// If another title is the same as this one, add red overlay & message. Else, remove red overlay and message.
|
363 |
+
if ( jQuery( element ).val() === current_element_val ) {
|
364 |
+
current_element.addClass( '_yikes_wc_title_red_overlay' );
|
365 |
+
current_element.parent( '.form-field' ).children( '._yikes_wc_duplicate_title_message' ).remove();
|
366 |
+
current_element.parent( '.form-field' ).prepend( '<span class="_yikes_wc_duplicate_title_message"> Please choose a unique tab name - duplicate tab names can create errors </span>');
|
367 |
+
dupe_detected = true;
|
368 |
+
} else {
|
369 |
+
|
370 |
+
}
|
371 |
+
}
|
372 |
+
});
|
373 |
+
|
374 |
+
// If we didn't find a dupe, remove the overlay classes && message
|
375 |
+
if ( dupe_detected === false ) {
|
376 |
+
jQuery( '._yikes_wc_title_red_overlay' ).removeClass( '_yikes_wc_title_red_overlay' );
|
377 |
+
jQuery( '._yikes_wc_duplicate_title_message' ).remove();
|
378 |
+
}
|
379 |
+
});
|
380 |
+
|
381 |
+
// If lity popup box is closed, remove 'disabled' class from _yikes_wc_apply_a_saved_tab
|
382 |
+
jQuery( 'body' ).on( 'lity:close', function() {
|
383 |
+
jQuery( '#_yikes_wc_apply_a_saved_tab' ).removeClass( 'disabled' );
|
384 |
+
});
|
385 |
+
|
386 |
+
// Handle saving all the tabs
|
387 |
+
jQuery( '#yikes_woo_save_custom_tabs' ).click( function() {
|
388 |
+
|
389 |
+
// If we've added the disabled class, do not go further
|
390 |
+
if ( jQuery( '#yikes_woo_save_custom_tabs' ).hasClass( 'disabled' ) === true ) {
|
391 |
+
return;
|
392 |
+
}
|
393 |
+
|
394 |
+
// Disable button until we get back from AJAX -- this helps prevent multiple button clicks
|
395 |
+
jQuery( '#yikes_woo_save_custom_tabs' ).addClass( 'disabled' );
|
396 |
+
|
397 |
+
// Fade out our feedback message...
|
398 |
+
jQuery( '#yikes_woo_ajax_save_feedback' ).fadeOut();
|
399 |
+
|
400 |
+
// Number of tabs
|
401 |
+
var number_of_tabs = jQuery( '#number_of_tabs' ).val();
|
402 |
+
|
403 |
+
// Create data object for AJAX call
|
404 |
+
var data = {
|
405 |
+
'action': 'yikes_woo_save_product_tabs',
|
406 |
+
'post_id': repeatable_custom_tabs.global_post_id,
|
407 |
+
'number_of_tabs': number_of_tabs,
|
408 |
+
'security_nonce': repeatable_custom_tabs.save_product_tabs_nonce
|
409 |
+
};
|
410 |
+
|
411 |
+
// We're going to collect all the data and send it to the server as if it were a form submission
|
412 |
+
// So data object should have all the relevant fields like: field_name => field_value
|
413 |
+
for ( var ii = 1; ii <= number_of_tabs; ii++ ) {
|
414 |
+
|
415 |
+
// Title
|
416 |
+
data['_yikes_wc_custom_repeatable_product_tabs_tab_title_' + ii] = jQuery( '#_yikes_wc_custom_repeatable_product_tabs_tab_title_' + ii ).val();
|
417 |
+
|
418 |
+
// Content
|
419 |
+
data['_yikes_wc_custom_repeatable_product_tabs_tab_content_' + ii] = yikes_woo_get_content_from_wysiwyg( '_yikes_wc_custom_repeatable_product_tabs_tab_content_' + ii );
|
420 |
+
|
421 |
+
// Reusable tab id
|
422 |
+
data['_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + ii] = jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + ii ).val();
|
423 |
+
|
424 |
+
// Reusable tab action
|
425 |
+
data['_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + ii + '_action'] = jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + ii + '_action' ).val();
|
426 |
+
}
|
427 |
+
|
428 |
+
jQuery.post( repeatable_custom_tabs.ajaxurl, data, function( response ) {
|
429 |
+
var feedback_class = '';
|
430 |
+
if ( typeof( response.success ) !== 'undefined' ) {
|
431 |
+
if ( response.success === true ) {
|
432 |
+
feedback_message_class = 'yikes_woo_save_success';
|
433 |
+
} else if ( response.success === false ) {
|
434 |
+
feedback_message_class = 'yikes_woo_save_failure';
|
435 |
+
}
|
436 |
+
}
|
437 |
+
if ( typeof( response.data ) !== 'undefined' && typeof( response.data.message ) !== 'undefined' ) {
|
438 |
+
jQuery( '#yikes_woo_ajax_save_feedback' ).removeClass().addClass( feedback_message_class ).text( response.data.message ).fadeIn().delay( '2000' ).fadeOut();
|
439 |
+
}
|
440 |
+
|
441 |
+
// Remove disabled class
|
442 |
+
jQuery( '#yikes_woo_save_custom_tabs' ).removeClass( 'disabled' );
|
443 |
+
});
|
444 |
+
|
445 |
+
});
|
446 |
+
}); // End document.ready
|
447 |
+
|
448 |
+
|
449 |
+
function yikes_woo_apply_resuable_tab( response ) {
|
450 |
+
|
451 |
+
var tab_data = response.data;
|
452 |
+
|
453 |
+
// Store some necessary variables
|
454 |
+
var tab_title_prefix = '_yikes_wc_custom_repeatable_product_tabs_tab_title_';
|
455 |
+
var saved_tab_title = tab_data.tab_title;
|
456 |
+
var saved_tab_id = tab_data.tab_id;
|
457 |
+
var saved_tab_content = tab_data.tab_content;
|
458 |
+
|
459 |
+
// Create another tab
|
460 |
+
yikes_woo_add_another_tab( saved_tab_content );
|
461 |
+
|
462 |
+
// Tab number of our created tab will be equal to the number of tabs
|
463 |
+
var tab_number = jQuery( '#number_of_tabs' ).val();
|
464 |
+
|
465 |
+
// Apply variables
|
466 |
+
|
467 |
+
// Title
|
468 |
+
jQuery( '#' + tab_title_prefix + tab_number ).val( saved_tab_title );
|
469 |
+
|
470 |
+
// Hidden input fields for (1) tab_id (2) action (add / remove / none)
|
471 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + tab_number + '_action' ).val( 'add' );
|
472 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + tab_number ).val( saved_tab_id );
|
473 |
+
|
474 |
+
|
475 |
+
// Check if our tinymce instance has been initialized yet
|
476 |
+
if ( jQuery( '#qt__yikes_wc_custom_repeatable_product_tabs_tab_content_' + tab_number + '_toolbar' ).length > 0 ) {
|
477 |
+
|
478 |
+
// Add a class to the items to indicate this is a reusable tab
|
479 |
+
yikes_woo_toggle_reusable_override_overlay( 'disable', tab_number )
|
480 |
+
} else {
|
481 |
+
|
482 |
+
// If our tinymce instance is not initialized, let's set a flag so we know to do it
|
483 |
+
jQuery( '#' + tab_title_prefix + tab_number ).addClass( 'yikes_woo_disable_this_tab' );
|
484 |
+
}
|
485 |
+
|
486 |
+
// Show checkbox to let the user override the reusable tab status
|
487 |
+
jQuery( '#_yikes_wc_override_reusable_tab_container_' + tab_number ).show();
|
488 |
+
}
|
489 |
+
|
490 |
+
function yikes_woo_fetch_reusable_tab( tab_id, callback_function ) {
|
491 |
+
|
492 |
+
// Create data object for AJAX call
|
493 |
+
var data = {
|
494 |
+
'action': 'yikes_woo_fetch_reusable_tab',
|
495 |
+
'tab_id': tab_id,
|
496 |
+
'security_nonce': repeatable_custom_tabs.fetch_reusable_tab_nonce
|
497 |
+
};
|
498 |
+
|
499 |
+
// AJAX
|
500 |
+
jQuery.post( repeatable_custom_tabs.ajaxurl, data, function( response ) {
|
501 |
+
|
502 |
+
// Close the lity modal
|
503 |
+
global_lity.close();
|
504 |
+
|
505 |
+
callback_function( response );
|
506 |
+
});
|
507 |
+
|
508 |
+
}
|
509 |
+
|
510 |
+
function yikes_woo_fetch_reusable_tabs( fetch_tab_content, callback_function ) {
|
511 |
+
|
512 |
+
// Create data object for AJAX call
|
513 |
+
var data = {
|
514 |
+
'action': 'yikes_woo_fetch_reusable_tabs',
|
515 |
+
'fetch_tab_content': fetch_tab_content,
|
516 |
+
'security_nonce': repeatable_custom_tabs.fetch_reusable_tabs_nonce
|
517 |
+
};
|
518 |
+
|
519 |
+
// AJAX
|
520 |
+
jQuery.post( repeatable_custom_tabs.ajaxurl, data, function( response ) {
|
521 |
+
callback_function( response );
|
522 |
+
});
|
523 |
+
|
524 |
+
}
|
525 |
+
|
526 |
+
/**
|
527 |
+
* @summary Fetch the reusable tabs and display them in a lity box
|
528 |
+
*
|
529 |
+
* @since 1.5
|
530 |
+
*
|
531 |
+
*/
|
532 |
+
function yikes_woo_handle_reusable_tabs( fetch_tabs_response ) {
|
533 |
+
|
534 |
+
if ( typeof( fetch_tabs_response.success ) !== 'undefined' && fetch_tabs_response.success === true ) {
|
535 |
+
|
536 |
+
// If we have a message, no tabs were found
|
537 |
+
if ( typeof( fetch_tabs_response.data ) !== 'undefined' && typeof( fetch_tabs_response.data.message ) !== 'undefined' ) {
|
538 |
+
jQuery( '#yikes_woo_ajax_save_feedback' ).removeClass().addClass( 'yikes_woo_save_success' ).text( fetch_tabs_response.data.message ).fadeIn().delay( '2000' ).fadeOut();
|
539 |
+
} else {
|
540 |
+
// Save response data
|
541 |
+
var saved_tabs = JSON.parse( fetch_tabs_response.data );
|
542 |
+
|
543 |
+
// Create HTML from response data
|
544 |
+
lity_html = create_lity_manage_reusable_tabs_html( saved_tabs );
|
545 |
+
|
546 |
+
// Display lity box
|
547 |
+
global_lity = lity( lity_html, { handler: 'inline' } );
|
548 |
+
}
|
549 |
+
|
550 |
+
} else if ( typeof( fetch_tabs_response.success ) !== 'undefined' && fetch_tabs_response.success === false ) {
|
551 |
+
|
552 |
+
// If we failed, log it
|
553 |
+
console.log( response );
|
554 |
+
}
|
555 |
+
|
556 |
+
// Re-enable 'Apply a Saved Tab' Button
|
557 |
+
jQuery( '#_yikes_wc_apply_a_saved_tab' ).removeClass( 'disabled' );
|
558 |
+
}
|
559 |
+
|
560 |
+
/**
|
561 |
+
* @summary Create HTML for selected a reusable tab
|
562 |
+
*
|
563 |
+
* @since 1.5
|
564 |
+
*
|
565 |
+
* @param object | tabs | JSON object w/ tab title, content, and ID
|
566 |
+
*
|
567 |
+
* @return string lity_html
|
568 |
+
*/
|
569 |
+
function create_lity_manage_reusable_tabs_html( tabs ) {
|
570 |
+
var ii = 1;
|
571 |
+
var lity_html = '';
|
572 |
+
|
573 |
+
lity_html += '<div class="display_saved_tabs_lity">';
|
574 |
+
lity_html += '<div class="yikes_wc_lity_header">';
|
575 |
+
lity_html += '<span> Choose a Tab </span>';
|
576 |
+
lity_html += '</div>';
|
577 |
+
|
578 |
+
jQuery.each( tabs, function( index, tab_data ) {
|
579 |
+
lity_html += '<div id="saved_tab_container_' + ii + '" data-tab-id="' + tab_data.tab_id + '">';
|
580 |
+
lity_html += '<div class="yikes_wc_lity_col_title">';
|
581 |
+
lity_html += '<span class="yikes_woo_saved_tab_title_lity" id="yikes_woo_saved_tab_title_' + ii + '">';
|
582 |
+
lity_html += tab_data.tab_title;
|
583 |
+
lity_html += '</span>';
|
584 |
+
lity_html += '<span class="yikes_woo_saved_tab_name_lity" id="yikes_woo_saved_tab_name_' + ii + '">';
|
585 |
+
lity_html += typeof tab_data.tab_name !== 'undefined' ? ' - ' + tab_data.tab_name : '';
|
586 |
+
lity_html += '</span>';
|
587 |
+
lity_html += '</div>';
|
588 |
+
lity_html += '<div class="yikes_wc_lity_col_select">';
|
589 |
+
lity_html += '<span class="yikes_woo_saved_tab_selector_lity dashicons dashicons-plus-alt" data-saved-tab-number="' + ii + '"></span>';
|
590 |
+
lity_html += '</div>';
|
591 |
+
lity_html += '</div>';
|
592 |
+
|
593 |
+
ii++;
|
594 |
+
});
|
595 |
+
|
596 |
+
lity_html += '</div>';
|
597 |
+
|
598 |
+
return lity_html;
|
599 |
+
}
|
600 |
+
|
601 |
+
/**
|
602 |
+
* @summary Add / Remove an overlay to a tab
|
603 |
+
*
|
604 |
+
* @since 1.5
|
605 |
+
*
|
606 |
+
* @param string | toggle_enable | 'disable' to add overlay, 'enable' to remove
|
607 |
+
* @param string | tab_number | the uniquely identifying suffix of the current tab
|
608 |
+
*
|
609 |
+
*/
|
610 |
+
function yikes_woo_toggle_reusable_override_overlay( toggle_enable, tab_number ) {
|
611 |
+
if ( toggle_enable === 'disable' ) {
|
612 |
+
|
613 |
+
// Page-loaded content box (WYSIWYG) fields
|
614 |
+
|
615 |
+
// Text tab toolbar
|
616 |
+
jQuery( '#qt__yikes_wc_custom_repeatable_product_tabs_tab_content_' + tab_number + '_toolbar' ).addClass( 'yikes_woo_using_reusable_tab' );
|
617 |
+
|
618 |
+
// Text tab textarea
|
619 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_tab_content_' + tab_number ).addClass( 'yikes_woo_using_reusable_tab' );
|
620 |
+
|
621 |
+
// Add Media button
|
622 |
+
jQuery( '#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_' + tab_number + '-media-buttons' ).addClass( 'yikes_woo_using_reusable_tab' );
|
623 |
+
|
624 |
+
// Visual tab toolbar
|
625 |
+
jQuery( '#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_' + tab_number + '-editor-container' )
|
626 |
+
.children( '.mce-container' ).children( '.mce-container-body' ).children( '.mce-toolbar-grp').addClass( 'yikes_woo_using_reusable_tab' );
|
627 |
+
|
628 |
+
// Visual textarea
|
629 |
+
jQuery( '#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_' + tab_number + '-editor-container' )
|
630 |
+
.children( '.mce-tinymce' ).children( '.mce-container-body' ).children( '.mce-edit-area').addClass( 'yikes_woo_using_reusable_tab' );
|
631 |
+
|
632 |
+
// Title
|
633 |
+
jQuery( '._yikes_wc_custom_repeatable_product_tabs_tab_title_' + tab_number + '_field' ).addClass( 'yikes_woo_using_reusable_tab' );
|
634 |
+
|
635 |
+
} else {
|
636 |
+
|
637 |
+
// Text tab toolbar
|
638 |
+
jQuery( '#qt__yikes_wc_custom_repeatable_product_tabs_tab_content_' + tab_number + '_toolbar' ).removeClass( 'yikes_woo_using_reusable_tab' );
|
639 |
+
|
640 |
+
// Text tab textarea
|
641 |
+
jQuery( '#_yikes_wc_custom_repeatable_product_tabs_tab_content_' + tab_number ).removeClass( 'yikes_woo_using_reusable_tab' );
|
642 |
+
|
643 |
+
// Add Media button
|
644 |
+
jQuery( '#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_' + tab_number + '-media-buttons' ).removeClass( 'yikes_woo_using_reusable_tab' );
|
645 |
+
|
646 |
+
// Visual tab toolbar
|
647 |
+
jQuery( '#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_' + tab_number + '-editor-container' )
|
648 |
+
.children( '.mce-container' ).children( '.mce-container-body' ).children( '.mce-toolbar-grp').removeClass( 'yikes_woo_using_reusable_tab' );
|
649 |
+
|
650 |
+
// Visual textarea
|
651 |
+
jQuery( '#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_' + tab_number + '-editor-container' )
|
652 |
+
.children( '.mce-tinymce' ).children( '.mce-container-body' ).children( '.mce-edit-area').removeClass( 'yikes_woo_using_reusable_tab' );
|
653 |
+
|
654 |
+
// Title
|
655 |
+
jQuery( '._yikes_wc_custom_repeatable_product_tabs_tab_title_' + tab_number + '_field' ).removeClass( 'yikes_woo_using_reusable_tab' );
|
656 |
+
|
657 |
+
}
|
658 |
+
}
|
659 |
+
|
660 |
+
/**
|
661 |
+
* @summary Run through each tab, check if reusable and add disabled overlay
|
662 |
+
*
|
663 |
+
* @since 1.5
|
664 |
+
*
|
665 |
+
*/
|
666 |
+
function yikes_woo_check_for_reusable_tabs_and_disable() {
|
667 |
+
|
668 |
+
// If we find the reusable-tab data attribute on .yikes_wc_override_reusable_tab_container, we're dealing with a reusable tab so disable relevant fields
|
669 |
+
jQuery( '.yikes_wc_override_reusable_tab_container' ).each( function() {
|
670 |
+
if ( jQuery( this ).data( 'reusable-tab' ) == true ) {
|
671 |
+
var tab_number = jQuery( this ).children( '._yikes_wc_override_reusable_tab' ).data( 'tab-number' );
|
672 |
+
yikes_woo_toggle_reusable_override_overlay( 'disable', tab_number );
|
673 |
+
}
|
674 |
+
});
|
675 |
+
}
|
676 |
+
|
677 |
+
/**
|
678 |
+
* Duplicate and transform hidden HTML to create a new tab
|
679 |
+
*
|
680 |
+
* @param string | tab_content | content to pre-populate the editor with
|
681 |
+
*/
|
682 |
+
function yikes_woo_add_another_tab( tab_content ) {
|
683 |
+
// Disable buttons/arrows to help prevent wp_editor errors
|
684 |
+
yikes_woo_toggle_controls( 'disable' );
|
685 |
+
|
686 |
+
// Remove our ._yikes_wc_add_tab_center_new class from the Save button (this is added when there are no products on-load)
|
687 |
+
jQuery( '._yikes_wc_add_tab_center_new' ).removeClass( '_yikes_wc_add_tab_center_new' );
|
688 |
+
|
689 |
+
// Remove our center class
|
690 |
+
jQuery( '#add_another_tab' ).parent( '.add_tabs_container' ).removeClass( '_yikes_wc_add_tab_center' );
|
691 |
+
|
692 |
+
// Setup variables for use in generating a new tab
|
693 |
+
var clone_container = jQuery( '#duplicate_this_row' );
|
694 |
+
var new_count = parseInt( jQuery( '#number_of_tabs' ).val() ) + parseInt( 1 ); /* get new number of cloned element */
|
695 |
+
// var remove_tab_button = jQuery( '#duplicate_this_row .remove_this_tab' );
|
696 |
+
var move_tab_content_buttons = jQuery( '#duplicate_this_row .button-holder' );
|
697 |
+
var textarea_id = '_yikes_wc_custom_repeatable_product_tabs_tab_content_' + new_count;
|
698 |
+
var title_id = '_yikes_wc_custom_repeatable_product_tabs_tab_title_' + new_count;
|
699 |
+
|
700 |
+
// Clone our hidden elements and change some classes and attributes
|
701 |
+
clone_container.children( '.hidden_duplicator_row_title_field, .hidden_duplicator_row_content_field, .hidden_duplicator_row_button_holder' ).each( function() {
|
702 |
+
jQuery(this).clone().insertBefore('#duplicate_this_row').removeClass( 'hidden_duplicator_row_title_field hidden_duplicator_row_content_field hidden_duplicator_row_button_holder' ).addClass( 'new_duplicate_row' );
|
703 |
+
}).promise().done( function() {
|
704 |
+
|
705 |
+
// Change title classes
|
706 |
+
jQuery( '.new_duplicate_row' ).find( 'input' ).each( function() {
|
707 |
+
if ( jQuery( this ).is( 'input[name="hidden_duplicator_row_title"]' ) ) {
|
708 |
+
jQuery( this ).attr( 'name' , title_id ).removeClass( 'yikes_woo_tabs_title_field_duplicate' ).attr( 'id' , title_id ).parents( 'p' ).addClass( title_id + '_field' )
|
709 |
+
.removeClass( 'hidden_duplicator_row_title_field' ).find( 'label' ).removeAttr( 'for' ).attr( 'for', title_id + '_field' );
|
710 |
+
}
|
711 |
+
});
|
712 |
+
|
713 |
+
// Change content classes
|
714 |
+
jQuery( '.new_duplicate_row' ).find( 'textarea' ).each( function() {
|
715 |
+
if ( jQuery( this ).is( 'textarea[name="hidden_duplicator_row_content"]' ) ) {
|
716 |
+
jQuery( this ).attr( 'name' , textarea_id ).attr( 'id' , textarea_id ).parent( 'div' ).addClass( textarea_id + '_field' ).removeClass( 'hidden_duplicator_row_content_field' )
|
717 |
+
.find( 'label' ).removeAttr( 'for' ).attr( 'for', textarea_id + '_field' );
|
718 |
+
}
|
719 |
+
});
|
720 |
+
|
721 |
+
// Change button holder classes
|
722 |
+
jQuery( '.new_duplicate_row' ).find( '.button-holder' ).attr( 'alt', new_count );
|
723 |
+
jQuery( '.new_duplicate_row' ).find( '.yikes_wc_override_reusable_tab_container' ).attr( 'id', '_yikes_wc_override_reusable_tab_container_' + new_count );
|
724 |
+
jQuery( '.new_duplicate_row' ).find( '.button-holder' ).css( 'width', '19.25%' ).unwrap(); // fix weird spacing issue on cloned button holder.
|
725 |
+
|
726 |
+
// Set the new number of tabs value
|
727 |
+
jQuery( '#number_of_tabs' ).val( new_count );
|
728 |
+
|
729 |
+
// Append the divider between tabs
|
730 |
+
if ( new_count > 1 ) {
|
731 |
+
jQuery( '.new_duplicate_row' ).first().before( '<div class="yikes-woo-custom-tab-divider"></div>' );
|
732 |
+
}
|
733 |
+
});
|
734 |
+
|
735 |
+
// Change reusable/saved tab classes
|
736 |
+
var reusable_tab_container = jQuery( '.last-button-holder' ).children( '.yikes_wc_override_reusable_tab_container' );
|
737 |
+
|
738 |
+
reusable_tab_container.removeClass( '_yikes_wc_override_reusable_tab_container_duplicate' ).children( '#_yikes_wc_override_reusable_tab_duplicate' )
|
739 |
+
.attr( 'id', '_yikes_wc_override_reusable_tab_' + new_count ).attr( 'data-tab-number', new_count );
|
740 |
+
// Change override label
|
741 |
+
reusable_tab_container.children( '._yikes_wc_override_reusable_tab_label_duplicate' ).attr( 'for', '_yikes_wc_override_reusable_tab_' + new_count ).attr( 'id', '_yikes_wc_override_reusable_tab_label_' + new_count )
|
742 |
+
.removeClass( '_yikes_wc_override_reusable_tab_label_duplicate' ).addClass( '_yikes_wc_override_reusable_tab_label' );
|
743 |
+
// Change hidden input action field
|
744 |
+
reusable_tab_container.children( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_action_duplicate' )
|
745 |
+
.attr( 'name', '_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + new_count + '_action' )
|
746 |
+
.attr( 'id', '_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + new_count + '_action' );
|
747 |
+
// Change hidden input tab_id field
|
748 |
+
reusable_tab_container.children( '#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_duplicate' )
|
749 |
+
.attr( 'name', '_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + new_count )
|
750 |
+
.attr( 'id', '_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_' + new_count );
|
751 |
+
|
752 |
+
// Change container
|
753 |
+
jQuery( '#_yikes_wc_override_reusable_tab_container_duplicate' ).first().attr( 'id', '_yikes_wc_override_reusable_tab_container_' + new_count );
|
754 |
+
|
755 |
+
// Retrieve wp_editor HTML, the method to retrieve is dependent on WP version because WP4.8 introduced some new editor methods
|
756 |
+
if ( parseInt( repeatable_custom_tabs.wp_version_four_eight ) === 1 ) {
|
757 |
+
yikes_woo_get_wp_editor_foureight( textarea_id, true, tab_content );
|
758 |
+
} else {
|
759 |
+
|
760 |
+
// Add a loading gif until AJAX returns
|
761 |
+
jQuery( '.' + textarea_id + '_field' ).html( repeatable_custom_tabs.loading_gif );
|
762 |
+
|
763 |
+
yikes_woo_get_wp_editor_ajax( textarea_id, true, tab_content );
|
764 |
+
}
|
765 |
+
|
766 |
+
// Remove some classes
|
767 |
+
jQuery( '.last-button-holder' ).removeClass( 'last-button-holder' );
|
768 |
+
jQuery( '.new_duplicate_row' ).removeClass( 'new_duplicate_row' );
|
769 |
+
}
|
770 |
+
|
771 |
+
function yikes_woo_set_editor_specific_styles() {
|
772 |
+
jQuery( 'textarea[name^="_yikes_wc_custom_repeatable_product_tabs_tab_content_"]' ).each( function() {
|
773 |
+
jQuery( this ).addClass( 'yikes_woo_custom_editor_styles' );
|
774 |
+
});
|
775 |
+
}
|
js/repeatable-custom-tabs.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function yikes_woo_apply_resuable_tab(e){var _=e.data,a="_yikes_wc_custom_repeatable_product_tabs_tab_title_",t=_.tab_title,s=_.tab_id;yikes_woo_add_another_tab(_.tab_content);var r=jQuery("#number_of_tabs").val();jQuery("#"+a+r).val(t),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r+"_action").val("add"),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r).val(s),jQuery("#qt__yikes_wc_custom_repeatable_product_tabs_tab_content_"+r+"_toolbar").length>0?yikes_woo_toggle_reusable_override_overlay("disable",r):jQuery("#"+a+r).addClass("yikes_woo_disable_this_tab"),jQuery("#_yikes_wc_override_reusable_tab_container_"+r).show()}function yikes_woo_fetch_reusable_tab(e,_){var a={action:"yikes_woo_fetch_reusable_tab",tab_id:e,security_nonce:repeatable_custom_tabs.fetch_reusable_tab_nonce};jQuery.post(repeatable_custom_tabs.ajaxurl,a,function(e){global_lity.close(),_(e)})}function yikes_woo_fetch_reusable_tabs(e,_){var a={action:"yikes_woo_fetch_reusable_tabs",fetch_tab_content:e,security_nonce:repeatable_custom_tabs.fetch_reusable_tabs_nonce};jQuery.post(repeatable_custom_tabs.ajaxurl,a,function(e){_(e)})}function yikes_woo_handle_reusable_tabs(e){if(void 0!==e.success&&!0===e.success)if(void 0!==e.data&&void 0!==e.data.message)jQuery("#yikes_woo_ajax_save_feedback").removeClass().addClass("yikes_woo_save_success").text(e.data.message).fadeIn().delay("2000").fadeOut();else{var _=JSON.parse(e.data);lity_html=create_lity_manage_reusable_tabs_html(_),global_lity=lity(lity_html,{handler:"inline"})}else void 0!==e.success&&!1===e.success&&console.log(response);jQuery("#_yikes_wc_apply_a_saved_tab").removeClass("disabled")}function create_lity_manage_reusable_tabs_html(e){var _=1,a="";return a+='<div class="display_saved_tabs_lity">',a+='<div class="yikes_wc_lity_header">',a+="<span> Choose a Tab </span>",a+="</div>",jQuery.each(e,function(e,t){a+='<div id="saved_tab_container_'+_+'" data-tab-id="'+t.tab_id+'">',a+='<div class="yikes_wc_lity_col_title">',a+='<span class="yikes_woo_saved_tab_title_lity" id="yikes_woo_saved_tab_title_'+_+'">',a+=t.tab_title,a+="</span>",a+='<span class="yikes_woo_saved_tab_name_lity" id="yikes_woo_saved_tab_name_'+_+'">',a+=void 0!==t.tab_name?" - "+t.tab_name:"",a+="</span>",a+="</div>",a+='<div class="yikes_wc_lity_col_select">',a+='<span class="yikes_woo_saved_tab_selector_lity dashicons dashicons-plus-alt" data-saved-tab-number="'+_+'"></span>',a+="</div>",a+="</div>",_++}),a+="</div>"}function yikes_woo_toggle_reusable_override_overlay(e,_){"disable"===e?(jQuery("#qt__yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"_toolbar").addClass("yikes_woo_using_reusable_tab"),jQuery("#_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_).addClass("yikes_woo_using_reusable_tab"),jQuery("#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"-media-buttons").addClass("yikes_woo_using_reusable_tab"),jQuery("#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"-editor-container").children(".mce-container").children(".mce-container-body").children(".mce-toolbar-grp").addClass("yikes_woo_using_reusable_tab"),jQuery("#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"-editor-container").children(".mce-tinymce").children(".mce-container-body").children(".mce-edit-area").addClass("yikes_woo_using_reusable_tab"),jQuery("._yikes_wc_custom_repeatable_product_tabs_tab_title_"+_+"_field").addClass("yikes_woo_using_reusable_tab")):(jQuery("#qt__yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"_toolbar").removeClass("yikes_woo_using_reusable_tab"),jQuery("#_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_).removeClass("yikes_woo_using_reusable_tab"),jQuery("#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"-media-buttons").removeClass("yikes_woo_using_reusable_tab"),jQuery("#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"-editor-container").children(".mce-container").children(".mce-container-body").children(".mce-toolbar-grp").removeClass("yikes_woo_using_reusable_tab"),jQuery("#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"-editor-container").children(".mce-tinymce").children(".mce-container-body").children(".mce-edit-area").removeClass("yikes_woo_using_reusable_tab"),jQuery("._yikes_wc_custom_repeatable_product_tabs_tab_title_"+_+"_field").removeClass("yikes_woo_using_reusable_tab"))}function yikes_woo_check_for_reusable_tabs_and_disable(){jQuery(".yikes_wc_override_reusable_tab_container").each(function(){1==jQuery(this).data("reusable-tab")&&yikes_woo_toggle_reusable_override_overlay("disable",jQuery(this).children("._yikes_wc_override_reusable_tab").data("tab-number"))})}function yikes_woo_add_another_tab(e){yikes_woo_toggle_controls("disable"),jQuery("._yikes_wc_add_tab_center_new").removeClass("_yikes_wc_add_tab_center_new"),jQuery("#add_another_tab").parent(".add_tabs_container").removeClass("_yikes_wc_add_tab_center");var _=jQuery("#duplicate_this_row"),a=parseInt(jQuery("#number_of_tabs").val())+parseInt(1),t=jQuery("#duplicate_this_row .button-holder"),s="_yikes_wc_custom_repeatable_product_tabs_tab_content_"+a,r="_yikes_wc_custom_repeatable_product_tabs_tab_title_"+a;_.children("p").each(function(){jQuery(this).clone().insertBefore("#duplicate_this_row").removeClass("hidden_duplicator_row_title_field hidden_duplicator_row_content_field").addClass("new_duplicate_row")}).promise().done(function(){jQuery(".new_duplicate_row").find("input").each(function(){jQuery(this).is('input[name="hidden_duplicator_row_title"]')&&jQuery(this).attr("name",r).removeClass("yikes_woo_tabs_title_field_duplicate").attr("id",r).parents("p").addClass(r+"_field").removeClass("hidden_duplicator_row_title_field").find("label").removeAttr("for").attr("for",r+"_field")}),jQuery(".new_duplicate_row").find("textarea").each(function(){jQuery(this).is('textarea[name="hidden_duplicator_row_content"]')&&jQuery(this).attr("name",s).attr("id",s).parents("p").addClass(s+"_field").removeClass("hidden_duplicator_row_content_field").find("label").removeAttr("for").attr("for",s+"_field")}),jQuery("#number_of_tabs").val(a),a>1&&jQuery(".new_duplicate_row").first().before('<div class="yikes-woo-custom-tab-divider"></div>')}),t.clone().insertAfter(jQuery("."+s+"_field")).addClass("last-button-holder"),jQuery(".last-button-holder").removeAttr("alt").attr("alt",a);var o=jQuery(".last-button-holder").children(".yikes_wc_override_reusable_tab_container");o.removeClass("_yikes_wc_override_reusable_tab_container_duplicate").children("#_yikes_wc_override_reusable_tab_duplicate").attr("id","_yikes_wc_override_reusable_tab_"+a).attr("data-tab-number",a),o.children("._yikes_wc_override_reusable_tab_label_duplicate").attr("for","_yikes_wc_override_reusable_tab_"+a).attr("id","_yikes_wc_override_reusable_tab_label_"+a).removeClass("_yikes_wc_override_reusable_tab_label_duplicate").addClass("_yikes_wc_override_reusable_tab_label"),o.children("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_action_duplicate").attr("name","_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a+"_action").attr("id","_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a+"_action"),o.children("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_duplicate").attr("name","_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a).attr("id","_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a),jQuery("#_yikes_wc_override_reusable_tab_container_duplicate").first().attr("id","_yikes_wc_override_reusable_tab_container_"+a),1===parseInt(repeatable_custom_tabs.wp_version_four_eight)?yikes_woo_get_wp_editor_foureight(s,!0,e):(jQuery("."+s+"_field").html(repeatable_custom_tabs.loading_gif),yikes_woo_get_wp_editor_ajax(s,!0,e)),jQuery(".last-button-holder").removeClass("last-button-holder"),jQuery(".new_duplicate_row").removeClass("new_duplicate_row")}function yikes_woo_set_editor_specific_styles(){jQuery('textarea[name^="_yikes_wc_custom_repeatable_product_tabs_tab_content_"]').each(function(){jQuery(this).addClass("yikes_woo_custom_editor_styles")})}jQuery(document).ready(function(){setTimeout(function(){yikes_woo_check_for_reusable_tabs_and_disable(),yikes_woo_set_editor_specific_styles()},4e3),jQuery(".yikes-tabs-how-to-toggle").on("click",function(e){yikes_woo_toggle_how_to()}),jQuery("#add_another_tab").click(function(e){yikes_woo_add_another_tab(""),e.preventDefault()}),jQuery("body").on("click",".remove_this_tab",function(e){var _=jQuery(this).parents(".button-holder").attr("alt"),a=jQuery("#number_of_tabs").val(),t="_yikes_wc_custom_repeatable_product_tabs_tab_title_",s="_yikes_wc_custom_repeatable_product_tabs_tab_content_";if(_!==a)for(var r=parseInt(_);r<a;){var o="",i="",c=r+1;o=jQuery("#"+t+c).val(),jQuery("#"+t+r).val(o),i=yikes_woo_get_content_from_wysiwyg(s+c),yikes_woo_set_content_for_wysiwyg(s+r,i);var l=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+c+"_action").val(),u=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+c).val();jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r+"_action").val(l),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r).val(u);var b=jQuery("#_yikes_wc_override_reusable_tab_"+c).is(":checked");jQuery("#_yikes_wc_override_reusable_tab_"+r).prop("checked",b),jQuery("#_yikes_wc_override_reusable_tab_container_"+c).is(":visible")?jQuery("#_yikes_wc_override_reusable_tab_container_"+r).show():jQuery("#_yikes_wc_override_reusable_tab_container_"+r).hide(),jQuery("._yikes_wc_custom_repeatable_product_tabs_tab_title_"+c+"_field").hasClass("yikes_woo_using_reusable_tab")?yikes_woo_toggle_reusable_override_overlay("disable",r):yikes_woo_toggle_reusable_override_overlay("enable",r),r++}var t="_yikes_wc_custom_repeatable_product_tabs_tab_title_",d=(s="_yikes_wc_custom_repeatable_product_tabs_tab_content_")+a,y=jQuery("#_yikes_wc_override_reusable_tab_container_"+a),n=jQuery("."+t+a+"_field"),v=jQuery("."+s+a+"_field"),w=jQuery(".yikes-woo-custom-tab-divider").last(),k=jQuery("."+s+a+"_field").next(".button-holder"),p=parseInt(a)-parseInt(1);"undefined"!=typeof tinymce&&tinymce.execCommand("mceRemoveEditor",!1,d),y.remove(),n.remove(),v.remove(),w.remove(),k.remove(),jQuery("#number_of_tabs").val(p),0===parseInt(p)&&jQuery("#add_another_tab").parent(".add_tabs_container").addClass("_yikes_wc_add_tab_center"),e.preventDefault()}),jQuery("body").on("click",".move-tab-data-up",function(){var e=jQuery(this).parents(".button-holder").attr("alt");if(1==e)return!1;var _="_yikes_wc_custom_repeatable_product_tabs_tab_title_",a="_yikes_wc_custom_repeatable_product_tabs_tab_content_",t=jQuery("#"+_+e).val(),s=yikes_woo_get_content_from_wysiwyg(a+e),r=parseInt(e)-parseInt(1),o=jQuery("#"+_+r).val(),i=yikes_woo_get_content_from_wysiwyg(a+r);jQuery("."+_+e+"_field").hasClass("yikes_woo_using_reusable_tab")&&!jQuery("."+_+r+"_field").hasClass("yikes_woo_using_reusable_tab")?(yikes_woo_toggle_reusable_override_overlay("enable",e),yikes_woo_toggle_reusable_override_overlay("disable",r)):jQuery("."+_+r+"_field").hasClass("yikes_woo_using_reusable_tab")&&!jQuery("."+_+e+"_field").hasClass("yikes_woo_using_reusable_tab")&&(yikes_woo_toggle_reusable_override_overlay("disable",e),yikes_woo_toggle_reusable_override_overlay("enable",r));var c=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e+"_action").val(),l=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e).val(),u=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r+"_action").val(),b=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r).val();jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e+"_action").val(u),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r+"_action").val(c),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e).val(b),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r).val(l),!0===jQuery("#_yikes_wc_override_reusable_tab_"+e).is(":checked")&&!1===jQuery("#_yikes_wc_override_reusable_tab_"+r).is(":checked")?(jQuery("#_yikes_wc_override_reusable_tab_"+r).prop("checked",!0),jQuery("#_yikes_wc_override_reusable_tab_"+e).prop("checked",!1)):!1===jQuery("#_yikes_wc_override_reusable_tab_"+e).is(":checked")&&!0===jQuery("#_yikes_wc_override_reusable_tab_"+r).is(":checked")&&(jQuery("#_yikes_wc_override_reusable_tab_"+r).prop("checked",!1),jQuery("#_yikes_wc_override_reusable_tab_"+e).prop("checked",!0)),!0===jQuery("#_yikes_wc_override_reusable_tab_container_"+e).is(":visible")&&!1===jQuery("#_yikes_wc_override_reusable_tab_container_"+r).is(":visible")?(jQuery("#_yikes_wc_override_reusable_tab_container_"+r).show(),jQuery("#_yikes_wc_override_reusable_tab_container_"+e).hide()):!1===jQuery("#_yikes_wc_override_reusable_tab_container_"+e).is(":visible")&&!0===jQuery("#_yikes_wc_override_reusable_tab_container_"+r).is(":visible")&&(jQuery("#_yikes_wc_override_reusable_tab_container_"+r).hide(),jQuery("#_yikes_wc_override_reusable_tab_container_"+e).show()),jQuery("#"+_+e).val(o),jQuery("#"+_+r).val(t),yikes_woo_set_content_for_wysiwyg(a+e,i),yikes_woo_set_content_for_wysiwyg(a+r,s)}),jQuery("body").on("click",".move-tab-data-down",function(){var e=jQuery(this).parents(".button-holder").attr("alt");if(e==jQuery("#number_of_tabs").val())return!1;var _="_yikes_wc_custom_repeatable_product_tabs_tab_title_",a="_yikes_wc_custom_repeatable_product_tabs_tab_content_",t=jQuery("#"+_+e).val(),s=yikes_woo_get_content_from_wysiwyg(a+e),r=parseInt(e)+parseInt(1),o=jQuery("#"+_+r).val(),i=yikes_woo_get_content_from_wysiwyg(a+r);jQuery("."+_+e+"_field").hasClass("yikes_woo_using_reusable_tab")&&!jQuery("."+_+r+"_field").hasClass("yikes_woo_using_reusable_tab")?(yikes_woo_toggle_reusable_override_overlay("enable",e),yikes_woo_toggle_reusable_override_overlay("disable",r)):jQuery("."+_+r+"_field").hasClass("yikes_woo_using_reusable_tab")&&!jQuery("."+_+e+"_field").hasClass("yikes_woo_using_reusable_tab")&&(yikes_woo_toggle_reusable_override_overlay("disable",e),yikes_woo_toggle_reusable_override_overlay("enable",r));var c=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e+"_action").val(),l=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e).val(),u=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r+"_action").val(),b=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r).val();jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e+"_action").val(u),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r+"_action").val(c),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e).val(b),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r).val(l),!0===jQuery("#_yikes_wc_override_reusable_tab_"+e).is(":checked")&&!1===jQuery("#_yikes_wc_override_reusable_tab_"+r).is(":checked")?(jQuery("#_yikes_wc_override_reusable_tab_"+r).prop("checked",!0),jQuery("#_yikes_wc_override_reusable_tab_"+e).prop("checked",!1)):!1===jQuery("#_yikes_wc_override_reusable_tab_"+e).is(":checked")&&!0===jQuery("#_yikes_wc_override_reusable_tab_"+r).is(":checked")&&(jQuery("#_yikes_wc_override_reusable_tab_"+r).prop("checked",!1),jQuery("#_yikes_wc_override_reusable_tab_"+e).prop("checked",!0)),!0===jQuery("#_yikes_wc_override_reusable_tab_container_"+e).is(":visible")&&!1===jQuery("#_yikes_wc_override_reusable_tab_container_"+r).is(":visible")?(jQuery("#_yikes_wc_override_reusable_tab_container_"+r).show(),jQuery("#_yikes_wc_override_reusable_tab_container_"+e).hide()):!1===jQuery("#_yikes_wc_override_reusable_tab_container_"+e).is(":visible")&&!0===jQuery("#_yikes_wc_override_reusable_tab_container_"+r).is(":visible")&&(jQuery("#_yikes_wc_override_reusable_tab_container_"+r).hide(),jQuery("#_yikes_wc_override_reusable_tab_container_"+e).show()),jQuery("#"+_+e).val(o),jQuery("#"+_+r).val(t),yikes_woo_set_content_for_wysiwyg(a+e,i),yikes_woo_set_content_for_wysiwyg(a+r,s)}),jQuery("body").on("click","#_yikes_wc_apply_a_saved_tab",function(){if(jQuery(this).hasClass("disabled"))return!1;jQuery(this).addClass("disabled"),yikes_woo_fetch_reusable_tabs(!1,yikes_woo_handle_reusable_tabs)}),jQuery("body").on("click",".yikes_woo_saved_tab_selector_lity",function(){var e=jQuery(this).data("saved-tab-number"),_=jQuery("#saved_tab_container_"+e).data("tab-id");jQuery(".lity-content").html(repeatable_custom_tabs.loading_gif).css("width","50px").children("img").css("margin-left","37%"),yikes_woo_fetch_reusable_tab(_,yikes_woo_apply_resuable_tab)}),jQuery("body").on("click","._yikes_wc_override_reusable_tab",function(){var e=jQuery(this).data("tab-number");!0===jQuery(this).is(":checked")?(yikes_woo_display_feedback_messages("_yikes_wc_override_reusable_tab_container_"+e,"_yikes_wc_override_reusable_tab_message","If you override this tab it will no longer recognize global tab changes.",!1),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e+"_action").val("remove"),yikes_woo_toggle_reusable_override_overlay("enable",e)):(jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e+"_action").val("add"),yikes_woo_toggle_reusable_override_overlay("disable",e))}),jQuery("body").on("focusout",".yikes_woo_tabs_title_field",function(){var e=jQuery(this);if(1===parseInt(jQuery("#number_of_tabs").val()))return e.removeClass("_yikes_wc_title_red_overlay"),void e.parent(".form-field").children("._yikes_wc_duplicate_title_message").remove();var _=jQuery(this).attr("id"),a=jQuery(this).val(),t=!1;jQuery(".yikes_woo_tabs_title_field").each(function(s,r){jQuery(r).attr("id")!=_&&""!=jQuery(r).val()&&jQuery(r).val()===a&&(e.addClass("_yikes_wc_title_red_overlay"),e.parent(".form-field").children("._yikes_wc_duplicate_title_message").remove(),e.parent(".form-field").prepend('<span class="_yikes_wc_duplicate_title_message"> Please choose a unique tab name - duplicate tab names can create errors </span>'),t=!0)}),!1===t&&(jQuery("._yikes_wc_title_red_overlay").removeClass("_yikes_wc_title_red_overlay"),jQuery("._yikes_wc_duplicate_title_message").remove())}),jQuery("body").on("lity:close",function(){jQuery("#_yikes_wc_apply_a_saved_tab").removeClass("disabled")}),jQuery("#yikes_woo_save_custom_tabs").click(function(){if(!0!==jQuery("#yikes_woo_save_custom_tabs").hasClass("disabled")){jQuery("#yikes_woo_save_custom_tabs").addClass("disabled"),jQuery("#yikes_woo_ajax_save_feedback").fadeOut();for(var e=jQuery("#number_of_tabs").val(),_={action:"yikes_woo_save_product_tabs",post_id:repeatable_custom_tabs.global_post_id,number_of_tabs:e,security_nonce:repeatable_custom_tabs.save_product_tabs_nonce},a=1;a<=e;a++)_["_yikes_wc_custom_repeatable_product_tabs_tab_title_"+a]=jQuery("#_yikes_wc_custom_repeatable_product_tabs_tab_title_"+a).val(),_["_yikes_wc_custom_repeatable_product_tabs_tab_content_"+a]=yikes_woo_get_content_from_wysiwyg("_yikes_wc_custom_repeatable_product_tabs_tab_content_"+a),_["_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a]=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a).val(),_["_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a+"_action"]=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a+"_action").val();jQuery.post(repeatable_custom_tabs.ajaxurl,_,function(e){void 0!==e.success&&(!0===e.success?feedback_message_class="yikes_woo_save_success":!1===e.success&&(feedback_message_class="yikes_woo_save_failure")),void 0!==e.data&&void 0!==e.data.message&&jQuery("#yikes_woo_ajax_save_feedback").removeClass().addClass(feedback_message_class).text(e.data.message).fadeIn().delay("2000").fadeOut(),jQuery("#yikes_woo_save_custom_tabs").removeClass("disabled")})}})});
|
1 |
+
function yikes_woo_apply_resuable_tab(e){var _=e.data,a="_yikes_wc_custom_repeatable_product_tabs_tab_title_",t=_.tab_title,s=_.tab_id;yikes_woo_add_another_tab(_.tab_content);var r=jQuery("#number_of_tabs").val();jQuery("#"+a+r).val(t),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r+"_action").val("add"),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r).val(s),jQuery("#qt__yikes_wc_custom_repeatable_product_tabs_tab_content_"+r+"_toolbar").length>0?yikes_woo_toggle_reusable_override_overlay("disable",r):jQuery("#"+a+r).addClass("yikes_woo_disable_this_tab"),jQuery("#_yikes_wc_override_reusable_tab_container_"+r).show()}function yikes_woo_fetch_reusable_tab(e,_){var a={action:"yikes_woo_fetch_reusable_tab",tab_id:e,security_nonce:repeatable_custom_tabs.fetch_reusable_tab_nonce};jQuery.post(repeatable_custom_tabs.ajaxurl,a,function(e){global_lity.close(),_(e)})}function yikes_woo_fetch_reusable_tabs(e,_){var a={action:"yikes_woo_fetch_reusable_tabs",fetch_tab_content:e,security_nonce:repeatable_custom_tabs.fetch_reusable_tabs_nonce};jQuery.post(repeatable_custom_tabs.ajaxurl,a,function(e){_(e)})}function yikes_woo_handle_reusable_tabs(e){if(void 0!==e.success&&!0===e.success)if(void 0!==e.data&&void 0!==e.data.message)jQuery("#yikes_woo_ajax_save_feedback").removeClass().addClass("yikes_woo_save_success").text(e.data.message).fadeIn().delay("2000").fadeOut();else{var _=JSON.parse(e.data);lity_html=create_lity_manage_reusable_tabs_html(_),global_lity=lity(lity_html,{handler:"inline"})}else void 0!==e.success&&!1===e.success&&console.log(response);jQuery("#_yikes_wc_apply_a_saved_tab").removeClass("disabled")}function create_lity_manage_reusable_tabs_html(e){var _=1,a="";return a+='<div class="display_saved_tabs_lity">',a+='<div class="yikes_wc_lity_header">',a+="<span> Choose a Tab </span>",a+="</div>",jQuery.each(e,function(e,t){a+='<div id="saved_tab_container_'+_+'" data-tab-id="'+t.tab_id+'">',a+='<div class="yikes_wc_lity_col_title">',a+='<span class="yikes_woo_saved_tab_title_lity" id="yikes_woo_saved_tab_title_'+_+'">',a+=t.tab_title,a+="</span>",a+='<span class="yikes_woo_saved_tab_name_lity" id="yikes_woo_saved_tab_name_'+_+'">',a+=void 0!==t.tab_name?" - "+t.tab_name:"",a+="</span>",a+="</div>",a+='<div class="yikes_wc_lity_col_select">',a+='<span class="yikes_woo_saved_tab_selector_lity dashicons dashicons-plus-alt" data-saved-tab-number="'+_+'"></span>',a+="</div>",a+="</div>",_++}),a+="</div>"}function yikes_woo_toggle_reusable_override_overlay(e,_){"disable"===e?(jQuery("#qt__yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"_toolbar").addClass("yikes_woo_using_reusable_tab"),jQuery("#_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_).addClass("yikes_woo_using_reusable_tab"),jQuery("#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"-media-buttons").addClass("yikes_woo_using_reusable_tab"),jQuery("#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"-editor-container").children(".mce-container").children(".mce-container-body").children(".mce-toolbar-grp").addClass("yikes_woo_using_reusable_tab"),jQuery("#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"-editor-container").children(".mce-tinymce").children(".mce-container-body").children(".mce-edit-area").addClass("yikes_woo_using_reusable_tab"),jQuery("._yikes_wc_custom_repeatable_product_tabs_tab_title_"+_+"_field").addClass("yikes_woo_using_reusable_tab")):(jQuery("#qt__yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"_toolbar").removeClass("yikes_woo_using_reusable_tab"),jQuery("#_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_).removeClass("yikes_woo_using_reusable_tab"),jQuery("#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"-media-buttons").removeClass("yikes_woo_using_reusable_tab"),jQuery("#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"-editor-container").children(".mce-container").children(".mce-container-body").children(".mce-toolbar-grp").removeClass("yikes_woo_using_reusable_tab"),jQuery("#wp-_yikes_wc_custom_repeatable_product_tabs_tab_content_"+_+"-editor-container").children(".mce-tinymce").children(".mce-container-body").children(".mce-edit-area").removeClass("yikes_woo_using_reusable_tab"),jQuery("._yikes_wc_custom_repeatable_product_tabs_tab_title_"+_+"_field").removeClass("yikes_woo_using_reusable_tab"))}function yikes_woo_check_for_reusable_tabs_and_disable(){jQuery(".yikes_wc_override_reusable_tab_container").each(function(){1==jQuery(this).data("reusable-tab")&&yikes_woo_toggle_reusable_override_overlay("disable",jQuery(this).children("._yikes_wc_override_reusable_tab").data("tab-number"))})}function yikes_woo_add_another_tab(e){yikes_woo_toggle_controls("disable"),jQuery("._yikes_wc_add_tab_center_new").removeClass("_yikes_wc_add_tab_center_new"),jQuery("#add_another_tab").parent(".add_tabs_container").removeClass("_yikes_wc_add_tab_center");var _=jQuery("#duplicate_this_row"),a=parseInt(jQuery("#number_of_tabs").val())+parseInt(1),t=(jQuery("#duplicate_this_row .button-holder"),"_yikes_wc_custom_repeatable_product_tabs_tab_content_"+a),s="_yikes_wc_custom_repeatable_product_tabs_tab_title_"+a;_.children(".hidden_duplicator_row_title_field, .hidden_duplicator_row_content_field, .hidden_duplicator_row_button_holder").each(function(){jQuery(this).clone().insertBefore("#duplicate_this_row").removeClass("hidden_duplicator_row_title_field hidden_duplicator_row_content_field hidden_duplicator_row_button_holder").addClass("new_duplicate_row")}).promise().done(function(){jQuery(".new_duplicate_row").find("input").each(function(){jQuery(this).is('input[name="hidden_duplicator_row_title"]')&&jQuery(this).attr("name",s).removeClass("yikes_woo_tabs_title_field_duplicate").attr("id",s).parents("p").addClass(s+"_field").removeClass("hidden_duplicator_row_title_field").find("label").removeAttr("for").attr("for",s+"_field")}),jQuery(".new_duplicate_row").find("textarea").each(function(){jQuery(this).is('textarea[name="hidden_duplicator_row_content"]')&&jQuery(this).attr("name",t).attr("id",t).parent("div").addClass(t+"_field").removeClass("hidden_duplicator_row_content_field").find("label").removeAttr("for").attr("for",t+"_field")}),jQuery(".new_duplicate_row").find(".button-holder").attr("alt",a),jQuery(".new_duplicate_row").find(".yikes_wc_override_reusable_tab_container").attr("id","_yikes_wc_override_reusable_tab_container_"+a),jQuery(".new_duplicate_row").find(".button-holder").css("width","19.25%").unwrap(),jQuery("#number_of_tabs").val(a),a>1&&jQuery(".new_duplicate_row").first().before('<div class="yikes-woo-custom-tab-divider"></div>')});var r=jQuery(".last-button-holder").children(".yikes_wc_override_reusable_tab_container");r.removeClass("_yikes_wc_override_reusable_tab_container_duplicate").children("#_yikes_wc_override_reusable_tab_duplicate").attr("id","_yikes_wc_override_reusable_tab_"+a).attr("data-tab-number",a),r.children("._yikes_wc_override_reusable_tab_label_duplicate").attr("for","_yikes_wc_override_reusable_tab_"+a).attr("id","_yikes_wc_override_reusable_tab_label_"+a).removeClass("_yikes_wc_override_reusable_tab_label_duplicate").addClass("_yikes_wc_override_reusable_tab_label"),r.children("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_action_duplicate").attr("name","_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a+"_action").attr("id","_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a+"_action"),r.children("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_duplicate").attr("name","_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a).attr("id","_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a),jQuery("#_yikes_wc_override_reusable_tab_container_duplicate").first().attr("id","_yikes_wc_override_reusable_tab_container_"+a),1===parseInt(repeatable_custom_tabs.wp_version_four_eight)?yikes_woo_get_wp_editor_foureight(t,!0,e):(jQuery("."+t+"_field").html(repeatable_custom_tabs.loading_gif),yikes_woo_get_wp_editor_ajax(t,!0,e)),jQuery(".last-button-holder").removeClass("last-button-holder"),jQuery(".new_duplicate_row").removeClass("new_duplicate_row")}function yikes_woo_set_editor_specific_styles(){jQuery('textarea[name^="_yikes_wc_custom_repeatable_product_tabs_tab_content_"]').each(function(){jQuery(this).addClass("yikes_woo_custom_editor_styles")})}jQuery(document).ready(function(){setTimeout(function(){yikes_woo_check_for_reusable_tabs_and_disable(),yikes_woo_set_editor_specific_styles()},4e3),jQuery(".yikes-tabs-how-to-toggle").on("click",function(e){yikes_woo_toggle_how_to()}),jQuery("#add_another_tab").click(function(e){yikes_woo_add_another_tab(""),e.preventDefault()}),jQuery("body").on("click",".remove_this_tab",function(e){var _=jQuery(this).parents(".button-holder").attr("alt"),a=jQuery("#number_of_tabs").val(),t="_yikes_wc_custom_repeatable_product_tabs_tab_title_",s="_yikes_wc_custom_repeatable_product_tabs_tab_content_";if(_!==a)for(var r=parseInt(_);r<a;){var o,i,c=r+1;o=jQuery("#"+t+c).val(),jQuery("#"+t+r).val(o),i=yikes_woo_get_content_from_wysiwyg(s+c),yikes_woo_set_content_for_wysiwyg(s+r,i);var l=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+c+"_action").val(),u=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+c).val();jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r+"_action").val(l),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r).val(u);var d=jQuery("#_yikes_wc_override_reusable_tab_"+c).is(":checked");jQuery("#_yikes_wc_override_reusable_tab_"+r).prop("checked",d),jQuery("#_yikes_wc_override_reusable_tab_container_"+c).is(":visible")?jQuery("#_yikes_wc_override_reusable_tab_container_"+r).show():jQuery("#_yikes_wc_override_reusable_tab_container_"+r).hide(),jQuery("._yikes_wc_custom_repeatable_product_tabs_tab_title_"+c+"_field").hasClass("yikes_woo_using_reusable_tab")?yikes_woo_toggle_reusable_override_overlay("disable",r):yikes_woo_toggle_reusable_override_overlay("enable",r),r++}t="_yikes_wc_custom_repeatable_product_tabs_tab_title_";var b=(s="_yikes_wc_custom_repeatable_product_tabs_tab_content_")+a,y=jQuery("#_yikes_wc_override_reusable_tab_container_"+a),n=jQuery("."+t+a+"_field"),w=jQuery("."+s+a+"_field"),v=jQuery(".yikes-woo-custom-tab-divider").last(),k=jQuery("."+s+a+"_field").next(".button-holder"),p=parseInt(a)-parseInt(1);"undefined"!=typeof tinymce&&tinymce.execCommand("mceRemoveEditor",!1,b),y.remove(),n.remove(),w.remove(),v.remove(),k.remove(),jQuery("#number_of_tabs").val(p),0===parseInt(p)&&jQuery("#add_another_tab").parent(".add_tabs_container").addClass("_yikes_wc_add_tab_center"),e.preventDefault()}),jQuery("body").on("click",".move-tab-data-up",function(){var e=jQuery(this).parents(".button-holder").attr("alt");if(1==e)return!1;var _="_yikes_wc_custom_repeatable_product_tabs_tab_title_",a="_yikes_wc_custom_repeatable_product_tabs_tab_content_",t=jQuery("#"+_+e).val(),s=yikes_woo_get_content_from_wysiwyg(a+e),r=parseInt(e)-parseInt(1),o=jQuery("#"+_+r).val(),i=yikes_woo_get_content_from_wysiwyg(a+r);jQuery("."+_+e+"_field").hasClass("yikes_woo_using_reusable_tab")&&!jQuery("."+_+r+"_field").hasClass("yikes_woo_using_reusable_tab")?(yikes_woo_toggle_reusable_override_overlay("enable",e),yikes_woo_toggle_reusable_override_overlay("disable",r)):jQuery("."+_+r+"_field").hasClass("yikes_woo_using_reusable_tab")&&!jQuery("."+_+e+"_field").hasClass("yikes_woo_using_reusable_tab")&&(yikes_woo_toggle_reusable_override_overlay("disable",e),yikes_woo_toggle_reusable_override_overlay("enable",r));var c=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e+"_action").val(),l=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e).val(),u=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r+"_action").val(),d=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r).val();jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e+"_action").val(u),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r+"_action").val(c),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e).val(d),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r).val(l),!0===jQuery("#_yikes_wc_override_reusable_tab_"+e).is(":checked")&&!1===jQuery("#_yikes_wc_override_reusable_tab_"+r).is(":checked")?(jQuery("#_yikes_wc_override_reusable_tab_"+r).prop("checked",!0),jQuery("#_yikes_wc_override_reusable_tab_"+e).prop("checked",!1)):!1===jQuery("#_yikes_wc_override_reusable_tab_"+e).is(":checked")&&!0===jQuery("#_yikes_wc_override_reusable_tab_"+r).is(":checked")&&(jQuery("#_yikes_wc_override_reusable_tab_"+r).prop("checked",!1),jQuery("#_yikes_wc_override_reusable_tab_"+e).prop("checked",!0)),!0===jQuery("#_yikes_wc_override_reusable_tab_container_"+e).is(":visible")&&!1===jQuery("#_yikes_wc_override_reusable_tab_container_"+r).is(":visible")?(jQuery("#_yikes_wc_override_reusable_tab_container_"+r).show(),jQuery("#_yikes_wc_override_reusable_tab_container_"+e).hide()):!1===jQuery("#_yikes_wc_override_reusable_tab_container_"+e).is(":visible")&&!0===jQuery("#_yikes_wc_override_reusable_tab_container_"+r).is(":visible")&&(jQuery("#_yikes_wc_override_reusable_tab_container_"+r).hide(),jQuery("#_yikes_wc_override_reusable_tab_container_"+e).show()),jQuery("#"+_+e).val(o),jQuery("#"+_+r).val(t),yikes_woo_set_content_for_wysiwyg(a+e,i),yikes_woo_set_content_for_wysiwyg(a+r,s)}),jQuery("body").on("click",".move-tab-data-down",function(){var e=jQuery(this).parents(".button-holder").attr("alt");if(e==jQuery("#number_of_tabs").val())return!1;var _="_yikes_wc_custom_repeatable_product_tabs_tab_title_",a="_yikes_wc_custom_repeatable_product_tabs_tab_content_",t=jQuery("#"+_+e).val(),s=yikes_woo_get_content_from_wysiwyg(a+e),r=parseInt(e)+parseInt(1),o=jQuery("#"+_+r).val(),i=yikes_woo_get_content_from_wysiwyg(a+r);jQuery("."+_+e+"_field").hasClass("yikes_woo_using_reusable_tab")&&!jQuery("."+_+r+"_field").hasClass("yikes_woo_using_reusable_tab")?(yikes_woo_toggle_reusable_override_overlay("enable",e),yikes_woo_toggle_reusable_override_overlay("disable",r)):jQuery("."+_+r+"_field").hasClass("yikes_woo_using_reusable_tab")&&!jQuery("."+_+e+"_field").hasClass("yikes_woo_using_reusable_tab")&&(yikes_woo_toggle_reusable_override_overlay("disable",e),yikes_woo_toggle_reusable_override_overlay("enable",r));var c=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e+"_action").val(),l=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e).val(),u=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r+"_action").val(),d=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r).val();jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e+"_action").val(u),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r+"_action").val(c),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e).val(d),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+r).val(l),!0===jQuery("#_yikes_wc_override_reusable_tab_"+e).is(":checked")&&!1===jQuery("#_yikes_wc_override_reusable_tab_"+r).is(":checked")?(jQuery("#_yikes_wc_override_reusable_tab_"+r).prop("checked",!0),jQuery("#_yikes_wc_override_reusable_tab_"+e).prop("checked",!1)):!1===jQuery("#_yikes_wc_override_reusable_tab_"+e).is(":checked")&&!0===jQuery("#_yikes_wc_override_reusable_tab_"+r).is(":checked")&&(jQuery("#_yikes_wc_override_reusable_tab_"+r).prop("checked",!1),jQuery("#_yikes_wc_override_reusable_tab_"+e).prop("checked",!0)),!0===jQuery("#_yikes_wc_override_reusable_tab_container_"+e).is(":visible")&&!1===jQuery("#_yikes_wc_override_reusable_tab_container_"+r).is(":visible")?(jQuery("#_yikes_wc_override_reusable_tab_container_"+r).show(),jQuery("#_yikes_wc_override_reusable_tab_container_"+e).hide()):!1===jQuery("#_yikes_wc_override_reusable_tab_container_"+e).is(":visible")&&!0===jQuery("#_yikes_wc_override_reusable_tab_container_"+r).is(":visible")&&(jQuery("#_yikes_wc_override_reusable_tab_container_"+r).hide(),jQuery("#_yikes_wc_override_reusable_tab_container_"+e).show()),jQuery("#"+_+e).val(o),jQuery("#"+_+r).val(t),yikes_woo_set_content_for_wysiwyg(a+e,i),yikes_woo_set_content_for_wysiwyg(a+r,s)}),jQuery("body").on("click","#_yikes_wc_apply_a_saved_tab",function(){if(jQuery(this).hasClass("disabled"))return!1;jQuery(this).addClass("disabled"),yikes_woo_fetch_reusable_tabs(!1,yikes_woo_handle_reusable_tabs)}),jQuery("body").on("click",".yikes_woo_saved_tab_selector_lity",function(){var e=jQuery(this).data("saved-tab-number"),_=jQuery("#saved_tab_container_"+e).data("tab-id");jQuery(".lity-content").html(repeatable_custom_tabs.loading_gif).css("width","50px").children("img").css("margin-left","37%"),yikes_woo_fetch_reusable_tab(_,yikes_woo_apply_resuable_tab)}),jQuery("body").on("click","._yikes_wc_override_reusable_tab",function(){var e=jQuery(this).data("tab-number");!0===jQuery(this).is(":checked")?(yikes_woo_display_feedback_messages("_yikes_wc_override_reusable_tab_container_"+e,"_yikes_wc_override_reusable_tab_message","If you override this tab it will no longer recognize global tab changes.",!1),jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e+"_action").val("remove"),yikes_woo_toggle_reusable_override_overlay("enable",e)):(jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+e+"_action").val("add"),yikes_woo_toggle_reusable_override_overlay("disable",e))}),jQuery("body").on("focusout",".yikes_woo_tabs_title_field",function(){var e=jQuery(this);if(1===parseInt(jQuery("#number_of_tabs").val()))return e.removeClass("_yikes_wc_title_red_overlay"),void e.parent(".form-field").children("._yikes_wc_duplicate_title_message").remove();var _=jQuery(this).attr("id"),a=jQuery(this).val(),t=!1;jQuery(".yikes_woo_tabs_title_field").each(function(s,r){jQuery(r).attr("id")!=_&&""!=jQuery(r).val()&&jQuery(r).val()===a&&(e.addClass("_yikes_wc_title_red_overlay"),e.parent(".form-field").children("._yikes_wc_duplicate_title_message").remove(),e.parent(".form-field").prepend('<span class="_yikes_wc_duplicate_title_message"> Please choose a unique tab name - duplicate tab names can create errors </span>'),t=!0)}),!1===t&&(jQuery("._yikes_wc_title_red_overlay").removeClass("_yikes_wc_title_red_overlay"),jQuery("._yikes_wc_duplicate_title_message").remove())}),jQuery("body").on("lity:close",function(){jQuery("#_yikes_wc_apply_a_saved_tab").removeClass("disabled")}),jQuery("#yikes_woo_save_custom_tabs").click(function(){if(!0!==jQuery("#yikes_woo_save_custom_tabs").hasClass("disabled")){jQuery("#yikes_woo_save_custom_tabs").addClass("disabled"),jQuery("#yikes_woo_ajax_save_feedback").fadeOut();for(var e=jQuery("#number_of_tabs").val(),_={action:"yikes_woo_save_product_tabs",post_id:repeatable_custom_tabs.global_post_id,number_of_tabs:e,security_nonce:repeatable_custom_tabs.save_product_tabs_nonce},a=1;a<=e;a++)_["_yikes_wc_custom_repeatable_product_tabs_tab_title_"+a]=jQuery("#_yikes_wc_custom_repeatable_product_tabs_tab_title_"+a).val(),_["_yikes_wc_custom_repeatable_product_tabs_tab_content_"+a]=yikes_woo_get_content_from_wysiwyg("_yikes_wc_custom_repeatable_product_tabs_tab_content_"+a),_["_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a]=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a).val(),_["_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a+"_action"]=jQuery("#_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_"+a+"_action").val();jQuery.post(repeatable_custom_tabs.ajaxurl,_,function(e){void 0!==e.success&&(!0===e.success?feedback_message_class="yikes_woo_save_success":!1===e.success&&(feedback_message_class="yikes_woo_save_failure")),void 0!==e.data&&void 0!==e.data.message&&jQuery("#yikes_woo_ajax_save_feedback").removeClass().addClass(feedback_message_class).text(e.data.message).fadeIn().delay("2000").fadeOut(),jQuery("#yikes_woo_save_custom_tabs").removeClass("disabled")})}})});
|
js/twitter-embed.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
window.twttr=function(t,e,r){var n,i=t.getElementsByTagName(e)[0],w=window.twttr||{};return t.getElementById(r)?w:((n=t.createElement(e)).id=r,n.src="https://platform.twitter.com/widgets.js",i.parentNode.insertBefore(n,i),w._e=[],w.ready=function(t){w._e.push(t)},w)}(document,"script","twitter-wjs");
|
languages/yikes-inc-easy-custom-woocommerce-product-tabs.pot
CHANGED
@@ -6,9 +6,9 @@
|
|
6 |
#, fuzzy
|
7 |
msgid ""
|
8 |
msgstr ""
|
9 |
-
"Project-Id-Version: custom-product-tabs 1.
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
-
"POT-Creation-Date:
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
@@ -22,151 +22,232 @@ msgstr ""
|
|
22 |
msgid "Go Pro"
|
23 |
msgstr ""
|
24 |
|
25 |
-
#: admin/class.premium.php:
|
|
|
|
|
|
|
|
|
26 |
msgid "Leave a review!"
|
27 |
msgstr ""
|
28 |
|
29 |
-
#: admin/class.premium.php:
|
30 |
msgid "Tweet about us!"
|
31 |
msgstr ""
|
32 |
|
33 |
-
#: admin/class.premium.php:
|
34 |
msgid "Tweet"
|
35 |
msgstr ""
|
36 |
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
msgid "Check out Custom Product Tabs Pro!"
|
39 |
msgstr ""
|
40 |
|
41 |
-
#: admin/class.premium.php:
|
42 |
msgid ""
|
43 |
"Create global tabs, add tabs to products based on categories or tags, add "
|
44 |
"tab content to search results, and more!"
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: admin/class.premium.php:
|
48 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: admin/class.support.php:
|
52 |
msgid "Support"
|
53 |
msgstr ""
|
54 |
|
55 |
-
#: admin/class.support.php:
|
56 |
#, php-format
|
57 |
msgid ""
|
58 |
-
"Before submitting a support request, please visit our %
|
59 |
-
"
|
60 |
msgstr ""
|
61 |
|
62 |
-
#: admin/class.support.php:
|
|
|
|
|
|
|
|
|
|
|
63 |
#, php-format
|
64 |
msgid ""
|
65 |
-
"Custom Product Tabs Pro users qualify for premium support. Check out "
|
66 |
-
"%1sCustom Product Tabs Pro%2s!"
|
67 |
msgstr ""
|
68 |
|
69 |
-
#: admin/class.support.php:
|
70 |
msgid "WordPress.org Support Forums"
|
71 |
msgstr ""
|
72 |
|
73 |
-
#: admin/class.support.php:
|
74 |
#, php-format
|
75 |
msgid ""
|
76 |
"If you need help with free Custom Product Tabs, please post questions to "
|
77 |
-
"%
|
78 |
-
|
|
|
|
|
|
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: admin/class.support.php:
|
82 |
msgid "Submit a Support Request"
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: admin/class.yikes-woo-generate-html.php:
|
86 |
-
#: admin/class.yikes-woo-generate-html.php:
|
87 |
-
#: admin/page.yikes-woo-saved-tabs-single.php:
|
88 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
89 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
90 |
msgid "Tab Title"
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: admin/class.yikes-woo-generate-html.php:
|
94 |
-
#: admin/class.yikes-woo-generate-html.php:
|
95 |
msgid "Custom Tab Title"
|
96 |
msgstr ""
|
97 |
|
98 |
-
#: admin/class.yikes-woo-generate-html.php:
|
99 |
msgid ""
|
100 |
"For help using Custom Tabs please visit our <a href='https://yikesplugins."
|
101 |
"com/support/knowledge-base/product/easy-custom-product-tabs-for-"
|
102 |
"woocommerce/' target='_blank'>Knowledge Base</a>"
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: admin/class.yikes-woo-generate-html.php:
|
106 |
msgid "Help Me!"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: admin/class.yikes-woo-generate-html.php:
|
110 |
-
#: admin/class.yikes-woo-generate-html.php:284
|
111 |
msgid "Check this box to override the saved tab"
|
112 |
msgstr ""
|
113 |
|
114 |
-
#: admin/class.yikes-woo-generate-html.php:
|
115 |
msgid " Override Saved Tab"
|
116 |
msgstr ""
|
117 |
|
118 |
-
#: admin/class.yikes-woo-generate-html.php:
|
119 |
-
#: admin/class.yikes-woo-generate-html.php:
|
120 |
-
#: admin/class.yikes-woo-generate-html.php:
|
121 |
msgid "Remove Tab"
|
122 |
msgstr ""
|
123 |
|
124 |
-
#: admin/class.yikes-woo-generate-html.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
#: admin/class.yikes-woo-generate-html.php:269
|
126 |
msgid "Content"
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: admin/class.yikes-woo-generate-html.php:
|
130 |
#: admin/class.yikes-woo-generate-html.php:269
|
131 |
msgid "HTML and text to display."
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: admin/class.yikes-woo-generate-html.php:
|
135 |
-
msgid "Override Saved Tab"
|
136 |
-
msgstr ""
|
137 |
-
|
138 |
-
#: admin/class.yikes-woo-generate-html.php:336
|
139 |
msgid "Add a Tab"
|
140 |
msgstr ""
|
141 |
|
142 |
-
#: admin/class.yikes-woo-generate-html.php:
|
143 |
msgid "Add a Saved Tab"
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: admin/class.yikes-woo-saved-tabs.php:
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
msgid ""
|
149 |
"Sorry! An error has occurred while trying to retrieve the editor. Please "
|
150 |
"refresh the page and try again."
|
151 |
msgstr ""
|
152 |
|
153 |
-
#: admin/class.yikes-woo-saved-tabs.php:
|
154 |
msgid "Could not find the tab. Please try again."
|
155 |
msgstr ""
|
156 |
|
157 |
-
#: admin/class.yikes-woo-saved-tabs.php:
|
158 |
msgid "Uh oh. Something went wrong."
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: admin/class.yikes-woo-saved-tabs.php:
|
162 |
-
#: admin/class.yikes-woo-saved-tabs.php:
|
163 |
msgid "Custom Product Tabs"
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: admin/class.yikes-woo-tabs.php:
|
167 |
msgid "Custom Tabs"
|
168 |
msgstr ""
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
#: admin/page.premium.php:5
|
171 |
msgid "Custom Product Tabs for WooCommerce | Go Pro"
|
172 |
msgstr ""
|
@@ -238,10 +319,6 @@ msgid ""
|
|
238 |
"Assign saved tabs to products via the product's default bulk edit screen."
|
239 |
msgstr ""
|
240 |
|
241 |
-
#: admin/page.premium.php:77
|
242 |
-
msgid "Settings"
|
243 |
-
msgstr ""
|
244 |
-
|
245 |
#: admin/page.premium.php:79
|
246 |
msgid ""
|
247 |
"Remove the tab title from tab content site-wide without needing a filter"
|
@@ -272,38 +349,46 @@ msgid "It looks like something went wrong. Please %1sgo back%2s. and try again"
|
|
272 |
msgstr ""
|
273 |
|
274 |
#: admin/page.yikes-woo-saved-tabs-single.php:29
|
275 |
-
|
276 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
msgstr ""
|
278 |
|
279 |
-
#: admin/page.yikes-woo-saved-tabs-single.php:
|
280 |
msgid "Go Back to All Saved Tabs list"
|
281 |
msgstr ""
|
282 |
|
283 |
-
#: admin/page.yikes-woo-saved-tabs-single.php:
|
284 |
msgid "Any updates made here will apply to all products using this tab."
|
285 |
msgstr ""
|
286 |
|
287 |
-
#: admin/page.yikes-woo-saved-tabs-single.php:
|
288 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
289 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
290 |
msgid "Tab Name"
|
291 |
msgstr ""
|
292 |
|
293 |
-
#: admin/page.yikes-woo-saved-tabs-single.php:
|
294 |
msgid "This is for your reference only."
|
295 |
msgstr ""
|
296 |
|
297 |
-
#: admin/page.yikes-woo-saved-tabs-single.php:
|
298 |
msgid "Tab Content"
|
299 |
msgstr ""
|
300 |
|
301 |
-
#: admin/page.yikes-woo-saved-tabs-single.php:
|
302 |
msgid "Save Tab"
|
303 |
msgstr ""
|
304 |
|
305 |
-
#: admin/page.yikes-woo-saved-tabs-single.php:
|
306 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
307 |
msgid "Delete Tab"
|
308 |
msgstr ""
|
309 |
|
@@ -311,46 +396,50 @@ msgstr ""
|
|
311 |
msgid "Custom Product Tabs for WooCommerce | Saved Tabs"
|
312 |
msgstr ""
|
313 |
|
314 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
315 |
msgid "Tab deleted!"
|
316 |
msgstr ""
|
317 |
|
318 |
#: admin/page.yikes-woo-saved-tabs.php:25
|
319 |
-
msgid "
|
|
|
|
|
|
|
|
|
320 |
msgstr ""
|
321 |
|
322 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
323 |
msgid "Select bulk action"
|
324 |
msgstr ""
|
325 |
|
326 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
327 |
msgid "Bulk Actions"
|
328 |
msgstr ""
|
329 |
|
330 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
331 |
msgid "Delete"
|
332 |
msgstr ""
|
333 |
|
334 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
335 |
msgid "Apply"
|
336 |
msgstr ""
|
337 |
|
338 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
339 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
340 |
msgid "Select All"
|
341 |
msgstr ""
|
342 |
|
343 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
344 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
345 |
msgid "Tab Content Preview"
|
346 |
msgstr ""
|
347 |
|
348 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
349 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
350 |
msgid "Edit Tab"
|
351 |
msgstr ""
|
352 |
|
353 |
-
#: admin/page.yikes-woo-saved-tabs.php:
|
354 |
msgid "There are no saved tabs. Add one!"
|
355 |
msgstr ""
|
356 |
|
@@ -374,8 +463,29 @@ msgstr[1] ""
|
|
374 |
msgid "yyyy-mm-dd"
|
375 |
msgstr ""
|
376 |
|
377 |
-
#: yikes-inc-easy-custom-woocommerce-product-tabs.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
msgid ""
|
379 |
-
"Custom Product Tabs for WooCommerce
|
380 |
-
"
|
381 |
msgstr ""
|
6 |
#, fuzzy
|
7 |
msgid ""
|
8 |
msgstr ""
|
9 |
+
"Project-Id-Version: custom-product-tabs 1.8.0\n"
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
+
"POT-Creation-Date: 2022-10-17 03:20-0400\n"
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
22 |
msgid "Go Pro"
|
23 |
msgstr ""
|
24 |
|
25 |
+
#: admin/class.premium.php:77
|
26 |
+
msgid "Show Us Some Love"
|
27 |
+
msgstr ""
|
28 |
+
|
29 |
+
#: admin/class.premium.php:81
|
30 |
msgid "Leave a review!"
|
31 |
msgstr ""
|
32 |
|
33 |
+
#: admin/class.premium.php:93
|
34 |
msgid "Tweet about us!"
|
35 |
msgstr ""
|
36 |
|
37 |
+
#: admin/class.premium.php:97
|
38 |
msgid "Tweet"
|
39 |
msgstr ""
|
40 |
|
41 |
+
#. //yikesinc.com.
|
42 |
+
#: admin/class.premium.php:105
|
43 |
+
#, php-format
|
44 |
+
msgid "This plugin made with %1$s by %2$s"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: admin/class.premium.php:116 admin/class.premium.php:121
|
48 |
+
#: admin/class.support.php:84
|
49 |
+
msgid "Custom Product Tabs Pro"
|
50 |
+
msgstr ""
|
51 |
+
|
52 |
+
#: admin/class.premium.php:118
|
53 |
msgid "Check out Custom Product Tabs Pro!"
|
54 |
msgstr ""
|
55 |
|
56 |
+
#: admin/class.premium.php:119
|
57 |
msgid ""
|
58 |
"Create global tabs, add tabs to products based on categories or tags, add "
|
59 |
"tab content to search results, and more!"
|
60 |
msgstr ""
|
61 |
|
62 |
+
#: admin/class.settings.php:146 admin/page.premium.php:77
|
63 |
+
msgid "Settings"
|
64 |
+
msgstr ""
|
65 |
+
|
66 |
+
#: admin/class.settings.php:148
|
67 |
+
msgid "Use a custom filter for the_content"
|
68 |
+
msgstr ""
|
69 |
+
|
70 |
+
#: admin/class.settings.php:149
|
71 |
+
msgid ""
|
72 |
+
"If you're using a page builder and you're having issues toggle this setting "
|
73 |
+
"on. This will allow other plugins to use the WordPress 'the_content' filter "
|
74 |
+
"will we use our own custom version."
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: admin/class.settings.php:152
|
78 |
+
msgid "Toggle the_content filter."
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: admin/class.settings.php:157
|
82 |
+
msgid "Save Settings"
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: admin/class.support.php:44 admin/class.support.php:45
|
86 |
msgid "Support"
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: admin/class.support.php:73
|
90 |
#, php-format
|
91 |
msgid ""
|
92 |
+
"Before submitting a support request, please visit our %s where we have step-"
|
93 |
+
"by-step guides and troubleshooting help."
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: admin/class.support.php:74
|
97 |
+
msgid "Knowledge Base"
|
98 |
+
msgstr ""
|
99 |
+
|
100 |
+
#. //yikesplugins.com/plugin/custom-product-tabs-pro/.
|
101 |
+
#: admin/class.support.php:83
|
102 |
#, php-format
|
103 |
msgid ""
|
104 |
+
"Custom Product Tabs Pro users qualify for premium support. Check out %s!"
|
|
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: admin/class.support.php:92
|
108 |
msgid "WordPress.org Support Forums"
|
109 |
msgstr ""
|
110 |
|
111 |
+
#: admin/class.support.php:99
|
112 |
#, php-format
|
113 |
msgid ""
|
114 |
"If you need help with free Custom Product Tabs, please post questions to "
|
115 |
+
"%ss. We aim to respond to support requests within a week."
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: admin/class.support.php:100
|
119 |
+
msgid "our support forum on the WordPress Plugin Directory"
|
120 |
msgstr ""
|
121 |
|
122 |
+
#: admin/class.support.php:107
|
123 |
msgid "Submit a Support Request"
|
124 |
msgstr ""
|
125 |
|
126 |
+
#: admin/class.yikes-woo-generate-html.php:70
|
127 |
+
#: admin/class.yikes-woo-generate-html.php:217
|
128 |
+
#: admin/page.yikes-woo-saved-tabs-single.php:63
|
129 |
+
#: admin/page.yikes-woo-saved-tabs.php:59
|
130 |
+
#: admin/page.yikes-woo-saved-tabs.php:79
|
131 |
msgid "Tab Title"
|
132 |
msgstr ""
|
133 |
|
134 |
+
#: admin/class.yikes-woo-generate-html.php:70
|
135 |
+
#: admin/class.yikes-woo-generate-html.php:217
|
136 |
msgid "Custom Tab Title"
|
137 |
msgstr ""
|
138 |
|
139 |
+
#: admin/class.yikes-woo-generate-html.php:133
|
140 |
msgid ""
|
141 |
"For help using Custom Tabs please visit our <a href='https://yikesplugins."
|
142 |
"com/support/knowledge-base/product/easy-custom-product-tabs-for-"
|
143 |
"woocommerce/' target='_blank'>Knowledge Base</a>"
|
144 |
msgstr ""
|
145 |
|
146 |
+
#: admin/class.yikes-woo-generate-html.php:135
|
147 |
msgid "Help Me!"
|
148 |
msgstr ""
|
149 |
|
150 |
+
#: admin/class.yikes-woo-generate-html.php:160
|
|
|
151 |
msgid "Check this box to override the saved tab"
|
152 |
msgstr ""
|
153 |
|
154 |
+
#: admin/class.yikes-woo-generate-html.php:162
|
155 |
msgid " Override Saved Tab"
|
156 |
msgstr ""
|
157 |
|
158 |
+
#: admin/class.yikes-woo-generate-html.php:170
|
159 |
+
#: admin/class.yikes-woo-generate-html.php:255
|
160 |
+
#: admin/class.yikes-woo-generate-html.php:288
|
161 |
msgid "Remove Tab"
|
162 |
msgstr ""
|
163 |
|
164 |
+
#: admin/class.yikes-woo-generate-html.php:173
|
165 |
+
#: admin/class.yikes-woo-generate-html.php:290
|
166 |
+
msgid "Move tab order"
|
167 |
+
msgstr ""
|
168 |
+
|
169 |
+
#: admin/class.yikes-woo-generate-html.php:175
|
170 |
+
#: admin/class.yikes-woo-generate-html.php:292
|
171 |
+
msgid "Move up"
|
172 |
+
msgstr ""
|
173 |
+
|
174 |
+
#: admin/class.yikes-woo-generate-html.php:177
|
175 |
+
#: admin/class.yikes-woo-generate-html.php:294
|
176 |
+
msgid "Move tab up"
|
177 |
+
msgstr ""
|
178 |
+
|
179 |
+
#: admin/class.yikes-woo-generate-html.php:179
|
180 |
+
#: admin/class.yikes-woo-generate-html.php:296
|
181 |
+
msgid "Move down"
|
182 |
+
msgstr ""
|
183 |
+
|
184 |
+
#: admin/class.yikes-woo-generate-html.php:181
|
185 |
+
#: admin/class.yikes-woo-generate-html.php:298
|
186 |
+
msgid "Move tab down"
|
187 |
+
msgstr ""
|
188 |
+
|
189 |
+
#: admin/class.yikes-woo-generate-html.php:232
|
190 |
#: admin/class.yikes-woo-generate-html.php:269
|
191 |
msgid "Content"
|
192 |
msgstr ""
|
193 |
|
194 |
+
#: admin/class.yikes-woo-generate-html.php:233
|
195 |
#: admin/class.yikes-woo-generate-html.php:269
|
196 |
msgid "HTML and text to display."
|
197 |
msgstr ""
|
198 |
|
199 |
+
#: admin/class.yikes-woo-generate-html.php:341
|
|
|
|
|
|
|
|
|
200 |
msgid "Add a Tab"
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: admin/class.yikes-woo-generate-html.php:346
|
204 |
msgid "Add a Saved Tab"
|
205 |
msgstr ""
|
206 |
|
207 |
+
#: admin/class.yikes-woo-saved-tabs.php:58
|
208 |
+
msgid "Are you sure you want to delete this tab?"
|
209 |
+
msgstr ""
|
210 |
+
|
211 |
+
#: admin/class.yikes-woo-saved-tabs.php:59
|
212 |
+
msgid "Are you sure you want to delete these tabs? This cannot be undone."
|
213 |
+
msgstr ""
|
214 |
+
|
215 |
+
#: admin/class.yikes-woo-saved-tabs.php:67 admin/class.yikes-woo-tabs.php:64
|
216 |
+
#: admin/class.yikes-woo-tabs.php:73
|
217 |
msgid ""
|
218 |
"Sorry! An error has occurred while trying to retrieve the editor. Please "
|
219 |
"refresh the page and try again."
|
220 |
msgstr ""
|
221 |
|
222 |
+
#: admin/class.yikes-woo-saved-tabs.php:289
|
223 |
msgid "Could not find the tab. Please try again."
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: admin/class.yikes-woo-saved-tabs.php:293
|
227 |
msgid "Uh oh. Something went wrong."
|
228 |
msgstr ""
|
229 |
|
230 |
+
#: admin/class.yikes-woo-saved-tabs.php:507
|
231 |
+
#: admin/class.yikes-woo-saved-tabs.php:508
|
232 |
msgid "Custom Product Tabs"
|
233 |
msgstr ""
|
234 |
|
235 |
+
#: admin/class.yikes-woo-tabs.php:90
|
236 |
msgid "Custom Tabs"
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: admin/class.yikes-woo-tabs.php:331
|
240 |
+
msgid "Could not find the product!"
|
241 |
+
msgstr ""
|
242 |
+
|
243 |
+
#: admin/class.yikes-woo-tabs.php:338
|
244 |
+
msgid "Your tabs have been saved"
|
245 |
+
msgstr ""
|
246 |
+
|
247 |
+
#: admin/class.yikes-woo-tabs.php:340
|
248 |
+
msgid "Uh oh! Something went wrong with saving. Please try again."
|
249 |
+
msgstr ""
|
250 |
+
|
251 |
#: admin/page.premium.php:5
|
252 |
msgid "Custom Product Tabs for WooCommerce | Go Pro"
|
253 |
msgstr ""
|
319 |
"Assign saved tabs to products via the product's default bulk edit screen."
|
320 |
msgstr ""
|
321 |
|
|
|
|
|
|
|
|
|
322 |
#: admin/page.premium.php:79
|
323 |
msgid ""
|
324 |
"Remove the tab title from tab content site-wide without needing a filter"
|
349 |
msgstr ""
|
350 |
|
351 |
#: admin/page.yikes-woo-saved-tabs-single.php:29
|
352 |
+
msgid "Custom Product Tabs for WooCommerce "
|
353 |
+
msgstr ""
|
354 |
+
|
355 |
+
#: admin/page.yikes-woo-saved-tabs-single.php:29
|
356 |
+
msgid "New Tab"
|
357 |
+
msgstr ""
|
358 |
+
|
359 |
+
#: admin/page.yikes-woo-saved-tabs-single.php:30
|
360 |
+
#: admin/page.yikes-woo-saved-tabs.php:8
|
361 |
+
msgid "Add New"
|
362 |
msgstr ""
|
363 |
|
364 |
+
#: admin/page.yikes-woo-saved-tabs-single.php:35
|
365 |
msgid "Go Back to All Saved Tabs list"
|
366 |
msgstr ""
|
367 |
|
368 |
+
#: admin/page.yikes-woo-saved-tabs-single.php:51
|
369 |
msgid "Any updates made here will apply to all products using this tab."
|
370 |
msgstr ""
|
371 |
|
372 |
+
#: admin/page.yikes-woo-saved-tabs-single.php:71
|
373 |
+
#: admin/page.yikes-woo-saved-tabs.php:62
|
374 |
+
#: admin/page.yikes-woo-saved-tabs.php:82
|
375 |
msgid "Tab Name"
|
376 |
msgstr ""
|
377 |
|
378 |
+
#: admin/page.yikes-woo-saved-tabs-single.php:74
|
379 |
msgid "This is for your reference only."
|
380 |
msgstr ""
|
381 |
|
382 |
+
#: admin/page.yikes-woo-saved-tabs-single.php:80
|
383 |
msgid "Tab Content"
|
384 |
msgstr ""
|
385 |
|
386 |
+
#: admin/page.yikes-woo-saved-tabs-single.php:92
|
387 |
msgid "Save Tab"
|
388 |
msgstr ""
|
389 |
|
390 |
+
#: admin/page.yikes-woo-saved-tabs-single.php:95
|
391 |
+
#: admin/page.yikes-woo-saved-tabs.php:119
|
392 |
msgid "Delete Tab"
|
393 |
msgstr ""
|
394 |
|
396 |
msgid "Custom Product Tabs for WooCommerce | Saved Tabs"
|
397 |
msgstr ""
|
398 |
|
399 |
+
#: admin/page.yikes-woo-saved-tabs.php:22
|
400 |
msgid "Tab deleted!"
|
401 |
msgstr ""
|
402 |
|
403 |
#: admin/page.yikes-woo-saved-tabs.php:25
|
404 |
+
msgid "Dismiss this notice."
|
405 |
+
msgstr ""
|
406 |
+
|
407 |
+
#: admin/page.yikes-woo-saved-tabs.php:31
|
408 |
+
msgid "Create and save tabs that you can add to multiple products."
|
409 |
msgstr ""
|
410 |
|
411 |
+
#: admin/page.yikes-woo-saved-tabs.php:42
|
412 |
msgid "Select bulk action"
|
413 |
msgstr ""
|
414 |
|
415 |
+
#: admin/page.yikes-woo-saved-tabs.php:44
|
416 |
msgid "Bulk Actions"
|
417 |
msgstr ""
|
418 |
|
419 |
+
#: admin/page.yikes-woo-saved-tabs.php:45
|
420 |
msgid "Delete"
|
421 |
msgstr ""
|
422 |
|
423 |
+
#: admin/page.yikes-woo-saved-tabs.php:47
|
424 |
msgid "Apply"
|
425 |
msgstr ""
|
426 |
|
427 |
+
#: admin/page.yikes-woo-saved-tabs.php:55
|
428 |
+
#: admin/page.yikes-woo-saved-tabs.php:75
|
429 |
msgid "Select All"
|
430 |
msgstr ""
|
431 |
|
432 |
+
#: admin/page.yikes-woo-saved-tabs.php:65
|
433 |
+
#: admin/page.yikes-woo-saved-tabs.php:85
|
434 |
msgid "Tab Content Preview"
|
435 |
msgstr ""
|
436 |
|
437 |
+
#: admin/page.yikes-woo-saved-tabs.php:116
|
438 |
+
#: admin/page.yikes-woo-saved-tabs.php:128
|
439 |
msgid "Edit Tab"
|
440 |
msgstr ""
|
441 |
|
442 |
+
#: admin/page.yikes-woo-saved-tabs.php:139
|
443 |
msgid "There are no saved tabs. Add one!"
|
444 |
msgstr ""
|
445 |
|
463 |
msgid "yyyy-mm-dd"
|
464 |
msgstr ""
|
465 |
|
466 |
+
#: yikes-inc-easy-custom-woocommerce-product-tabs.php:56
|
467 |
+
#, php-format
|
468 |
+
msgid ""
|
469 |
+
"Please install and activate %1s before activating Custom WooCommerce Product "
|
470 |
+
"Tabs."
|
471 |
+
msgstr ""
|
472 |
+
|
473 |
+
#: yikes-inc-easy-custom-woocommerce-product-tabs.php:71
|
474 |
+
#, php-format
|
475 |
+
msgid "Please activate %1s before activating Custom WooCommerce Product Tabs."
|
476 |
+
msgstr ""
|
477 |
+
|
478 |
+
#: yikes-inc-easy-custom-woocommerce-product-tabs.php:311
|
479 |
+
msgid "Saved Tabs"
|
480 |
+
msgstr ""
|
481 |
+
|
482 |
+
#: yikes-inc-easy-custom-woocommerce-product-tabs.php:312
|
483 |
+
msgid "Documentation"
|
484 |
+
msgstr ""
|
485 |
+
|
486 |
+
#: yikes-inc-easy-custom-woocommerce-product-tabs.php:343
|
487 |
+
#, php-format
|
488 |
msgid ""
|
489 |
+
"Thank you for using Custom Product Tabs for WooCommerce. Please consider "
|
490 |
+
"leaving us %s on the WordPress.org plugin repository."
|
491 |
msgstr ""
|
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.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -75,204 +75,17 @@ Yes! Since v1.4 we've added the necessary code to ensure the custom tab data is
|
|
75 |
|
76 |
== Changelog ==
|
77 |
|
78 |
-
|
79 |
-
*
|
80 |
-
*
|
81 |
-
|
82 |
-
|
83 |
-
*
|
84 |
-
|
85 |
-
|
86 |
-
*
|
87 |
-
|
88 |
-
|
89 |
-
*
|
90 |
-
|
91 |
-
|
92 |
-
* WooCommerce 4.5.
|
93 |
-
|
94 |
-
= 1.7.3 – August 19th, 2020 =
|
95 |
-
* WooCommerce 4.4.
|
96 |
-
* Fixes issues related to WordPress 5.5.
|
97 |
-
|
98 |
-
= 1.7.1 – March 13th, 2020 =
|
99 |
-
* Fixes a bug with product display in certain conditions.
|
100 |
-
|
101 |
-
= 1.7.0 – March 10th, 2020 =
|
102 |
-
* Toggle the content filter on or off setting added. Use this to help with compatibility.
|
103 |
-
* Support WooCommerce 4.0.
|
104 |
-
* Support WordPress 5.4.
|
105 |
-
|
106 |
-
= 1.6.13 - January 22nd, 2020 =
|
107 |
-
* Support WooCommerce 3.9.
|
108 |
-
|
109 |
-
= 1.6.12 - November 20th, 2019 =
|
110 |
-
* Support WooCommerce 3.8.
|
111 |
-
|
112 |
-
= 1.6.11 - September 25th, 2019 =
|
113 |
-
* Adding additional checks to post global before enqueueing assets.
|
114 |
-
|
115 |
-
= 1.6.10 - April 19th, 2019 =
|
116 |
-
* Updating WC compatibility.
|
117 |
-
* Fixing JS issue with WP backwards compatibility for versions < 4.7.
|
118 |
-
|
119 |
-
= 1.6.9 - January 18th, 2019 =
|
120 |
-
* Fixing an issue where the visual editor shows a small portion of the content on product edit pages.
|
121 |
-
|
122 |
-
= 1.6.8 - January 2nd, 2019 =
|
123 |
-
* Fixing some HTML markup.
|
124 |
-
* Applying PHPCS fixes.
|
125 |
-
|
126 |
-
= 1.6.7 - December 18th, 2018 =
|
127 |
-
* Adding filter to help allow importing of custom tabs.
|
128 |
-
* Changing our export filters so custom tabs work with WooCommerce's native meta export/import features.
|
129 |
-
* The default capability for all admin pages is now `publish_products`.
|
130 |
-
|
131 |
-
= 1.6.6 - October 26th, 2018 =
|
132 |
-
* Bumping WooCo Compatibility.
|
133 |
-
* Changed `wp_send_json_failure()` to `wp_send_json_error()`.
|
134 |
-
|
135 |
-
= 1.6.5 - October 3rd, 2018 =
|
136 |
-
* Bumping WooCo Compatibility.
|
137 |
-
|
138 |
-
= 1.6.4 - January 9th, 2018 =
|
139 |
-
* Happy new year!
|
140 |
-
* The editor is now vertically resizeable.
|
141 |
-
* The default capability for interacting with saved tabs is now Publish Products (publish_products)
|
142 |
-
|
143 |
-
= 1.6.3 - November 1st, 2017 =
|
144 |
-
* Declaring compatibility with WooCommerce and WordPress
|
145 |
-
|
146 |
-
= 1.6.2 - October 13th, 2017 =
|
147 |
-
* Fixed a PHP Fatal Error that was occurring for users with PHP versions < 5.5.
|
148 |
-
* Updated some of our documentation and language
|
149 |
-
|
150 |
-
= 1.6.1 - October 12th, 2017 =
|
151 |
-
* Fixed an issue with handling foreign characters. Foreign character tab titles should be working properly now. Sorry about that everyone!
|
152 |
-
* Added support for native WooCommerce exporting. You can now export and import your tabs with just WooCommerce!
|
153 |
-
* Fixed some styling issues
|
154 |
-
* Added a new "Support" page
|
155 |
-
* Added a new "Go Pro" page - check out [Custom Product Tabs Pro](https://yikesplugins.com/plugin/custom-product-tabs-pro/)
|
156 |
-
|
157 |
-
= 1.6.0 - October 9th, 2017 =
|
158 |
-
* Complete re-organization of all plugin files and removal of legacy code
|
159 |
-
* Added a "name" field for saved tabs. This field is used only on the admin as a way of identifying tabs.
|
160 |
-
* Tab "slugs" are now created via the WP Core `sanitize_title()` function. This should allow meaningful tab slugs when foreign characters are used in a title.
|
161 |
-
* Re-added the "Add Media" button to the editor when it's first initialized. This had disappeared when WP4.8 was released.
|
162 |
-
* Fixed some issues with loading saved tab content into the editor. This should fix the issue that some users were experiencing where adding a saved tab would only work the second time.
|
163 |
-
* Setting the width of the editor to 100%.
|
164 |
-
* Custom Product Tabs is now a top-level menu item instead of a sub-menu item.
|
165 |
-
* Cleaning up the saved tab's array so we don't leave orphaned data (e.g. added a hook so we delete a product's tabs when the product is deleted)
|
166 |
-
* Added a data update script to update all existing tab slugs to use `sanitize_title()` function.
|
167 |
-
* Generated new POT file.
|
168 |
-
* Added support and hooks for our new Custom Product Tabs Pro plugin!
|
169 |
-
|
170 |
-
= 1.5.17 - August 23rd, 2017 =
|
171 |
-
* Cleaning up some PHP Notices being thrown - thanks to @ZombiEquinox on GitHub for reporting this
|
172 |
-
* Updating readme compatibility values
|
173 |
-
|
174 |
-
= 1.5.16 - August 1st, 2017 =
|
175 |
-
* Adding a proper deactivation hook. The plugin will leave no trace.
|
176 |
-
|
177 |
-
= 1.5.15 - June 8th, 2017 =
|
178 |
-
* WordPress 4.8 support - using the new JavaScript Editor API functions to instantiate the editor and removed requiring WordPress' wpembed plugin
|
179 |
-
|
180 |
-
= 1.5.14 - May 8th, 2017 =
|
181 |
-
* Updating some CSS for the admin tabs table - the table should now render correctly regardless of "Visual" or "Text" tab and the saved tabs list should include a scrollbar if necessary
|
182 |
-
|
183 |
-
= 1.5.13 - April 17th, 2017 =
|
184 |
-
* Updating a WooCommerce action - now using the proper one instead of a deprecated one
|
185 |
-
|
186 |
-
= 1.5.12 - April 10th, 2017 =
|
187 |
-
* Adding some CSS to allow the editor's text mode to function properly
|
188 |
-
|
189 |
-
= 1.5.11 - April 6th, 2017 =
|
190 |
-
* Checking for the existence of the `get_id()` method before using it.
|
191 |
-
|
192 |
-
= 1.5.10 - April 5th, 2017 =
|
193 |
-
* Duplicating a product now duplicates custom product tabs and saved tabs correctly
|
194 |
-
|
195 |
-
= 1.5.9 - April 4th, 2017 =
|
196 |
-
* Tested and updated the plugin for WooCommerce v3.0.0
|
197 |
-
|
198 |
-
= 1.5.8 - March 17th, 2017 =
|
199 |
-
* Replaced the saved tab's ID w/ an "Add New" button on the single saved tab page - it should be easier to add saved tabs in bulk now
|
200 |
-
* Added a filter for all of the custom tab content - it should allow you to apply custom logic such as permissions in one central location
|
201 |
-
* Changed the way saved tabs are applied on the edit product page - it should allow embed content (especially Google Maps Embed content) to function correctly in all instances.
|
202 |
-
|
203 |
-
= 1.5.7 - February 27th, 2017 =
|
204 |
-
* Duplicating a product now duplicates the corresponding saved tabs correctly
|
205 |
-
* Added two filters (`yikes_woo_use_the_content_filter` and `yikes_woo_filter_main_tab_content`) to help provide a work-around to using the standard `the_content` filter which has caused numerous issues due to plugin conflicts.
|
206 |
-
|
207 |
-
= 1.5.6 - February 16th, 2017 =
|
208 |
-
* Fixed an issue where the "Add a Saved Tab" modal was displaying YouTube videos if a saved tab had a YouTube URL in its content
|
209 |
-
|
210 |
-
= 1.5.5 - January 23rd, 2017 =
|
211 |
-
* Re-did 1.5.4 changes - checking for function existence before using it
|
212 |
-
|
213 |
-
= 1.5.4 - January 23rd, 2017 =
|
214 |
-
* Re-did 1.5.3 changes - `the_content` filter is reapplied and the specific Site Builder plugin's filters are
|
215 |
-
|
216 |
-
= 1.5.3 - January 23rd, 2017 =
|
217 |
-
* Replaced the use of `the_content` filter with the filter's associated functions (e.g. `wptexturize`, `wpautop`)
|
218 |
-
|
219 |
-
= 1.5.2 - December 23rd, 2016 =
|
220 |
-
* The editor should only default to the 'Visual' tab for our Custom Product Tabs (no other editors)
|
221 |
-
* Added all of the default WordPress settings to the editor
|
222 |
-
|
223 |
-
= 1.5.1 - December 22nd, 2016 =
|
224 |
-
* Fixed bug that caused content to be copied incorrectly when moving tabs up / down
|
225 |
-
* Only on the product page will the editor default to 'Visual' (instead of every page)
|
226 |
-
|
227 |
-
= 1.5 - December 20th, 2016 =
|
228 |
-
* Version 1.5 includes a brand new feature - saved tabs - as well as a number of bug fixes, style tweaks, code clean-up, and comments
|
229 |
-
* UI: Complete overhaul of the custom tab interface for an easier, responsive tab creating experience.
|
230 |
-
* Saved Tabs: A new settings page has been added for users to create / update / delete saved tabs (see FAQ for more information)
|
231 |
-
* Saved Tabs: On the product edit page, a new button ('Add a Saved Tab') has been added that allows you to choose one of your saved tabs and add it to the current product
|
232 |
-
* Adding a new tab initializes a new wp_editor (WYSIWYG) instead of a plain textarea
|
233 |
-
* Added warning message when two tabs have the same title
|
234 |
-
* Tabs with empty titles are no longer shown on the product page
|
235 |
-
* Added ability to remove the first tab
|
236 |
-
* Adding, moving, and removing tabs works as expected when the user's 'Visual Editor' option is checked
|
237 |
-
* On the product & settings pages, WYSIWYG editors will default to the visual tab (this helps prevent errors with dynamic wp_editor generation)
|
238 |
-
* Added a filter `yikes_woocommerce_default_editor_mode` that can change the default-to-visual-tab behavior (use at your own risk!)
|
239 |
-
* Updated the 'How To' text, and slight modification to the style
|
240 |
-
* Changed the JavaScript methods controlling how tabs were added, deleted, and moved up/down
|
241 |
-
* Cleaned up and commented on all PHP and JavaScript files
|
242 |
-
* Added proper i18n, with languages/ folder, .pot file, and `load_plugin_textdomain` hook
|
243 |
-
* Incremented version #
|
244 |
-
|
245 |
-
= 1.4.4 - March 1st, 2016 =
|
246 |
-
* Re-named the tab ID's to support URL's with query args (eg: http://www.example.com/shop#tab-reviews)
|
247 |
-
|
248 |
-
= 1.4.3 - February 18th, 2016 =
|
249 |
-
* Wrapped missing 'Custom Tab Title' in localization/translation functions. (Plugin is now 100% translatable)
|
250 |
-
* Removed i18n class files, and old .po/.mo files (less bloat)
|
251 |
-
|
252 |
-
= 1.4.2 - February 17th, 2016 =
|
253 |
-
* Updated the internationalization strings ( `yikes-inc-woocommerce-custom-product-tabs` to `yikes-inc-easy-custom-woocommerce-product-tabs` )
|
254 |
-
|
255 |
-
= 1.4.1 - August 20th, 2015 =
|
256 |
-
* Fixed conflict with other CSV export plugins for WooCommerce
|
257 |
-
* Now custom product tab and row data/headers only get exported via 'Tools > Export > Products'
|
258 |
-
|
259 |
-
= 1.4 - July 29th, 2015 =
|
260 |
-
* Enhancement: Added the 'Custom Product Tabs for WooCommerce ' data to the standard WooCommerce export file, so custom tab data can be transferred between sites smoothly.
|
261 |
-
|
262 |
-
= 1.3 - July 21st, 2015 =
|
263 |
-
* Enhancement: Enabled WYSIWYG editor on tab content containers (enables shortcode and content to pass through the_content() filter)
|
264 |
-
* Updated repo screenshots and descriptions
|
265 |
-
|
266 |
-
= 1.2 - March 18th, 2015 =
|
267 |
-
* Enhancement: Fixed issue where non utf8 characters in tab titles caused front end not to generate the tabs
|
268 |
-
* Enhancement: When user doesn't have WooCommerce installed, they are now redirected to the plugin install search page, with WooCommerce at the top.
|
269 |
-
|
270 |
-
= 1.1 =
|
271 |
-
* Added class to the Woo tabs content title, for targeting via CSS ( `.yikes-custom-woo-tab-title` )
|
272 |
-
|
273 |
-
= 1.0.0 =
|
274 |
-
* Initial Release
|
275 |
-
|
276 |
-
== Upgrade Notice ==
|
277 |
-
= 1.4.4 - March 1st, 2016 =
|
278 |
-
* Re-named the tab ID's to support URL's with query args (eg: http://www.example.com/shop#tab-reviews)
|
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.8.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
75 |
|
76 |
== Changelog ==
|
77 |
|
78 |
+
* Bump WC tested up to to 6.0.
|
79 |
+
* Update Custom Tabs page styles.
|
80 |
+
* Move full changelog to a changelog.txt file.
|
81 |
+
* Updated a few strings throughout the plugin.
|
82 |
+
* Tweaked README.md.
|
83 |
+
* Escape missed text, attributes and html.
|
84 |
+
* Wrap additional strings in gettext functions for translation.
|
85 |
+
* Regenerated .pot file.
|
86 |
+
* Added a conditional 2 column layout on the admin pages.
|
87 |
+
* Refactored the tab save method to account for new select2 fields in pro.
|
88 |
+
* Tweak the styles on the WooCommerce Custom Tabs section.
|
89 |
+
* Tweaked the markup so that when a new tab is added the button holder width is correct.
|
90 |
+
* Update button styles to match WooCommerce branding.
|
91 |
+
* Add custom admin footer text on our pages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yikes-inc-easy-custom-woocommerce-product-tabs.php
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Custom Product Tabs for WooCommerce
|
4 |
-
* Plugin URI:
|
5 |
* Description: Extend WooCommerce to add and manage custom product tabs. Create as many product tabs as needed per product.
|
6 |
* Author: YIKES, Inc.
|
7 |
-
* Author URI:
|
8 |
-
* Version: 1.
|
9 |
* Text Domain: yikes-inc-easy-custom-woocommerce-product-tabs
|
10 |
* Domain Path: languages/
|
11 |
*
|
12 |
* WC requires at least: 3.0.0
|
13 |
-
* WC tested up to:
|
14 |
*
|
15 |
-
* Copyright: (c) 2014-
|
16 |
*
|
17 |
* License: GNU General Public License v3.0
|
18 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -21,7 +21,9 @@
|
|
21 |
*/
|
22 |
|
23 |
// Exit if accessed directly.
|
24 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
25 |
|
26 |
// Must include plugin.php to use is_plugin_active().
|
27 |
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
@@ -49,16 +51,31 @@ function yikes_woo_display_admin_notice_error() {
|
|
49 |
<div class="error">
|
50 |
<p>
|
51 |
<?php
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
?>
|
60 |
</p>
|
61 |
-
</div>
|
62 |
<?php
|
63 |
}
|
64 |
|
@@ -105,7 +122,14 @@ class YIKES_Custom_Product_Tabs {
|
|
105 |
* Define the plugin's version.
|
106 |
*/
|
107 |
if ( ! defined( 'YIKES_Custom_Product_Tabs_Version' ) ) {
|
108 |
-
define( 'YIKES_Custom_Product_Tabs_Version', '1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
}
|
110 |
|
111 |
/**
|
@@ -267,6 +291,8 @@ class YIKES_Custom_Product_Tabs {
|
|
267 |
|
268 |
// Add settings link to plugin on plugins page.
|
269 |
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'add_plugin_action_links' ), 10, 1 );
|
|
|
|
|
270 |
}
|
271 |
|
272 |
/**
|
@@ -279,11 +305,49 @@ class YIKES_Custom_Product_Tabs {
|
|
279 |
* @return array $links The $links array, with our saved tabs page appended.
|
280 |
*/
|
281 |
public function add_plugin_action_links( $links ) {
|
282 |
-
$href
|
283 |
-
$
|
|
|
|
|
|
|
|
|
284 |
return $links;
|
285 |
}
|
286 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
/**
|
288 |
* Register the textdomain for proper i18n / l10n.
|
289 |
*/
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Custom Product Tabs for WooCommerce
|
4 |
+
* Plugin URI: https://www.yikesinc.com
|
5 |
* Description: Extend WooCommerce to add and manage custom product tabs. Create as many product tabs as needed per product.
|
6 |
* Author: YIKES, Inc.
|
7 |
+
* Author URI: https://www.yikesinc.com
|
8 |
+
* Version: 1.8.0
|
9 |
* Text Domain: yikes-inc-easy-custom-woocommerce-product-tabs
|
10 |
* Domain Path: languages/
|
11 |
*
|
12 |
* WC requires at least: 3.0.0
|
13 |
+
* WC tested up to: 6.0
|
14 |
*
|
15 |
+
* Copyright: (c) 2014-2022 YIKES Inc.
|
16 |
*
|
17 |
* License: GNU General Public License v3.0
|
18 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
21 |
*/
|
22 |
|
23 |
// Exit if accessed directly.
|
24 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
25 |
+
exit;
|
26 |
+
}
|
27 |
|
28 |
// Must include plugin.php to use is_plugin_active().
|
29 |
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
51 |
<div class="error">
|
52 |
<p>
|
53 |
<?php
|
54 |
+
$message = sprintf(
|
55 |
+
/* translators: The placeholder is a URL to the WooCommerce plugin. */
|
56 |
+
__( 'Please install and activate %1s before activating Custom WooCommerce Product Tabs.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
57 |
+
'<a href="' . esc_url( admin_url( 'plugin-install.php?tab=search&type=term&s=WooCommerce' ) ) . '" title="WooCommerce">WooCommerce</a>'
|
58 |
+
);
|
59 |
+
|
60 |
+
if ( file_exists( WP_PLUGIN_DIR . '/woocommerce/woocommerce.php' ) ) {
|
61 |
+
$activate_url = add_query_arg(
|
62 |
+
array(
|
63 |
+
'action' => 'activate',
|
64 |
+
'plugin' => 'woocommerce/woocommerce.php',
|
65 |
+
'_wpnonce' => wp_create_nonce( 'activate-plugin_woocommerce/woocommerce.php' )
|
66 |
+
),
|
67 |
+
admin_url( 'plugins.php' )
|
68 |
+
);
|
69 |
+
$message = sprintf(
|
70 |
+
/* translators: The placeholder is a URL to the WooCommerce plugin. */
|
71 |
+
__( 'Please activate %1s before activating Custom WooCommerce Product Tabs.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
72 |
+
'<a href="' . esc_url( $activate_url ) . '" title="WooCommerce">WooCommerce</a>'
|
73 |
+
);
|
74 |
+
}
|
75 |
+
echo $message;
|
76 |
?>
|
77 |
</p>
|
78 |
+
</div>
|
79 |
<?php
|
80 |
}
|
81 |
|
122 |
* Define the plugin's version.
|
123 |
*/
|
124 |
if ( ! defined( 'YIKES_Custom_Product_Tabs_Version' ) ) {
|
125 |
+
define( 'YIKES_Custom_Product_Tabs_Version', '1.8.0' );
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Define the bundled lity.js version
|
130 |
+
*/
|
131 |
+
if ( ! defined( 'YIKES_Custom_Product_LITY_Version' ) ) {
|
132 |
+
define( 'YIKES_Custom_Product_LITY_Version', '2.4.1' );
|
133 |
}
|
134 |
|
135 |
/**
|
291 |
|
292 |
// Add settings link to plugin on plugins page.
|
293 |
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'add_plugin_action_links' ), 10, 1 );
|
294 |
+
|
295 |
+
add_filter( 'admin_footer_text', array( $this, 'yikes_custom_product_tabs_admin_footer_text' ) );
|
296 |
}
|
297 |
|
298 |
/**
|
305 |
* @return array $links The $links array, with our saved tabs page appended.
|
306 |
*/
|
307 |
public function add_plugin_action_links( $links ) {
|
308 |
+
$href = add_query_arg( array( 'page' => YIKES_Custom_Product_Tabs_Settings_Page ), admin_url( 'admin.php' ) );
|
309 |
+
$docs_url = 'https://yikesplugins.com/article-category/custom-product-tabs-for-woocommerce/';
|
310 |
+
|
311 |
+
$links[] = '<a href="' . esc_url_raw( $href ) . '">' . esc_html__( 'Saved Tabs', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</a>';
|
312 |
+
$links[] = '<a href="' . esc_url_raw( $docs_url ) . '" target="_blank">' . esc_html__( 'Documentation', 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</a>';
|
313 |
+
|
314 |
return $links;
|
315 |
}
|
316 |
|
317 |
+
/**
|
318 |
+
* Admin footer text on Yikes pages.
|
319 |
+
*
|
320 |
+
* @param string $footer_text Admin footer text.
|
321 |
+
*
|
322 |
+
* @return string Filtered admin footer text.
|
323 |
+
*/
|
324 |
+
public function yikes_custom_product_tabs_admin_footer_text( $footer_text ) {
|
325 |
+
|
326 |
+
$page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING );
|
327 |
+
|
328 |
+
$allowed_pages = array(
|
329 |
+
'yikes-woo-settings',
|
330 |
+
'yikes-woo-support',
|
331 |
+
'yikes-woo-premium',
|
332 |
+
);
|
333 |
+
|
334 |
+
if ( ! $page || ! in_array( $page, $allowed_pages, true ) ) {
|
335 |
+
|
336 |
+
return $footer_text;
|
337 |
+
|
338 |
+
}
|
339 |
+
|
340 |
+
$stars = '<a href="https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs/reviews/" alt="Custom Product Tabs for WooCommerce | WordPress.org" target="_blank"><span class="dashicons dashicons-star-filled yikes-star"></span><span class="dashicons dashicons-star-filled yikes-star"></span><span class="dashicons dashicons-star-filled yikes-star"></span><span class="dashicons dashicons-star-filled yikes-star"></span><span class="dashicons dashicons-star-filled yikes-star"></span></a>';
|
341 |
+
|
342 |
+
$footer_text = sprintf(
|
343 |
+
__( 'Thank you for using Custom Product Tabs for WooCommerce. Please consider leaving us %s on the WordPress.org plugin repository.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
|
344 |
+
$stars
|
345 |
+
);
|
346 |
+
|
347 |
+
return wp_kses_post( $footer_text );
|
348 |
+
|
349 |
+
}
|
350 |
+
|
351 |
/**
|
352 |
* Register the textdomain for proper i18n / l10n.
|
353 |
*/
|