Custom Product Tabs for WooCommerce - Version 1.8.0

Version Description

Download this release

Release Info

Developer eherman24
Plugin Icon 128x128 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 CHANGED
@@ -1,121 +1,133 @@
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
-
28
- wp_enqueue_style ( 'lightslider-styles', YIKES_Custom_Product_Tabs_URI . 'slider/css/lightslider.min.css' );
29
- wp_enqueue_style ( 'repeatable-custom-tabs-styles', YIKES_Custom_Product_Tabs_URI . 'css/repeatable-custom-tabs.min.css' );
30
- wp_enqueue_script( 'lightslider-scripts', YIKES_Custom_Product_Tabs_URI . 'slider/js/lightslider.min.js', array( 'jquery' ), YIKES_Custom_Product_Tabs_Version );
31
- wp_enqueue_script( 'premium-scripts', YIKES_Custom_Product_Tabs_URI . 'js/premium.min.js', array( 'lightslider-scripts' ), YIKES_Custom_Product_Tabs_Version );
32
- wp_enqueue_style ( 'repeatable-custom-tabs-styles' , YIKES_Custom_Product_Tabs_URI . 'css/repeatable-custom-tabs.min.css', '', YIKES_Custom_Product_Tabs_Version, 'all' );
33
- }
34
  }
 
35
 
36
- /**
37
- * Register our premium page
38
- */
39
- public function register_premium_subpage() {
40
-
41
- if ( defined( 'YIKES_Custom_Product_Tabs_Pro_Enabled' ) ) {
42
- return;
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
- * Include our settings page
58
- */
59
- public function premium_page() {
 
 
 
 
 
 
 
 
 
 
 
60
 
61
- require_once YIKES_Custom_Product_Tabs_Path . 'admin/page.premium.php';
 
 
 
 
 
 
 
 
 
62
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
- /**
65
- * Display an ad for CPTPRO on the saved tabs list and saved tabs single pages
66
- */
67
- public function display_cptpro_ad() {
68
-
69
- if ( defined( 'YIKES_Custom_Product_Tabs_Pro_Enabled' ) ) {
70
- return;
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
- <?php
117
- }
118
-
 
119
  }
 
 
120
 
121
- new YIKES_Custom_Product_Tabs_Premium();
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
- * 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
- $extention = ! defined( 'SCRIPT_DEBUG' ) ? '.min' : '';
67
-
68
- wp_register_script( 'yikes-cpt-settings-modal', YIKES_Custom_Product_Tabs_URI . "js/settings{$extention}.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">Settings</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>Toggle the_content filter.
152
- <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 ); ?> />
153
- </label>
154
- <p>
155
- <a id="yikes-woo-toggle-content" class="button button-primary" href="https://yikesplugins.com/plugin/custom-product-tabs-pro/" target="_blank">
156
- <?php _e( 'Save Settings', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
157
- </a>
158
- </div><!-- .yikes-woo-buy-us-body -->
159
- </div>
160
- <?php
161
- }
162
-
163
- /**
164
- * Check if we should use the filter
165
- */
166
- public function maybe_use_the_content_filter() {
167
- return 'true' === get_option( 'yikes_cpt_use_the_content' );
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
- wp_enqueue_style( 'repeatable-custom-tabs-styles' , YIKES_Custom_Product_Tabs_URI . 'css/repeatable-custom-tabs.min.css', '', YIKES_Custom_Product_Tabs_Version, 'all' );
 
 
 
30
  }
31
  }
32
 
@@ -64,30 +67,38 @@
64
  ?>
65
  <div class="cptpro-settings cptpro-settings-support-help-container">
66
  <p>
67
- <?php
68
- echo sprintf( __( 'Before submitting a support request, please visit our %1sKnowledge Base%2s where we have step-by-step guides and troubleshooting help.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
69
- '<a href="https://yikesplugins.com/support/knowledge-base/product/easy-custom-product-tabs-for-woocommerce/" target="_blank">', '</a>' );
 
 
 
70
  ?>
71
  </p>
72
 
73
  <p>
74
- <?php
75
- echo sprintf( __( 'Custom Product Tabs Pro users qualify for premium support. Check out %1sCustom Product Tabs Pro%2s!', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
76
- '<a href="https://yikesplugins.com/plugin/custom-product-tabs-pro/" target="_blank">', '</a>' );
 
 
 
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
- echo sprintf( __( 'If you need help with free Custom Product Tabs, please post questions to %1sour support forum on the WordPress Plugin Directory%2s. We aim to respond to support requests within a week.', 'yikes-inc-easy-custom-woocommerce-product-tabs' ),
90
- '<a href="https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs#new-post" target="_blank">', '</a>' );
 
 
 
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
- // Tab title input field
71
- 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' ) );
72
-
73
- // WYSIWYG Content field
74
- $this->display_woocommerce_wp_wysiwyg_input_duplicate();
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="' . __( 'Check this box to override the saved tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '">';
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 .= __( ' Override Saved Tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' );
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 .= '<div class="yikes_wc_move_tab_container">';
175
- $return_html .= '<p class="yikes_wc_move_tab">Move tab order</p>';
176
- $return_html .= '<span class="dashicons dashicons-arrow-up move-tab-data-up"></span>';
177
- $return_html .= '<span class="dashicons dashicons-arrow-down move-tab-data-down"></span>';
178
- $return_html .= '</div>';
179
- $return_html .= '<a href="#" onclick="return false;" class="button-secondary remove_this_tab"><span class="dashicons dashicons-no-alt"></span>';
180
- $return_html .= __( 'Remove Tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' );
181
- $return_html .= '</a>';
 
 
 
 
 
 
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
- $return_html .= '<section class="button-holder" alt="">';
283
- $return_html .= '<p class="yikes_wc_override_reusable_tab_container _yikes_wc_override_reusable_tab_container_duplicate" id="_yikes_wc_override_reusable_tab_container_duplicate" style="display: none;">';
284
- $return_html .= '<input type="checkbox" class="_yikes_wc_override_reusable_tab" id="_yikes_wc_override_reusable_tab_duplicate" title="' . __( 'Check this box to override the saved tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '" />';
285
- $return_html .= '<label class="_yikes_wc_override_reusable_tab_label_duplicate">' . __( 'Override Saved Tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' ) . '</label>';
286
- $return_html .= '<input type="hidden" class="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_action" id="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_action_duplicate" value="none">';
287
- $return_html .= '<input type="hidden" class="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id" id="_yikes_wc_custom_repeatable_product_tabs_saved_tab_id_duplicate" value="">';
288
- $return_html .= '</p>';
289
- $return_html .= '<div class="yikes_wc_move_tab_container">';
290
- $return_html .= '<p class="yikes_wc_move_tab">Move tab order</p>';
291
- $return_html .= '<span class="dashicons dashicons-arrow-up move-tab-data-up"></span>';
292
- $return_html .= '<span class="dashicons dashicons-arrow-down move-tab-data-down"></span>';
293
- $return_html .= '</div>';
294
- $return_html .= '<a href="#" onclick="return false;" class="button-secondary remove_this_tab">';
295
- $return_html .= '<span class="dashicons dashicons-no-alt"></span>';
296
- $return_html .= __( 'Remove Tab' , 'yikes-inc-easy-custom-woocommerce-product-tabs' );
297
- $return_html .= '</a>';
298
- $return_html .= '</section>';
299
-
300
- return $return_html;
 
 
 
 
 
 
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 '<p class="form-field-tinymce ' . $field['id'] . '_field"> <textarea class="' . $field['class'] . '" name="' . $field['id'] . '" id="' . $field['id'] . '" placeholder="' . $field['placeholder'] . '" rows="2" cols="20"' . (isset( $field['style'] ) ? ' style="' . $field['style'] . '"' : '') . '>' . $field['value'] . '</textarea> ';
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 . 'js/repeatable-custom-tabs-settings.min.js', array( 'jquery' ), YIKES_Custom_Product_Tabs_Version );
49
  wp_localize_script( 'repeatable-custom-tabs-settings', 'repeatable_custom_tabs_settings', array(
50
- 'loading_gif' => '<img src="' . admin_url( 'images/loading.gif' ) . '" alt="preloader" class="loading-wp-editor-gif-settings" />',
51
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
52
- 'tab_list_page_url' => esc_url_raw( add_query_arg( array( 'page' => YIKES_Custom_Product_Tabs_Settings_Page ), admin_url() ) ),
53
- 'save_tab_as_reusable_nonce' => wp_create_nonce( 'yikes_woo_save_tab_as_reusable_nonce' ),
54
- 'delete_reusable_tab_nonce' => wp_create_nonce( 'yikes_woo_delete_reusable_tab_nonce' ),
55
- 'is_cptpro_enabled' => defined( 'YIKES_Custom_Product_Tabs_Pro_Enabled' ) ? true : false,
 
 
56
  ) );
57
 
58
- wp_enqueue_script ( 'repeatable-custom-tabs-shared', YIKES_Custom_Product_Tabs_URI . 'js/repeatable-custom-tabs-shared.min.js', array( 'jquery' ), YIKES_Custom_Product_Tabs_Version );
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 . 'js/twitter-embed.js', null, YIKES_Custom_Product_Tabs_Version );
68
 
69
  // CSS
70
- wp_enqueue_style( 'repeatable-custom-tabs-styles' , YIKES_Custom_Product_Tabs_URI . 'css/repeatable-custom-tabs.min.css', '', YIKES_Custom_Product_Tabs_Version, 'all' );
 
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
- wp_send_json_error();
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
- wp_send_json_error();
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
- wp_send_json_error();
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 . 'js/repeatable-custom-tabs.min.js' , array( 'jquery' ) , YIKES_Custom_Product_Tabs_Version );
52
  wp_localize_script( 'repeatable-custom-tabs', 'repeatable_custom_tabs', array(
53
- 'loading_gif' => '<img src="' . admin_url( 'images/loading.gif' ) . '" alt="preloader" class="loading-wp-editor-gif" />',
54
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
55
- 'get_wp_editor_security_nonce' => wp_create_nonce( 'yikes_woo_get_wp_editor_nonce' ),
56
- 'save_tab_as_reusable_nonce' => wp_create_nonce( 'yikes_woo_save_tab_as_reusable_nonce' ),
57
- 'fetch_reusable_tabs_nonce' => wp_create_nonce( 'yikes_woo_fetch_reusable_tabs_nonce' ),
58
- 'fetch_reusable_tab_nonce' => wp_create_nonce( 'yikes_woo_fetch_reusable_tab_nonce' ),
59
- 'delete_reusable_tab_nonce' => wp_create_nonce( 'yikes_woo_delete_reusable_tab_nonce' ),
60
- 'save_product_tabs_nonce' => wp_create_nonce( 'yikes_woo_save_product_tabs_nonce' ),
61
- 'global_post_id' => $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' => $wp_version >= '4.8',
64
  ) );
65
 
66
- wp_enqueue_script ( 'repeatable-custom-tabs-shared', YIKES_Custom_Product_Tabs_URI . 'js/repeatable-custom-tabs-shared.min.js', array( 'jquery' ), YIKES_Custom_Product_Tabs_Version );
67
  wp_localize_script( 'repeatable-custom-tabs-shared', 'repeatable_custom_tabs_shared', array(
68
- 'loading_gif' => '<img src="' . admin_url( 'images/loading.gif' ) . '" alt="preloader" class="loading-wp-editor-gif" />',
69
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
70
- 'get_wp_editor_security_nonce' => wp_create_nonce( 'yikes_woo_get_wp_editor_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 . 'css/repeatable-custom-tabs.min.css', '', YIKES_Custom_Product_Tabs_Version, 'all' );
76
 
77
  // JS lity modal library and CSS
78
- wp_enqueue_script( 'lity-js', YIKES_Custom_Product_Tabs_URI . 'js/lity.min.js' , array( 'jquery' ) , YIKES_Custom_Product_Tabs_Version );
79
- wp_enqueue_style( 'lity-css', YIKES_Custom_Product_Tabs_URI . 'css/dist/lity.min.css' );
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 "<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>";
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
- wp_send_json_error();
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
- wp_send_json_error();
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 _e( 'Custom Product Tabs for WooCommerce | Support', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
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 = 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
  <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
- <span class="yikes_woo_add_another_tab page-title-action" id="yikes_woo_add_another_tab">
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="cptpro-settings cptpro-savedtabs-pro-container cptpro-savedtabs-single-pro-container <?php do_action( 'yikes-woo-saved-tabs-table-classes' ); ?>">
34
- <div class="yikes_woo_go_back_url">
35
- <span class="dashicons dashicons-arrow-left-alt"></span> <a href="<?php echo $redirect; ?>">
36
- <?php _e( 'Go Back to All Saved Tabs list', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
37
- </a>
38
- </div>
39
 
40
- <div id="poststuff">
41
 
42
- <?php if ( $new_tab !== true ) { ?>
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
- <?php do_action( 'yikes-woo-display-too-many-products-warning' ); ?>
 
52
 
53
- <div class="row yikes_woo_reusable_tabs_container" id="yikes_woo_reusable_tabs_container_<?php echo $tab_id ?>" data-tab-id="<?php echo $tab_id; ?>">
 
 
 
 
 
 
 
 
54
 
55
- <!-- Title -->
56
- <div class="yikes_woo_reusable_tab_title">
57
- <label class="yikes_woo_reusable_tab_title_label" for="yikes_woo_reusable_tab_title_<?php echo $tab_id; ?>">
58
- <h3><?php _e( 'Tab Title', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></h3>
59
- </label>
60
- <input type="text" id="yikes_woo_reusable_tab_title_<?php echo $tab_id; ?>" value="<?php echo $tab_title; ?>" />
61
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
- <?php do_action( 'yikes-woo-saved-tab-before-save-buttons', $saved_tab_id, $taxonomies, $global ); ?>
83
-
84
- <!-- Buttons -->
85
- <div class="yikes_woo_save_and_delete_tab_buttons">
86
- <span class="button button-primary yikes_woo_save_this_tab" id="yikes_woo_save_this_tab_<?php echo $tab_id; ?>" data-tab-id="<?php echo $tab_id; ?>">
87
- <?php _e( 'Save Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
88
- </span>
89
- <span class="button button-secondary yikes_woo_delete_this_tab yikes_woo_delete_this_tab_single" id="yikes_woo_delete_this_tab_<?php echo $tab_id; ?>" data-tab-id="<?php echo $tab_id; ?>">
90
- <i class="dashicons dashicons-dismiss inline-button-dashicons"></i>
91
- <?php _e( 'Delete Tab', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
92
- </span>
 
93
  </div>
94
-
 
95
  </div>
 
96
 
97
- <?php do_action( 'yikes-woo-saved-tab-after-save-buttons', $saved_tab_id ); ?>
98
- </div><!-- #poststuff -->
99
 
 
100
  </div>
 
101
 
102
- <?php do_action( 'yikes-woo-saved-tabs-list-ad' ); ?>
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 echo __( 'Custom Product Tabs for WooCommerce | Saved Tabs', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
6
- <span class="yikes_woo_add_another_tab page-title-action" id="yikes_woo_add_another_tab">
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
- <div class="yikes_woo_settings_info">
24
- <p>
25
- <?php _e( "Create and save tabs you can add to multiple products.", 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
26
- </p>
27
- </div>
28
 
29
- <?php do_action( 'yikes-woo-display-too-many-products-warning' ); ?>
 
30
 
31
- <div id="poststuff" class="yikes-saved-tabs-row">
32
 
33
- <!-- Bulk Actions -->
34
- <div class="tablenav top">
35
- <div class="alignleft actions bulkactions">
36
- <label for="bulk-action-selector-top" class="screen-reader-text"><?php _e( 'Select bulk action', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></label>
37
- <select name="action" id="bulk-action-selector-top">
38
- <option value="-1"><?php _e( 'Bulk Actions', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></option>
39
- <option value="delete" class="hide-if-no-js"><?php _e( 'Delete', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></option>
40
- </select>
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
- <br class="clear">
44
- </div>
45
- <table id="yikes-woo-saved-tabs-list-table" class="widefat fixed" cellspacing="0">
46
- <thead>
47
- <tr>
48
- <td id="cb" class="manage-column column-cb check-column" scope="col">
49
- <label class="screen-reader-text" for="cb-select-all-1"><?php _e( 'Select All', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></label>
50
- <input id="cb-select-all-1" type="checkbox">
51
- </td>
52
- <th class="manage-column column-tab-title" scope="col">
53
- <?php _e( 'Tab Title', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
54
- </th>
55
- <th class="manage-column column-tab-name" scope="col">
56
- <?php _e( 'Tab Name', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
57
- </th>
58
- <th class="manage-column column-tab-content-preview" scope="col">
59
- <?php _e( 'Tab Content Preview', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
60
- </th>
61
- <?php do_action( 'yikes-woo-saved-tabs-table-header' ); ?>
62
- <th class="manage-column column-edit" scope="col">&nbsp;</th>
63
- </tr>
64
- </thead>
65
-
66
- <tfoot>
67
- <tr>
68
- <td id="cb" class="manage-column column-cb check-column" scope="col">
69
- <label class="screen-reader-text" for="cb-select-all-1"><?php _e( 'Select All', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?></label>
70
- <input id="cb-select-all-1" type="checkbox">
71
- </td>
72
- <th class="manage-column column-title" scope="col">
73
- <?php _e( 'Tab Title', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
74
- </th>
75
- <th class="manage-column column-name" scope="col">
76
- <?php _e( 'Tab Name', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
77
- </th>
78
- <th class="manage-column column-content" scope="col">
79
- <?php _e( 'Tab Content Preview', 'yikes-inc-easy-custom-woocommerce-product-tabs' ); ?>
80
- </th>
81
- <?php do_action( 'yikes-woo-saved-tabs-table-header' ); ?>
82
- <th class="manage-column column-edit" scope="col">&nbsp;</th>
83
- </tr>
84
- </tfoot>
85
-
86
- <tbody id="yikes-woo-saved-tabs-list-tbody">
87
- <?php
88
- if( ! empty( $yikes_custom_tab_data ) ) {
89
-
90
- $yikes_custom_tab_data = apply_filters( 'yikes_woo_reorder_saved_tabs', $yikes_custom_tab_data );
91
- $tab_order = 1;
92
-
93
- foreach ( $yikes_custom_tab_data as $key => $tab_data ) {
94
-
95
- // Set variables before using them.
96
- $tab_title = isset( $tab_data['tab_title'] ) && ! empty( $tab_data['tab_title'] ) ? $tab_data['tab_title'] : '';
97
- $tab_name = isset( $tab_data['tab_name'] ) ? $tab_data['tab_name'] : '';
98
- $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 ) ) : '';
99
- $tab_id = isset( $tab_data['tab_id'] ) && ! empty( $tab_data['tab_id'] ) ? (int) $tab_data['tab_id'] : 0;
100
- $edit_tab_url = esc_url_raw( add_query_arg( array( 'page' => YIKES_Custom_Product_Tabs_Settings_Page, 'saved-tab-id' => $tab_id ), admin_url() ) );
101
- ?>
102
- <tr class="yikes_woo_saved_tabs_row" id="yikes_woo_saved_tabs_row_<?php echo $tab_id; ?>" data-tab-id="<?php echo $tab_id; ?>" data-order="<?php echo esc_attr( $tab_order ); ?>">
103
- <th class="check-column" scope="row">
104
- <input class="entry-bulk-action-checkbox" type="checkbox" value="<?php echo $tab_id; ?>" />
105
- </th>
106
- <td class="column-title">
107
- <?php echo $tab_title; ?>
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
- </tbody>
140
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  </div>
 
142
 
 
143
  </div>
 
144
 
145
- <?php do_action( 'yikes-woo-saved-tabs-list-ad' ); ?>
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">&nbsp;</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">&nbsp;</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 @@