@@ -1,156 +1,156 @@ |
||
1 | 1 | <div class="uix-field-wrapper"> |
2 | 2 | <ul class="ui-tab-nav"> |
3 | - <?php if ( class_exists( 'LSX_Banners' ) ) { ?> |
|
4 | - <li><a href="#ui-placeholders" class="active"><?php esc_html_e( 'Placeholders', 'lsx-sharing' ); ?></a></li> |
|
3 | + <?php if (class_exists('LSX_Banners')) { ?> |
|
4 | + <li><a href="#ui-placeholders" class="active"><?php esc_html_e('Placeholders', 'lsx-sharing'); ?></a></li> |
|
5 | 5 | <?php } ?> |
6 | 6 | |
7 | - <?php if ( class_exists( 'LSX_Currencies' ) ) { ?> |
|
8 | - <?php $class_active = class_exists( 'LSX_Banners' ) ? '' : 'active'; ?> |
|
9 | - <li><a href="#ui-currencies" class="<?php echo esc_attr( $class_active ); ?>"> |
|
10 | - <?php esc_html_e( 'Currencies', 'lsx-sharing' ); ?></a></li> |
|
7 | + <?php if (class_exists('LSX_Currencies')) { ?> |
|
8 | + <?php $class_active = class_exists('LSX_Banners') ? '' : 'active'; ?> |
|
9 | + <li><a href="#ui-currencies" class="<?php echo esc_attr($class_active); ?>"> |
|
10 | + <?php esc_html_e('Currencies', 'lsx-sharing'); ?></a></li> |
|
11 | 11 | <?php } ?> |
12 | 12 | |
13 | - <?php if ( class_exists( 'LSX_Team' ) ) { ?> |
|
14 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) ) ? '' : 'active'; ?> |
|
15 | - <li><a href="#ui-team" class="<?php echo esc_attr( $class_active ); ?>"> |
|
16 | - <?php esc_html_e( 'Team', 'lsx-sharing' ); ?></a></li> |
|
13 | + <?php if (class_exists('LSX_Team')) { ?> |
|
14 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies')) ? '' : 'active'; ?> |
|
15 | + <li><a href="#ui-team" class="<?php echo esc_attr($class_active); ?>"> |
|
16 | + <?php esc_html_e('Team', 'lsx-sharing'); ?></a></li> |
|
17 | 17 | <?php } ?> |
18 | 18 | |
19 | - <?php if ( class_exists( 'LSX_Testimonials' ) ) { ?> |
|
20 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) || class_exists( 'LSX_Team' ) ) ? '' : 'active'; ?> |
|
21 | - <li><a href="#ui-testimonials" class="<?php echo esc_attr( $class_active ); ?>"> |
|
22 | - <?php esc_html_e( 'Testimonials', 'lsx-sharing' ); ?></a></li> |
|
19 | + <?php if (class_exists('LSX_Testimonials')) { ?> |
|
20 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies') || class_exists('LSX_Team')) ? '' : 'active'; ?> |
|
21 | + <li><a href="#ui-testimonials" class="<?php echo esc_attr($class_active); ?>"> |
|
22 | + <?php esc_html_e('Testimonials', 'lsx-sharing'); ?></a></li> |
|
23 | 23 | <?php } ?> |
24 | 24 | |
25 | - <?php if ( class_exists( 'LSX_Projects' ) ) { ?> |
|
26 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) || class_exists( 'LSX_Team' ) || class_exists( 'LSX_Testimonials' ) ) ? '' : 'active'; ?> |
|
27 | - <li><a href="#ui-projects" class="<?php echo esc_attr( $class_active ); ?>"> |
|
28 | - <?php esc_html_e( 'Projects', 'lsx-sharing' ); ?> |
|
25 | + <?php if (class_exists('LSX_Projects')) { ?> |
|
26 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies') || class_exists('LSX_Team') || class_exists('LSX_Testimonials')) ? '' : 'active'; ?> |
|
27 | + <li><a href="#ui-projects" class="<?php echo esc_attr($class_active); ?>"> |
|
28 | + <?php esc_html_e('Projects', 'lsx-sharing'); ?> |
|
29 | 29 | </a></li> |
30 | 30 | <?php } ?> |
31 | 31 | |
32 | - <?php if ( class_exists( 'LSX_Services' ) ) { ?> |
|
33 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) || class_exists( 'LSX_Team' ) || class_exists( 'LSX_Testimonials' ) || class_exists( 'LSX_Projects' ) ) ? '' : 'active'; ?> |
|
34 | - <li><a href="#ui-services" class="<?php echo esc_attr( $class ); ?>"> |
|
35 | - <?php esc_html_e( 'Services', 'lsx-sharing' ); ?></a></li> |
|
32 | + <?php if (class_exists('LSX_Services')) { ?> |
|
33 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies') || class_exists('LSX_Team') || class_exists('LSX_Testimonials') || class_exists('LSX_Projects')) ? '' : 'active'; ?> |
|
34 | + <li><a href="#ui-services" class="<?php echo esc_attr($class); ?>"> |
|
35 | + <?php esc_html_e('Services', 'lsx-sharing'); ?></a></li> |
|
36 | 36 | <?php $class = ''; } ?> |
37 | 37 | |
38 | - <?php if ( class_exists( 'LSX_Blog_Customizer' ) ) { ?> |
|
39 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) || class_exists( 'LSX_Team' ) || class_exists( 'LSX_Testimonials' ) || class_exists( 'LSX_Projects' ) || class_exists( 'LSX_Services' ) ) ? '' : 'active'; ?> |
|
40 | - <li><a href="#ui-blog-customizer" class="<?php echo esc_attr( $class_active ); ?>"> |
|
41 | - <?php esc_html_e( 'Blog Customizer (posts widget)', 'lsx-sharing' ); ?></a></li> |
|
38 | + <?php if (class_exists('LSX_Blog_Customizer')) { ?> |
|
39 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies') || class_exists('LSX_Team') || class_exists('LSX_Testimonials') || class_exists('LSX_Projects') || class_exists('LSX_Services')) ? '' : 'active'; ?> |
|
40 | + <li><a href="#ui-blog-customizer" class="<?php echo esc_attr($class_active); ?>"> |
|
41 | + <?php esc_html_e('Blog Customizer (posts widget)', 'lsx-sharing'); ?></a></li> |
|
42 | 42 | <?php } ?> |
43 | 43 | |
44 | - <?php if ( class_exists( 'LSX_Sharing' ) ) { ?> |
|
45 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) || class_exists( 'LSX_Team' ) || class_exists( 'LSX_Testimonials' ) || class_exists( 'LSX_Projects' ) || class_exists( 'LSX_Services' ) || class_exists( 'LSX_Blog_Customizer' ) ) ? '' : 'active'; ?> |
|
46 | - <li><a href="#ui-sharing" class="<?php echo esc_attr( $class_active ); ?>"> |
|
47 | - <?php esc_html_e( 'Sharing', 'lsx-sharing' ); ?></a></li> |
|
44 | + <?php if (class_exists('LSX_Sharing')) { ?> |
|
45 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies') || class_exists('LSX_Team') || class_exists('LSX_Testimonials') || class_exists('LSX_Projects') || class_exists('LSX_Services') || class_exists('LSX_Blog_Customizer')) ? '' : 'active'; ?> |
|
46 | + <li><a href="#ui-sharing" class="<?php echo esc_attr($class_active); ?>"> |
|
47 | + <?php esc_html_e('Sharing', 'lsx-sharing'); ?></a></li> |
|
48 | 48 | <?php } ?> |
49 | 49 | |
50 | - <?php if ( class_exists( 'LSX_Videos' ) ) { ?> |
|
51 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) || class_exists( 'LSX_Team' ) || class_exists( 'LSX_Testimonials' ) || class_exists( 'LSX_Projects' ) || class_exists( 'LSX_Services' ) || class_exists( 'LSX_Blog_Customizer' ) || class_exists( 'LSX_Sharing' ) ) ? '' : 'active'; ?> |
|
52 | - <li><a href="#ui-videos" class="<?php echo esc_attr( $class_active ); ?>"> |
|
53 | - <?php esc_html_e( 'Videos', 'lsx-sharing' ); ?></a></li> |
|
50 | + <?php if (class_exists('LSX_Videos')) { ?> |
|
51 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies') || class_exists('LSX_Team') || class_exists('LSX_Testimonials') || class_exists('LSX_Projects') || class_exists('LSX_Services') || class_exists('LSX_Blog_Customizer') || class_exists('LSX_Sharing')) ? '' : 'active'; ?> |
|
52 | + <li><a href="#ui-videos" class="<?php echo esc_attr($class_active); ?>"> |
|
53 | + <?php esc_html_e('Videos', 'lsx-sharing'); ?></a></li> |
|
54 | 54 | <?php } ?> |
55 | 55 | </ul> |
56 | 56 | |
57 | - <?php if ( class_exists( 'LSX_Banners' ) ) { ?> |
|
57 | + <?php if (class_exists('LSX_Banners')) { ?> |
|
58 | 58 | <div id="ui-placeholders" class="ui-tab active"> |
59 | 59 | <table class="form-table"> |
60 | 60 | <tbody> |
61 | - <?php do_action( 'lsx_framework_display_tab_content', 'placeholders' ); ?> |
|
61 | + <?php do_action('lsx_framework_display_tab_content', 'placeholders'); ?> |
|
62 | 62 | </tbody> |
63 | 63 | </table> |
64 | 64 | </div> |
65 | 65 | <?php } ?> |
66 | 66 | |
67 | - <?php if ( class_exists( 'LSX_Currencies' ) ) { ?> |
|
68 | - <?php $class_active = class_exists( 'LSX_Banners' ) ? '' : 'active'; ?> |
|
69 | - <div id="ui-currencies" class="ui-tab <?php echo esc_attr( $class_active ); ?>"> |
|
67 | + <?php if (class_exists('LSX_Currencies')) { ?> |
|
68 | + <?php $class_active = class_exists('LSX_Banners') ? '' : 'active'; ?> |
|
69 | + <div id="ui-currencies" class="ui-tab <?php echo esc_attr($class_active); ?>"> |
|
70 | 70 | <table class="form-table"> |
71 | 71 | <tbody> |
72 | - <?php do_action( 'lsx_framework_display_tab_content', 'currency_switcher' ); ?> |
|
72 | + <?php do_action('lsx_framework_display_tab_content', 'currency_switcher'); ?> |
|
73 | 73 | </tbody> |
74 | 74 | </table> |
75 | 75 | </div> |
76 | 76 | <?php } ?> |
77 | 77 | |
78 | - <?php if ( class_exists( 'LSX_Team' ) ) { ?> |
|
79 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) ) ? '' : 'active'; ?> |
|
80 | - <div id="ui-team" class="ui-tab <?php echo esc_attr( $class_active ); ?>"> |
|
78 | + <?php if (class_exists('LSX_Team')) { ?> |
|
79 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies')) ? '' : 'active'; ?> |
|
80 | + <div id="ui-team" class="ui-tab <?php echo esc_attr($class_active); ?>"> |
|
81 | 81 | <table class="form-table"> |
82 | 82 | <tbody> |
83 | - <?php do_action( 'lsx_framework_display_tab_content', 'team' ); ?> |
|
83 | + <?php do_action('lsx_framework_display_tab_content', 'team'); ?> |
|
84 | 84 | </tbody> |
85 | 85 | </table> |
86 | 86 | </div> |
87 | 87 | <?php } ?> |
88 | 88 | |
89 | - <?php if ( class_exists( 'LSX_Testimonials' ) ) { ?> |
|
90 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) || class_exists( 'LSX_Team' ) ) ? '' : 'active'; ?> |
|
91 | - <div id="ui-testimonials" class="ui-tab <?php echo esc_attr( $class_active ); ?>"> |
|
89 | + <?php if (class_exists('LSX_Testimonials')) { ?> |
|
90 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies') || class_exists('LSX_Team')) ? '' : 'active'; ?> |
|
91 | + <div id="ui-testimonials" class="ui-tab <?php echo esc_attr($class_active); ?>"> |
|
92 | 92 | <table class="form-table"> |
93 | 93 | <tbody> |
94 | - <?php do_action( 'lsx_framework_display_tab_content', 'testimonials' ); ?> |
|
94 | + <?php do_action('lsx_framework_display_tab_content', 'testimonials'); ?> |
|
95 | 95 | </tbody> |
96 | 96 | </table> |
97 | 97 | </div> |
98 | 98 | <?php } ?> |
99 | 99 | |
100 | - <?php if ( class_exists( 'LSX_Projects' ) ) { ?> |
|
101 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) || class_exists( 'LSX_Team' ) || class_exists( 'LSX_Testimonials' ) ) ? '' : 'active'; ?> |
|
102 | - <div id="ui-projects" class="ui-tab <?php echo esc_attr( $class_active ); ?>"> |
|
100 | + <?php if (class_exists('LSX_Projects')) { ?> |
|
101 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies') || class_exists('LSX_Team') || class_exists('LSX_Testimonials')) ? '' : 'active'; ?> |
|
102 | + <div id="ui-projects" class="ui-tab <?php echo esc_attr($class_active); ?>"> |
|
103 | 103 | <table class="form-table"> |
104 | 104 | <tbody> |
105 | - <?php do_action( 'lsx_framework_display_tab_content', 'projects' ); ?> |
|
105 | + <?php do_action('lsx_framework_display_tab_content', 'projects'); ?> |
|
106 | 106 | </tbody> |
107 | 107 | </table> |
108 | 108 | </div> |
109 | 109 | <?php } ?> |
110 | 110 | |
111 | - <?php if ( class_exists( 'LSX_Services' ) ) { ?> |
|
112 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) || class_exists( 'LSX_Team' ) || class_exists( 'LSX_Testimonials' ) || class_exists( 'LSX_Projects' ) ) ? '' : 'active'; ?> |
|
113 | - <div id="ui-services" class="ui-tab <?php echo esc_attr( $class_active ); ?>"> |
|
111 | + <?php if (class_exists('LSX_Services')) { ?> |
|
112 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies') || class_exists('LSX_Team') || class_exists('LSX_Testimonials') || class_exists('LSX_Projects')) ? '' : 'active'; ?> |
|
113 | + <div id="ui-services" class="ui-tab <?php echo esc_attr($class_active); ?>"> |
|
114 | 114 | <table class="form-table"> |
115 | 115 | <tbody> |
116 | - <?php do_action( 'lsx_framework_display_tab_content', 'services' ); ?> |
|
116 | + <?php do_action('lsx_framework_display_tab_content', 'services'); ?> |
|
117 | 117 | </tbody> |
118 | 118 | </table> |
119 | 119 | </div> |
120 | 120 | <?php } ?> |
121 | 121 | |
122 | - <?php if ( class_exists( 'LSX_Blog_Customizer' ) ) { ?> |
|
123 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) || class_exists( 'LSX_Team' ) || class_exists( 'LSX_Testimonials' ) || class_exists( 'LSX_Projects' ) || class_exists( 'LSX_Services' ) ) ? '' : 'active'; ?> |
|
124 | - <div id="ui-blog-customizer" class="ui-tab <?php echo esc_attr( $class_active ); ?>"> |
|
122 | + <?php if (class_exists('LSX_Blog_Customizer')) { ?> |
|
123 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies') || class_exists('LSX_Team') || class_exists('LSX_Testimonials') || class_exists('LSX_Projects') || class_exists('LSX_Services')) ? '' : 'active'; ?> |
|
124 | + <div id="ui-blog-customizer" class="ui-tab <?php echo esc_attr($class_active); ?>"> |
|
125 | 125 | <table class="form-table"> |
126 | 126 | <tbody> |
127 | - <?php do_action( 'lsx_framework_display_tab_content', 'blog-customizer' ); ?> |
|
127 | + <?php do_action('lsx_framework_display_tab_content', 'blog-customizer'); ?> |
|
128 | 128 | </tbody> |
129 | 129 | </table> |
130 | 130 | </div> |
131 | 131 | <?php } ?> |
132 | 132 | |
133 | - <?php if ( class_exists( 'LSX_Sharing' ) ) { ?> |
|
134 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) || class_exists( 'LSX_Team' ) || class_exists( 'LSX_Testimonials' ) || class_exists( 'LSX_Projects' ) || class_exists( 'LSX_Services' ) || class_exists( 'LSX_Blog_Customizer' ) ) ? '' : 'active'; ?> |
|
135 | - <div id="ui-sharing" class="ui-tab <?php echo esc_attr( $class_active ); ?>"> |
|
133 | + <?php if (class_exists('LSX_Sharing')) { ?> |
|
134 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies') || class_exists('LSX_Team') || class_exists('LSX_Testimonials') || class_exists('LSX_Projects') || class_exists('LSX_Services') || class_exists('LSX_Blog_Customizer')) ? '' : 'active'; ?> |
|
135 | + <div id="ui-sharing" class="ui-tab <?php echo esc_attr($class_active); ?>"> |
|
136 | 136 | <table class="form-table"> |
137 | 137 | <tbody> |
138 | - <?php do_action( 'lsx_framework_display_tab_content', 'sharing' ); ?> |
|
138 | + <?php do_action('lsx_framework_display_tab_content', 'sharing'); ?> |
|
139 | 139 | </tbody> |
140 | 140 | </table> |
141 | 141 | </div> |
142 | 142 | <?php } ?> |
143 | 143 | |
144 | - <?php if ( class_exists( 'LSX_Videos' ) ) { ?> |
|
145 | - <?php $class_active = ( class_exists( 'LSX_Banners' ) || class_exists( 'LSX_Currencies' ) || class_exists( 'LSX_Team' ) || class_exists( 'LSX_Testimonials' ) || class_exists( 'LSX_Projects' ) || class_exists( 'LSX_Services' ) || class_exists( 'LSX_Blog_Customizer' ) || class_exists( 'LSX_Sharing' ) ) ? '' : 'active'; ?> |
|
146 | - <div id="ui-videos" class="ui-tab <?php echo esc_attr( $class_active ); ?>"> |
|
144 | + <?php if (class_exists('LSX_Videos')) { ?> |
|
145 | + <?php $class_active = (class_exists('LSX_Banners') || class_exists('LSX_Currencies') || class_exists('LSX_Team') || class_exists('LSX_Testimonials') || class_exists('LSX_Projects') || class_exists('LSX_Services') || class_exists('LSX_Blog_Customizer') || class_exists('LSX_Sharing')) ? '' : 'active'; ?> |
|
146 | + <div id="ui-videos" class="ui-tab <?php echo esc_attr($class_active); ?>"> |
|
147 | 147 | <table class="form-table"> |
148 | 148 | <tbody> |
149 | - <?php do_action( 'lsx_framework_display_tab_content', 'videos' ); ?> |
|
149 | + <?php do_action('lsx_framework_display_tab_content', 'videos'); ?> |
|
150 | 150 | </tbody> |
151 | 151 | </table> |
152 | 152 | </div> |
153 | 153 | <?php } ?> |
154 | 154 | |
155 | - <?php do_action( 'lsx_framework_display_tab_bottom', 'display' ); ?> |
|
155 | + <?php do_action('lsx_framework_display_tab_bottom', 'display'); ?> |
|
156 | 156 | </div> |
@@ -13,14 +13,14 @@ |
||
13 | 13 | */ |
14 | 14 | |
15 | 15 | // If this file is called directly, abort. |
16 | -if ( ! defined( 'WPINC' ) ) { |
|
16 | +if ( ! defined('WPINC')) { |
|
17 | 17 | die; |
18 | 18 | } |
19 | 19 | |
20 | -define( 'LSX_SHARING_PATH', plugin_dir_path( __FILE__ ) ); |
|
21 | -define( 'LSX_SHARING_CORE', __FILE__ ); |
|
22 | -define( 'LSX_SHARING_URL', plugin_dir_url( __FILE__ ) ); |
|
23 | -define( 'LSX_SHARING_VER', '1.2.0' ); |
|
20 | +define('LSX_SHARING_PATH', plugin_dir_path(__FILE__)); |
|
21 | +define('LSX_SHARING_CORE', __FILE__); |
|
22 | +define('LSX_SHARING_URL', plugin_dir_url(__FILE__)); |
|
23 | +define('LSX_SHARING_VER', '1.2.0'); |
|
24 | 24 | |
25 | 25 | /* ======================= Below is the Plugin Class init ========================= */ |
26 | 26 | require_once LSX_SHARING_PATH . '/classes/class-sharing.php'; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * Constructor. |
50 | 50 | */ |
51 | 51 | public function __construct() { |
52 | - add_action( 'init', array( $this, 'set_options' ), 50 ); |
|
52 | + add_action('init', array($this, 'set_options'), 50); |
|
53 | 53 | $this->load_vendors(); |
54 | 54 | $this->load_includes(); |
55 | 55 | $this->load_classes(); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public static function get_instance() { |
66 | 66 | // If the single instance hasn't been set, set it now. |
67 | - if ( null === self::$instance ) { |
|
67 | + if (null === self::$instance) { |
|
68 | 68 | self::$instance = new self(); |
69 | 69 | } |
70 | 70 | return self::$instance; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | private function load_vendors() { |
77 | 77 | // Configure custom fields. |
78 | - if ( ! class_exists( 'CMB2' ) ) { |
|
78 | + if ( ! class_exists('CMB2')) { |
|
79 | 79 | require_once LSX_SHARING_PATH . 'vendor/CMB2/init.php'; |
80 | 80 | } |
81 | 81 | } |
@@ -103,19 +103,19 @@ discard block |
||
103 | 103 | * Set options. |
104 | 104 | */ |
105 | 105 | public function set_options() { |
106 | - if ( function_exists( 'tour_operator' ) ) { |
|
107 | - $this->options = get_option( '_lsx-to_settings', false ); |
|
106 | + if (function_exists('tour_operator')) { |
|
107 | + $this->options = get_option('_lsx-to_settings', false); |
|
108 | 108 | } else { |
109 | - $this->options = get_option( '_lsx_settings', false ); |
|
109 | + $this->options = get_option('_lsx_settings', false); |
|
110 | 110 | |
111 | - if ( false === $this->options ) { |
|
112 | - $this->options = get_option( '_lsx_lsx-settings', false ); |
|
111 | + if (false === $this->options) { |
|
112 | + $this->options = get_option('_lsx_lsx-settings', false); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
116 | - $new_options = get_option( 'lsx-sharing-settings' ); |
|
117 | - if ( ! empty( $new_options ) ) { |
|
118 | - if ( '' !== $new_options && false !== $new_options ) { |
|
116 | + $new_options = get_option('lsx-sharing-settings'); |
|
117 | + if ( ! empty($new_options)) { |
|
118 | + if ('' !== $new_options && false !== $new_options) { |
|
119 | 119 | $this->is_new_options = true; |
120 | 120 | $this->options = $new_options; |
121 | 121 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public static function get_instance() { |
49 | 49 | // If the single instance hasn't been set, set it now. |
50 | - if ( null == self::$instance ) { |
|
50 | + if (null == self::$instance) { |
|
51 | 51 | self::$instance = new self(); |
52 | 52 | } |
53 | 53 | return self::$instance; |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | /** |
66 | 66 | * Backwards compatabile function for the sharing buttons. |
67 | 67 | */ |
68 | - public function sharing_buttons( $buttons = array( 'facebook', 'twitter', 'pinterest' ), $echo = false, $post_id = false ) { |
|
69 | - wc_deprecated_function( 'LSX_Sharing_Frontend::sharing_buttons()', '1.2.0', 'lsx_sharing()->frontend->output->sharing_buttons()' ); |
|
70 | - $this->output->sharing_buttons( $buttons, $echo, $post_id ); |
|
68 | + public function sharing_buttons($buttons = array('facebook', 'twitter', 'pinterest'), $echo = false, $post_id = false) { |
|
69 | + wc_deprecated_function('LSX_Sharing_Frontend::sharing_buttons()', '1.2.0', 'lsx_sharing()->frontend->output->sharing_buttons()'); |
|
70 | + $this->output->sharing_buttons($buttons, $echo, $post_id); |
|
71 | 71 | } |
72 | 72 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | */ |
52 | 52 | public static function get_instance() { |
53 | 53 | // If the single instance hasn't been set, set it now. |
54 | - if ( null === self::$instance ) { |
|
54 | + if (null === self::$instance) { |
|
55 | 55 | self::$instance = new self(); |
56 | 56 | } |
57 | 57 | return self::$instance; |
@@ -37,14 +37,14 @@ discard block |
||
37 | 37 | * Contructor |
38 | 38 | */ |
39 | 39 | public function __construct() { |
40 | - add_filter( 'cmb2_enqueue_css', array( $this, 'disable_cmb2_styles' ), 1, 1 ); |
|
41 | - add_action( 'cmb2_before_form', array( $this, 'generate_navigation' ), 10, 4 ); |
|
42 | - add_action( 'cmb2_before_title_field_row', array( $this, 'output_tab_open_div' ), 10, 1 ); |
|
43 | - add_action( 'cmb2_after_tab_closing_field_row', array( $this, 'output_tab_closing_div' ), 10, 1 ); |
|
44 | - add_action( 'cmb2_render_tab_closing', array( $this, 'cmb2_render_callback_for_tab_closing' ), 10, 5 ); |
|
45 | - add_filter( 'cmb2_sanitize_tab_closing', array( $this, 'cmb2_sanitize_tab_closing_callback' ), 10, 2 ); |
|
46 | - add_action( 'cmb2_after_form', array( $this, 'navigation_js' ), 10, 4 ); |
|
47 | - add_filter( 'cmb2_options_page_redirect_url', array( $this, 'add_tab_argument' ), 10, 1 ); |
|
40 | + add_filter('cmb2_enqueue_css', array($this, 'disable_cmb2_styles'), 1, 1); |
|
41 | + add_action('cmb2_before_form', array($this, 'generate_navigation'), 10, 4); |
|
42 | + add_action('cmb2_before_title_field_row', array($this, 'output_tab_open_div'), 10, 1); |
|
43 | + add_action('cmb2_after_tab_closing_field_row', array($this, 'output_tab_closing_div'), 10, 1); |
|
44 | + add_action('cmb2_render_tab_closing', array($this, 'cmb2_render_callback_for_tab_closing'), 10, 5); |
|
45 | + add_filter('cmb2_sanitize_tab_closing', array($this, 'cmb2_sanitize_tab_closing_callback'), 10, 2); |
|
46 | + add_action('cmb2_after_form', array($this, 'navigation_js'), 10, 4); |
|
47 | + add_filter('cmb2_options_page_redirect_url', array($this, 'add_tab_argument'), 10, 1); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public static function get_instance() { |
58 | 58 | // If the single instance hasn't been set, set it now. |
59 | - if ( null == self::$instance ) { |
|
59 | + if (null == self::$instance) { |
|
60 | 60 | self::$instance = new self(); |
61 | 61 | } |
62 | 62 | return self::$instance; |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @return bool $enabled Whether to enable (enqueue) styles. |
69 | 69 | */ |
70 | - public function disable_cmb2_styles( $enabled ) { |
|
71 | - if ( is_admin() ) { |
|
70 | + public function disable_cmb2_styles($enabled) { |
|
71 | + if (is_admin()) { |
|
72 | 72 | $current_screen = get_current_screen(); |
73 | - if ( is_object( $current_screen ) && 'settings_page_lsx-sharing-settings' === $current_screen->id ) { |
|
73 | + if (is_object($current_screen) && 'settings_page_lsx-sharing-settings' === $current_screen->id) { |
|
74 | 74 | $enabled = false; |
75 | 75 | } |
76 | 76 | } |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | * @param object $cmb2_obj |
87 | 87 | * @return void |
88 | 88 | */ |
89 | - public function generate_navigation( $cmb_id, $object_id, $object_type, $cmb2_obj ) { |
|
90 | - if ( 'lsx_sharing_settings' === $cmb_id && 'lsx-sharing-settings' === $object_id && 'options-page' === $object_type ) { |
|
89 | + public function generate_navigation($cmb_id, $object_id, $object_type, $cmb2_obj) { |
|
90 | + if ('lsx_sharing_settings' === $cmb_id && 'lsx-sharing-settings' === $object_id && 'options-page' === $object_type) { |
|
91 | 91 | $this->navigation = array(); |
92 | 92 | $this->is_options_page = true; |
93 | - if ( isset( $cmb2_obj->meta_box['fields'] ) && ! empty( $cmb2_obj->meta_box['fields'] ) ) { |
|
94 | - foreach ( $cmb2_obj->meta_box['fields'] as $field_index => $field ) { |
|
95 | - if ( 'title' === $field['type'] ) { |
|
96 | - $this->navigation[ $field_index ] = $field['name']; |
|
93 | + if (isset($cmb2_obj->meta_box['fields']) && ! empty($cmb2_obj->meta_box['fields'])) { |
|
94 | + foreach ($cmb2_obj->meta_box['fields'] as $field_index => $field) { |
|
95 | + if ('title' === $field['type']) { |
|
96 | + $this->navigation[$field_index] = $field['name']; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
@@ -107,32 +107,32 @@ discard block |
||
107 | 107 | * @return void |
108 | 108 | */ |
109 | 109 | public function output_navigation() { |
110 | - if ( ! empty( $this->navigation ) ) { |
|
110 | + if ( ! empty($this->navigation)) { |
|
111 | 111 | ?> |
112 | 112 | <div class="wp-filter hide-if-no-js"> |
113 | 113 | <ul class="filter-links"> |
114 | 114 | <?php |
115 | 115 | $first_tab = true; |
116 | - $total = count( $this->navigation ); |
|
116 | + $total = count($this->navigation); |
|
117 | 117 | $count = 0; |
118 | 118 | $separator = ' |'; |
119 | 119 | $selected_tab = ''; |
120 | - if ( isset( $_GET['cmb_tab'] ) && '' !== $_GET['cmb_tab'] ) { |
|
121 | - $selected_tab = sanitize_text_field( $_GET['cmb_tab'] ); |
|
120 | + if (isset($_GET['cmb_tab']) && '' !== $_GET['cmb_tab']) { |
|
121 | + $selected_tab = sanitize_text_field($_GET['cmb_tab']); |
|
122 | 122 | $selected_tab = 'settings_' . $selected_tab; |
123 | 123 | } |
124 | - foreach ( $this->navigation as $key => $label ) { |
|
124 | + foreach ($this->navigation as $key => $label) { |
|
125 | 125 | $count++; |
126 | 126 | $current_css = ''; |
127 | - if ( ( true === $first_tab && '' === $selected_tab ) || $key === $selected_tab ) { |
|
127 | + if ((true === $first_tab && '' === $selected_tab) || $key === $selected_tab) { |
|
128 | 128 | $first_tab = false; |
129 | 129 | $current_css = 'current'; |
130 | 130 | } |
131 | - if ( $count === $total ) { |
|
131 | + if ($count === $total) { |
|
132 | 132 | $separator = ''; |
133 | 133 | } |
134 | 134 | ?> |
135 | - <li><a href="#" class="<?php echo esc_attr( $current_css ); ?>" data-sort="<?php echo esc_attr( $key ); ?>_tab"><?php echo esc_attr( $label ); ?></a><?php echo esc_attr( $separator ); ?></li> |
|
135 | + <li><a href="#" class="<?php echo esc_attr($current_css); ?>" data-sort="<?php echo esc_attr($key); ?>_tab"><?php echo esc_attr($label); ?></a><?php echo esc_attr($separator); ?></li> |
|
136 | 136 | <?php |
137 | 137 | } |
138 | 138 | ?> |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | * @param object $field CMB2_Field(); |
149 | 149 | * @return void |
150 | 150 | */ |
151 | - public function output_tab_open_div( $field ) { |
|
152 | - if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'title' === $field->args['type'] ) { |
|
151 | + public function output_tab_open_div($field) { |
|
152 | + if (true === $this->is_options_page && isset($field->args['type']) && 'title' === $field->args['type']) { |
|
153 | 153 | ?> |
154 | - <div id="<?php echo esc_attr( $field->args['id'] ); ?>_tab" class="tab tab-nav hidden"> |
|
154 | + <div id="<?php echo esc_attr($field->args['id']); ?>_tab" class="tab tab-nav hidden"> |
|
155 | 155 | <?php |
156 | 156 | } |
157 | 157 | } |
@@ -162,19 +162,19 @@ discard block |
||
162 | 162 | * @param object $field CMB2_Field(); |
163 | 163 | * @return void |
164 | 164 | */ |
165 | - public function output_tab_closing_div( $field ) { |
|
166 | - if ( true === $this->is_options_page && isset( $field->args['type'] ) && 'tab_closing' === $field->args['type'] ) { |
|
165 | + public function output_tab_closing_div($field) { |
|
166 | + if (true === $this->is_options_page && isset($field->args['type']) && 'tab_closing' === $field->args['type']) { |
|
167 | 167 | ?> |
168 | 168 | </div> |
169 | 169 | <?php |
170 | 170 | } |
171 | 171 | } |
172 | 172 | |
173 | - public function cmb2_render_callback_for_tab_closing( $field, $escaped_value, $object_id, $object_type, $field_type_object ) { |
|
173 | + public function cmb2_render_callback_for_tab_closing($field, $escaped_value, $object_id, $object_type, $field_type_object) { |
|
174 | 174 | return; |
175 | 175 | } |
176 | 176 | |
177 | - public function cmb2_sanitize_tab_closing_callback( $override_value, $value ) { |
|
177 | + public function cmb2_sanitize_tab_closing_callback($override_value, $value) { |
|
178 | 178 | return ''; |
179 | 179 | } |
180 | 180 | |
@@ -186,8 +186,8 @@ discard block |
||
186 | 186 | * @param string $object_type |
187 | 187 | * @return void |
188 | 188 | */ |
189 | - public function navigation_js( $cmb_id, $object_id, $object_type ) { |
|
190 | - if ( 'lsx_sharing_settings' === $cmb_id && 'lsx-sharing-settings' === $object_id && 'options-page' === $object_type ) { |
|
189 | + public function navigation_js($cmb_id, $object_id, $object_type) { |
|
190 | + if ('lsx_sharing_settings' === $cmb_id && 'lsx-sharing-settings' === $object_id && 'options-page' === $object_type) { |
|
191 | 191 | ?> |
192 | 192 | <script> |
193 | 193 | var LSX_SHARING_CMB2 = Object.create( null ); |
@@ -224,14 +224,14 @@ discard block |
||
224 | 224 | * @param string $url |
225 | 225 | * @return void |
226 | 226 | */ |
227 | - public function add_tab_argument( $url ) { |
|
228 | - if ( isset( $_POST['cmb_tab'] ) && '' !== $_POST['cmb_tab'] ) { // @codingStandardsIgnoreLine |
|
229 | - $tab_selection = sanitize_text_field( $_POST['cmb_tab'] ); // @codingStandardsIgnoreLine |
|
230 | - $tab_selection = str_replace( array( 'settings_', '_tab' ), '', $tab_selection ); // @codingStandardsIgnoreLine |
|
231 | - if ( 'single' !== $tab_selection ) { |
|
232 | - $url = add_query_arg( 'cmb_tab', $tab_selection, $url ); |
|
227 | + public function add_tab_argument($url) { |
|
228 | + if (isset($_POST['cmb_tab']) && '' !== $_POST['cmb_tab']) { // @codingStandardsIgnoreLine |
|
229 | + $tab_selection = sanitize_text_field($_POST['cmb_tab']); // @codingStandardsIgnoreLine |
|
230 | + $tab_selection = str_replace(array('settings_', '_tab'), '', $tab_selection); // @codingStandardsIgnoreLine |
|
231 | + if ('single' !== $tab_selection) { |
|
232 | + $url = add_query_arg('cmb_tab', $tab_selection, $url); |
|
233 | 233 | } else { |
234 | - $url = remove_query_arg( 'cmb_tab', $url ); |
|
234 | + $url = remove_query_arg('cmb_tab', $url); |
|
235 | 235 | } |
236 | 236 | } |
237 | 237 | return $url; |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | /** |
36 | 36 | * Constructor. |
37 | 37 | */ |
38 | - public function __construct( $service, $options, $prefix = 'sharing' ) { |
|
38 | + public function __construct($service, $options, $prefix = 'sharing') { |
|
39 | 39 | $this->options = $options; |
40 | - if ( ! in_array( $service, $this->services, true ) ) { |
|
40 | + if ( ! in_array($service, $this->services, true)) { |
|
41 | 41 | return; |
42 | 42 | } |
43 | - if ( \lsx\sharing\includes\functions\is_button_disabled( 'global', $service ) || \lsx\sharing\includes\functions\is_button_disabled( $prefix, $service ) ) { |
|
43 | + if (\lsx\sharing\includes\functions\is_button_disabled('global', $service) || \lsx\sharing\includes\functions\is_button_disabled($prefix, $service)) { |
|
44 | 44 | return ''; |
45 | 45 | } |
46 | 46 | $this->service = $service; |
@@ -49,42 +49,42 @@ discard block |
||
49 | 49 | /** |
50 | 50 | * Get service link to share. |
51 | 51 | */ |
52 | - public function get_link( $post ) { |
|
53 | - if ( empty( $post ) ) { |
|
52 | + public function get_link($post) { |
|
53 | + if (empty($post)) { |
|
54 | 54 | return ''; |
55 | 55 | } |
56 | 56 | |
57 | - if ( 'email' === $this->service ) { |
|
58 | - return $this->get_link_email( $post ); |
|
59 | - } elseif ( 'facebook' === $this->service ) { |
|
60 | - return $this->get_link_facebook( $post ); |
|
61 | - } elseif ( 'twitter' === $this->service ) { |
|
62 | - return $this->get_link_twitter( $post ); |
|
63 | - } elseif ( 'pinterest' === $this->service ) { |
|
64 | - return $this->get_link_pinterest( $post ); |
|
57 | + if ('email' === $this->service) { |
|
58 | + return $this->get_link_email($post); |
|
59 | + } elseif ('facebook' === $this->service) { |
|
60 | + return $this->get_link_facebook($post); |
|
61 | + } elseif ('twitter' === $this->service) { |
|
62 | + return $this->get_link_twitter($post); |
|
63 | + } elseif ('pinterest' === $this->service) { |
|
64 | + return $this->get_link_pinterest($post); |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
69 | 69 | * Get Facebook link to share. |
70 | 70 | */ |
71 | - public function get_link_facebook( $post ) { |
|
72 | - $permalink = get_permalink( $post->ID ); |
|
73 | - $permalink = apply_filters( 'lsx_sharing_facebook_url', $permalink, $post ); |
|
74 | - $title = apply_filters( 'the_title', $post->post_title ); |
|
71 | + public function get_link_facebook($post) { |
|
72 | + $permalink = get_permalink($post->ID); |
|
73 | + $permalink = apply_filters('lsx_sharing_facebook_url', $permalink, $post); |
|
74 | + $title = apply_filters('the_title', $post->post_title); |
|
75 | 75 | |
76 | - return 'https://www.facebook.com/sharer.php?display=page&u=' . rawurlencode( $permalink ) . '&t=' . rawurlencode( $title ); |
|
76 | + return 'https://www.facebook.com/sharer.php?display=page&u=' . rawurlencode($permalink) . '&t=' . rawurlencode($title); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
80 | 80 | * Get Twitter link to share. |
81 | 81 | */ |
82 | - public function get_link_twitter( $post ) { |
|
83 | - $permalink = get_permalink( $post->ID ); |
|
84 | - $permalink = apply_filters( 'lsx_sharing_twitter_url', $permalink, $post ); |
|
85 | - $title = apply_filters( 'the_title', $post->post_title ); |
|
82 | + public function get_link_twitter($post) { |
|
83 | + $permalink = get_permalink($post->ID); |
|
84 | + $permalink = apply_filters('lsx_sharing_twitter_url', $permalink, $post); |
|
85 | + $title = apply_filters('the_title', $post->post_title); |
|
86 | 86 | |
87 | - if ( function_exists( 'mb_stripos' ) ) { |
|
87 | + if (function_exists('mb_stripos')) { |
|
88 | 88 | $strlen = 'mb_strlen'; |
89 | 89 | $substr = 'mb_substr'; |
90 | 90 | } else { |
@@ -94,34 +94,34 @@ discard block |
||
94 | 94 | |
95 | 95 | $short_url_length = 24; |
96 | 96 | |
97 | - if ( ( $strlen( $title ) + $short_url_length ) > 140 ) { |
|
98 | - $text = $substr( $title, 0, ( 140 - $short_url_length - 1 ) ) . "\xE2\x80\xA6"; |
|
97 | + if (($strlen($title) + $short_url_length) > 140) { |
|
98 | + $text = $substr($title, 0, (140 - $short_url_length - 1)) . "\xE2\x80\xA6"; |
|
99 | 99 | } else { |
100 | 100 | $text = $title; |
101 | 101 | } |
102 | 102 | |
103 | - return 'https://twitter.com/intent/tweet?text=' . rawurlencode( $text ) . '&url=' . rawurlencode( $permalink ); |
|
103 | + return 'https://twitter.com/intent/tweet?text=' . rawurlencode($text) . '&url=' . rawurlencode($permalink); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
107 | 107 | * Get Pinterest link to share. |
108 | 108 | */ |
109 | - public function get_link_pinterest( $post ) { |
|
110 | - $permalink = get_permalink( $post->ID ); |
|
111 | - $permalink = apply_filters( 'lsx_sharing_pinterest_url', $permalink, $post ); |
|
112 | - $title = apply_filters( 'the_title', $post->post_title ); |
|
113 | - |
|
114 | - if ( ! has_post_thumbnail( $post ) ) { |
|
115 | - if ( class_exists( 'lsx\legacy\Placeholders' ) ) { |
|
116 | - $image = \lsx\legacy\Placeholders::placeholder_url( null, $post->post_type ); |
|
117 | - } elseif ( class_exists( 'LSX_Placeholders' ) ) { |
|
118 | - $image = \LSX_Placeholders::placeholder_url( null, $post->post_type ); |
|
109 | + public function get_link_pinterest($post) { |
|
110 | + $permalink = get_permalink($post->ID); |
|
111 | + $permalink = apply_filters('lsx_sharing_pinterest_url', $permalink, $post); |
|
112 | + $title = apply_filters('the_title', $post->post_title); |
|
113 | + |
|
114 | + if ( ! has_post_thumbnail($post)) { |
|
115 | + if (class_exists('lsx\legacy\Placeholders')) { |
|
116 | + $image = \lsx\legacy\Placeholders::placeholder_url(null, $post->post_type); |
|
117 | + } elseif (class_exists('LSX_Placeholders')) { |
|
118 | + $image = \LSX_Placeholders::placeholder_url(null, $post->post_type); |
|
119 | 119 | } |
120 | 120 | } else { |
121 | - $image = get_the_post_thumbnail_url( $post->ID, 'large' ); |
|
121 | + $image = get_the_post_thumbnail_url($post->ID, 'large'); |
|
122 | 122 | } |
123 | 123 | |
124 | - return 'https://www.pinterest.com/pin/create/button/?url=' . rawurlencode( $permalink ) . '&media=' . rawurlencode( $image ) . '&description=' . rawurlencode( $title ); |
|
124 | + return 'https://www.pinterest.com/pin/create/button/?url=' . rawurlencode($permalink) . '&media=' . rawurlencode($image) . '&description=' . rawurlencode($title); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -21,22 +21,22 @@ discard block |
||
21 | 21 | * Contructor |
22 | 22 | */ |
23 | 23 | public function __construct() { |
24 | - add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 5 ); |
|
25 | - add_filter( 'wp_kses_allowed_html', array( $this, 'wp_kses_allowed_html' ), 10, 2 ); |
|
26 | - add_shortcode( 'lsx_sharing_buttons', array( $this, 'sharing_buttons_shortcode' ) ); |
|
24 | + add_action('wp_enqueue_scripts', array($this, 'assets'), 5); |
|
25 | + add_filter('wp_kses_allowed_html', array($this, 'wp_kses_allowed_html'), 10, 2); |
|
26 | + add_shortcode('lsx_sharing_buttons', array($this, 'sharing_buttons_shortcode')); |
|
27 | 27 | // Storefront (storefront_loop_post, storefront_single_post). |
28 | - add_action( 'storefront_post_content_before', array( $this, 'sharing_buttons_template' ), 20 ); |
|
28 | + add_action('storefront_post_content_before', array($this, 'sharing_buttons_template'), 20); |
|
29 | 29 | // WooCommerce. |
30 | - add_action( 'woocommerce_share', array( $this, 'sharing_buttons_template' ) ); |
|
30 | + add_action('woocommerce_share', array($this, 'sharing_buttons_template')); |
|
31 | 31 | |
32 | 32 | // General Post Types. |
33 | - add_action( 'lsx_entry_after', array( $this, 'output_sharing' ) ); |
|
33 | + add_action('lsx_entry_after', array($this, 'output_sharing')); |
|
34 | 34 | |
35 | 35 | // Tribe Events. |
36 | - add_filter( 'tribe_events_ical_single_event_links', array( $this, 'output_event_sharing' ), 10, 1 ); |
|
36 | + add_filter('tribe_events_ical_single_event_links', array($this, 'output_event_sharing'), 10, 1); |
|
37 | 37 | |
38 | 38 | // Sensei Integration. |
39 | - add_action( 'sensei_pagination', array( $this, 'output_sharing' ), 20 ); |
|
39 | + add_action('sensei_pagination', array($this, 'output_sharing'), 20); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public static function get_instance() { |
50 | 50 | // If the single instance hasn't been set, set it now. |
51 | - if ( null == self::$instance ) { |
|
51 | + if (null == self::$instance) { |
|
52 | 52 | self::$instance = new self(); |
53 | 53 | } |
54 | 54 | return self::$instance; |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | * Enques the assets. |
59 | 59 | */ |
60 | 60 | public function assets() { |
61 | - if ( defined( 'WP_DEBUG' ) && true === WP_DEBUG ) { |
|
61 | + if (defined('WP_DEBUG') && true === WP_DEBUG) { |
|
62 | 62 | $min = ''; |
63 | 63 | } else { |
64 | 64 | $min = '.min'; |
65 | 65 | } |
66 | 66 | /* Remove assets completely if all sharing options are off */ |
67 | 67 | |
68 | - if ( \lsx\sharing\includes\functions\is_disabled() ) { |
|
68 | + if (\lsx\sharing\includes\functions\is_disabled()) { |
|
69 | 69 | return ''; |
70 | 70 | } |
71 | 71 | |
@@ -73,67 +73,67 @@ discard block |
||
73 | 73 | $post_type = get_post_type(); |
74 | 74 | |
75 | 75 | /* Only show the assets if the post type sharing option is on */ |
76 | - if ( ! \lsx\sharing\includes\functions\is_pt_disabled( $post_type ) ) { |
|
76 | + if ( ! \lsx\sharing\includes\functions\is_pt_disabled($post_type)) { |
|
77 | 77 | |
78 | - wp_enqueue_script( 'lsx-sharing', LSX_SHARING_URL . 'assets/js/lsx-sharing' . $min . '.js', array( 'jquery' ), LSX_SHARING_VER, true ); |
|
78 | + wp_enqueue_script('lsx-sharing', LSX_SHARING_URL . 'assets/js/lsx-sharing' . $min . '.js', array('jquery'), LSX_SHARING_VER, true); |
|
79 | 79 | |
80 | - $params = apply_filters( 'lsx_sharing_js_params', array( |
|
81 | - 'ajax_url' => admin_url( 'admin-ajax.php' ), |
|
80 | + $params = apply_filters('lsx_sharing_js_params', array( |
|
81 | + 'ajax_url' => admin_url('admin-ajax.php'), |
|
82 | 82 | )); |
83 | 83 | |
84 | - wp_localize_script( 'lsx-sharing', 'lsx_sharing_params', $params ); |
|
84 | + wp_localize_script('lsx-sharing', 'lsx_sharing_params', $params); |
|
85 | 85 | |
86 | - wp_enqueue_style( 'lsx-sharing', LSX_SHARING_URL . 'assets/css/lsx-sharing.css', array(), LSX_SHARING_VER ); |
|
87 | - wp_style_add_data( 'lsx-sharing', 'rtl', 'replace' ); |
|
86 | + wp_enqueue_style('lsx-sharing', LSX_SHARING_URL . 'assets/css/lsx-sharing.css', array(), LSX_SHARING_VER); |
|
87 | + wp_style_add_data('lsx-sharing', 'rtl', 'replace'); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
92 | 92 | * Display/return sharing buttons. |
93 | 93 | */ |
94 | - public function sharing_buttons( $buttons = array( 'facebook', 'twitter', 'pinterest' ), $echo = false, $post_id = false ) { |
|
94 | + public function sharing_buttons($buttons = array('facebook', 'twitter', 'pinterest'), $echo = false, $post_id = false) { |
|
95 | 95 | $sharing_content = ''; |
96 | 96 | |
97 | - if ( ( is_preview() || is_admin() ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { |
|
97 | + if ((is_preview() || is_admin()) && ! (defined('DOING_AJAX') && DOING_AJAX)) { |
|
98 | 98 | return ''; |
99 | 99 | } |
100 | 100 | |
101 | 101 | //Set our variables |
102 | 102 | global $post; |
103 | 103 | $share_post = $post; |
104 | - if ( false !== $post_id ) { |
|
105 | - $share_post = get_post( $post_id ); |
|
106 | - $post_type = get_post_type( $post_id ); |
|
104 | + if (false !== $post_id) { |
|
105 | + $share_post = get_post($post_id); |
|
106 | + $post_type = get_post_type($post_id); |
|
107 | 107 | } else { |
108 | 108 | $post_type = get_post_type(); |
109 | 109 | } |
110 | 110 | |
111 | - if ( \lsx\sharing\includes\functions\is_disabled() || \lsx\sharing\includes\functions\is_pt_disabled( $post_type ) ) { |
|
111 | + if (\lsx\sharing\includes\functions\is_disabled() || \lsx\sharing\includes\functions\is_pt_disabled($post_type)) { |
|
112 | 112 | return ''; |
113 | 113 | } |
114 | 114 | |
115 | - if ( ( is_array( $buttons ) && count( $buttons ) > 0 ) ) { |
|
115 | + if ((is_array($buttons) && count($buttons) > 0)) { |
|
116 | 116 | $sharing_content .= '<div class="lsx-sharing-content"><p>'; |
117 | 117 | |
118 | - $sharing_text = \lsx\sharing\includes\functions\get_sharing_text( $post_type ); |
|
119 | - if ( '' !== $sharing_text ) { |
|
118 | + $sharing_text = \lsx\sharing\includes\functions\get_sharing_text($post_type); |
|
119 | + if ('' !== $sharing_text) { |
|
120 | 120 | $sharing_content .= '<span class="lsx-sharing-label">' . $sharing_text . '</span>'; |
121 | 121 | } |
122 | 122 | |
123 | - foreach ( $buttons as $id => $button ) { |
|
124 | - $button_obj = new \lsx\sharing\classes\frontend\Button( $button, $this->options, $post_type ); |
|
123 | + foreach ($buttons as $id => $button) { |
|
124 | + $button_obj = new \lsx\sharing\classes\frontend\Button($button, $this->options, $post_type); |
|
125 | 125 | |
126 | - if ( ! empty( $button_obj ) ) { |
|
127 | - $url = $button_obj->get_link( $share_post ); |
|
126 | + if ( ! empty($button_obj)) { |
|
127 | + $url = $button_obj->get_link($share_post); |
|
128 | 128 | |
129 | - if ( ! empty( $url ) ) { |
|
130 | - if ( 'email' === $button ) { |
|
131 | - if ( ! isset( $this->options['display'] ) || empty( $this->options['display']['sharing_email_form_id'] ) ) { |
|
129 | + if ( ! empty($url)) { |
|
130 | + if ('email' === $button) { |
|
131 | + if ( ! isset($this->options['display']) || empty($this->options['display']['sharing_email_form_id'])) { |
|
132 | 132 | continue; |
133 | 133 | } |
134 | - $sharing_content .= '<span class="lsx-sharing-button lsx-sharing-button-' . esc_attr( $button ) . '"><a href="#lsx-sharing-email" data-toggle="modal" data-link="' . esc_url( $url ) . '"><span class="fa" aria-hidden="true"></span></a></span>'; |
|
134 | + $sharing_content .= '<span class="lsx-sharing-button lsx-sharing-button-' . esc_attr($button) . '"><a href="#lsx-sharing-email" data-toggle="modal" data-link="' . esc_url($url) . '"><span class="fa" aria-hidden="true"></span></a></span>'; |
|
135 | 135 | } else { |
136 | - $sharing_content .= '<span class="lsx-sharing-button lsx-sharing-button-' . esc_attr( $button ) . '"><a href="' . esc_url( $url ) . '" target="_blank" rel="noopener noreferrer"><span class="fa" aria-hidden="true"></span></a></span>'; |
|
136 | + $sharing_content .= '<span class="lsx-sharing-button lsx-sharing-button-' . esc_attr($button) . '"><a href="' . esc_url($url) . '" target="_blank" rel="noopener noreferrer"><span class="fa" aria-hidden="true"></span></a></span>'; |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | } |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | $sharing_content .= '</p></div>'; |
142 | 142 | } |
143 | 143 | |
144 | - if ( $echo ) { |
|
145 | - echo wp_kses_post( $sharing_content ); |
|
144 | + if ($echo) { |
|
145 | + echo wp_kses_post($sharing_content); |
|
146 | 146 | } else { |
147 | 147 | return $sharing_content; |
148 | 148 | } |
@@ -151,20 +151,20 @@ discard block |
||
151 | 151 | /** |
152 | 152 | * Sharing buttons shortcode. |
153 | 153 | */ |
154 | - public function sharing_buttons_shortcode( $atts ) { |
|
155 | - $atts = shortcode_atts( array( |
|
154 | + public function sharing_buttons_shortcode($atts) { |
|
155 | + $atts = shortcode_atts(array( |
|
156 | 156 | 'buttons' => '', |
157 | - ), $atts, 'lsx_sharing_buttons' ); |
|
157 | + ), $atts, 'lsx_sharing_buttons'); |
|
158 | 158 | |
159 | - if ( empty( $atts['buttons'] ) ) { |
|
159 | + if (empty($atts['buttons'])) { |
|
160 | 160 | return ''; |
161 | 161 | } |
162 | 162 | |
163 | - $no_whitespaces = preg_replace( '/\s*,\s*/', ',', filter_var( $atts['buttons'], FILTER_SANITIZE_STRING ) ); |
|
164 | - $buttons = explode( ',', $no_whitespaces ); |
|
163 | + $no_whitespaces = preg_replace('/\s*,\s*/', ',', filter_var($atts['buttons'], FILTER_SANITIZE_STRING)); |
|
164 | + $buttons = explode(',', $no_whitespaces); |
|
165 | 165 | |
166 | - if ( is_array( $buttons ) && count( $buttons ) > 0 ) { |
|
167 | - return $this->sharing_buttons( $buttons ); |
|
166 | + if (is_array($buttons) && count($buttons) > 0) { |
|
167 | + return $this->sharing_buttons($buttons); |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
@@ -172,13 +172,13 @@ discard block |
||
172 | 172 | * Display buttons (template hook). |
173 | 173 | */ |
174 | 174 | public function sharing_buttons_template() { |
175 | - echo wp_kses_post( $this->sharing_buttons() ); |
|
175 | + echo wp_kses_post($this->sharing_buttons()); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
179 | 179 | * Allow data params for Bootstrap modal. |
180 | 180 | */ |
181 | - public function wp_kses_allowed_html( $allowedtags, $context ) { |
|
181 | + public function wp_kses_allowed_html($allowedtags, $context) { |
|
182 | 182 | $allowedtags['a']['data-toggle'] = true; |
183 | 183 | $allowedtags['a']['data-link'] = true; |
184 | 184 | return $allowedtags; |
@@ -190,9 +190,9 @@ discard block |
||
190 | 190 | * @return void |
191 | 191 | */ |
192 | 192 | public function output_sharing() { |
193 | - if ( is_main_query() && is_single() && ! is_singular( array( 'post', 'page', 'product' ) ) ) { |
|
193 | + if (is_main_query() && is_single() && ! is_singular(array('post', 'page', 'product'))) { |
|
194 | 194 | |
195 | - if ( \lsx\sharing\includes\functions\is_disabled() || \lsx\sharing\includes\functions\is_pt_disabled( get_post_type() ) || in_array( get_post_type(), \lsx\sharing\includes\functions\get_restricted_post_types() ) || in_array( get_post_type(), \lsx\sharing\includes\functions\get_to_post_types() ) || in_array( get_post_type(), \lsx\sharing\includes\functions\get_hp_post_types() ) ) { |
|
195 | + if (\lsx\sharing\includes\functions\is_disabled() || \lsx\sharing\includes\functions\is_pt_disabled(get_post_type()) || in_array(get_post_type(), \lsx\sharing\includes\functions\get_restricted_post_types()) || in_array(get_post_type(), \lsx\sharing\includes\functions\get_to_post_types()) || in_array(get_post_type(), \lsx\sharing\includes\functions\get_hp_post_types())) { |
|
196 | 196 | return ''; |
197 | 197 | } |
198 | 198 | ?> |
@@ -211,8 +211,8 @@ discard block |
||
211 | 211 | * @param string $ical_links |
212 | 212 | * @return string |
213 | 213 | */ |
214 | - public function output_event_sharing( $ical_links = '' ) { |
|
215 | - if ( \lsx\sharing\includes\functions\is_disabled() || \lsx\sharing\includes\functions\is_pt_disabled( get_post_type() ) ) { |
|
214 | + public function output_event_sharing($ical_links = '') { |
|
215 | + if (\lsx\sharing\includes\functions\is_disabled() || \lsx\sharing\includes\functions\is_pt_disabled(get_post_type())) { |
|
216 | 216 | return ''; |
217 | 217 | } else { |
218 | 218 | $ical_links .= $this->sharing_buttons(); |
@@ -21,10 +21,10 @@ discard block |
||
21 | 21 | * Contructor |
22 | 22 | */ |
23 | 23 | public function __construct() { |
24 | - add_action( 'cmb2_admin_init', array( $this, 'register_settings_page' ) ); |
|
25 | - add_action( 'lsx_sharing_settings_page', array( $this, 'configure_general_fields' ), 15, 1 ); |
|
26 | - add_action( 'lsx_sharing_settings_page', array( $this, 'configure_archive_fields' ), 15, 1 ); |
|
27 | - add_action( 'admin_enqueue_scripts', array( $this, 'assets' ) ); |
|
24 | + add_action('cmb2_admin_init', array($this, 'register_settings_page')); |
|
25 | + add_action('lsx_sharing_settings_page', array($this, 'configure_general_fields'), 15, 1); |
|
26 | + add_action('lsx_sharing_settings_page', array($this, 'configure_archive_fields'), 15, 1); |
|
27 | + add_action('admin_enqueue_scripts', array($this, 'assets')); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public static function get_instance() { |
38 | 38 | // If the single instance hasn't been set, set it now. |
39 | - if ( null == self::$instance ) { |
|
39 | + if (null == self::$instance) { |
|
40 | 40 | self::$instance = new self(); |
41 | 41 | } |
42 | 42 | return self::$instance; |
@@ -50,22 +50,22 @@ discard block |
||
50 | 50 | public function register_settings_page() { |
51 | 51 | $args = array( |
52 | 52 | 'id' => 'lsx_sharing_settings', |
53 | - 'title' => '<h1>' . esc_html__( 'LSX Sharing Settings', 'lsx-search' ) . ' <span class="version">' . LSX_SHARING_VER . '</span></h1>', |
|
54 | - 'menu_title' => esc_html__( 'LSX Sharing', 'search' ), // Falls back to 'title' (above). |
|
55 | - 'object_types' => array( 'options-page' ), |
|
53 | + 'title' => '<h1>' . esc_html__('LSX Sharing Settings', 'lsx-search') . ' <span class="version">' . LSX_SHARING_VER . '</span></h1>', |
|
54 | + 'menu_title' => esc_html__('LSX Sharing', 'search'), // Falls back to 'title' (above). |
|
55 | + 'object_types' => array('options-page'), |
|
56 | 56 | 'option_key' => 'lsx-sharing-settings', // The option key and admin menu page slug. |
57 | 57 | 'parent_slug' => 'options-general.php', |
58 | 58 | 'capability' => 'manage_options', // Cap required to view options-page. |
59 | 59 | ); |
60 | - $cmb = new_cmb2_box( $args ); |
|
61 | - do_action( 'lsx_sharing_settings_page', $cmb ); |
|
60 | + $cmb = new_cmb2_box($args); |
|
61 | + do_action('lsx_sharing_settings_page', $cmb); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | 65 | * Enqueue JS and CSS. |
66 | 66 | */ |
67 | - public function assets( $hook ) { |
|
68 | - wp_enqueue_style( 'lsx-sharing-admin', LSX_SHARING_URL . 'assets/css/lsx-sharing-admin.css', array(), LSX_SHARING_VER ); |
|
67 | + public function assets($hook) { |
|
68 | + wp_enqueue_style('lsx-sharing-admin', LSX_SHARING_URL . 'assets/css/lsx-sharing-admin.css', array(), LSX_SHARING_VER); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @return void |
75 | 75 | */ |
76 | - public function configure_general_fields( $cmb ) { |
|
76 | + public function configure_general_fields($cmb) { |
|
77 | 77 | $global_args = array( |
78 | - 'title' => __( 'Global', 'lsx-search' ), |
|
79 | - 'desc' => esc_html__( 'Control the sharing WordPress post types.', 'lsx-search' ), |
|
78 | + 'title' => __('Global', 'lsx-search'), |
|
79 | + 'desc' => esc_html__('Control the sharing WordPress post types.', 'lsx-search'), |
|
80 | 80 | ); |
81 | - $this->get_fields( $cmb, 'global', $global_args ); |
|
81 | + $this->get_fields($cmb, 'global', $global_args); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -88,73 +88,73 @@ discard block |
||
88 | 88 | * @param string $position either top of bottom. |
89 | 89 | * @return void |
90 | 90 | */ |
91 | - public function configure_archive_fields( $cmb ) { |
|
91 | + public function configure_archive_fields($cmb) { |
|
92 | 92 | $archives = array(); |
93 | 93 | $post_type_args = array( |
94 | 94 | 'public' => true, |
95 | 95 | ); |
96 | - $post_types = get_post_types( $post_type_args ); |
|
97 | - if ( ! empty( $post_types ) ) { |
|
98 | - foreach ( $post_types as $post_type_key => $post_type_value ) { |
|
99 | - switch ( $post_type_key ) { |
|
96 | + $post_types = get_post_types($post_type_args); |
|
97 | + if ( ! empty($post_types)) { |
|
98 | + foreach ($post_types as $post_type_key => $post_type_value) { |
|
99 | + switch ($post_type_key) { |
|
100 | 100 | case 'post': |
101 | 101 | $page_url = home_url(); |
102 | - $page_title = __( 'Home', 'lsx-search' ); |
|
103 | - $show_on_front = get_option( 'show_on_front' ); |
|
104 | - if ( 'page' === $show_on_front ) { |
|
105 | - $page_for_posts = get_option( 'page_for_posts' ); |
|
106 | - if ( '' !== $page_for_posts ) { |
|
107 | - $page_title = get_the_title( $page_for_posts ); |
|
108 | - $page_url = get_permalink( $page_for_posts ); |
|
102 | + $page_title = __('Home', 'lsx-search'); |
|
103 | + $show_on_front = get_option('show_on_front'); |
|
104 | + if ('page' === $show_on_front) { |
|
105 | + $page_for_posts = get_option('page_for_posts'); |
|
106 | + if ('' !== $page_for_posts) { |
|
107 | + $page_title = get_the_title($page_for_posts); |
|
108 | + $page_url = get_permalink($page_for_posts); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | $description = sprintf( |
112 | 112 | /* translators: %s: The subscription info */ |
113 | - __( 'Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> posts.', 'lsx-search' ), |
|
113 | + __('Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> posts.', 'lsx-search'), |
|
114 | 114 | $page_url, |
115 | 115 | $page_title |
116 | 116 | ); |
117 | - $archives[ $post_type_key ] = array( |
|
118 | - 'title' => __( 'Blog', 'lsx-search' ), |
|
117 | + $archives[$post_type_key] = array( |
|
118 | + 'title' => __('Blog', 'lsx-search'), |
|
119 | 119 | 'desc' => $description, |
120 | 120 | ); |
121 | 121 | break; |
122 | 122 | |
123 | 123 | case 'product': |
124 | 124 | $page_url = home_url(); |
125 | - $page_title = __( 'Shop', 'lsx-search' ); |
|
126 | - if ( function_exists( 'wc_get_page_id' ) ) { |
|
127 | - $shop_page = wc_get_page_id( 'shop' ); |
|
128 | - $page_url = get_permalink( $shop_page ); |
|
129 | - $page_title = get_the_title( $shop_page ); |
|
125 | + $page_title = __('Shop', 'lsx-search'); |
|
126 | + if (function_exists('wc_get_page_id')) { |
|
127 | + $shop_page = wc_get_page_id('shop'); |
|
128 | + $page_url = get_permalink($shop_page); |
|
129 | + $page_title = get_the_title($shop_page); |
|
130 | 130 | } |
131 | 131 | $description = sprintf( |
132 | 132 | /* translators: %s: The subscription info */ |
133 | - __( 'Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> product pages.', 'lsx-search' ), |
|
133 | + __('Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> product pages.', 'lsx-search'), |
|
134 | 134 | $page_url, |
135 | 135 | $page_title |
136 | 136 | ); |
137 | - $archives[ $post_type_key ] = array( |
|
138 | - 'title' => __( 'Shop', 'lsx-search' ), |
|
137 | + $archives[$post_type_key] = array( |
|
138 | + 'title' => __('Shop', 'lsx-search'), |
|
139 | 139 | 'desc' => $description, |
140 | 140 | ); |
141 | 141 | break; |
142 | 142 | |
143 | 143 | default: |
144 | - if ( in_array( $post_type_key, \lsx\sharing\includes\functions\get_restricted_post_types() ) ) { |
|
144 | + if (in_array($post_type_key, \lsx\sharing\includes\functions\get_restricted_post_types())) { |
|
145 | 145 | break; |
146 | 146 | } |
147 | - $temp_post_type = get_post_type_object( $post_type_key ); |
|
148 | - if ( ! is_wp_error( $temp_post_type ) ) { |
|
149 | - $page_url = get_post_type_archive_link( $temp_post_type->name ); |
|
147 | + $temp_post_type = get_post_type_object($post_type_key); |
|
148 | + if ( ! is_wp_error($temp_post_type)) { |
|
149 | + $page_url = get_post_type_archive_link($temp_post_type->name); |
|
150 | 150 | $description = sprintf( |
151 | 151 | /* translators: %s: The subscription info */ |
152 | - __( 'Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> singles.', 'lsx-search' ), |
|
152 | + __('Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> singles.', 'lsx-search'), |
|
153 | 153 | $page_url, |
154 | 154 | $temp_post_type->label |
155 | 155 | ); |
156 | 156 | |
157 | - $archives[ $post_type_key ] = array( |
|
157 | + $archives[$post_type_key] = array( |
|
158 | 158 | 'title' => $temp_post_type->label, |
159 | 159 | 'desc' => $description, |
160 | 160 | ); |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | } |
164 | 164 | } |
165 | 165 | } |
166 | - if ( ! empty( $archives ) ) { |
|
167 | - foreach ( $archives as $archive_key => $archive_args ) { |
|
168 | - $this->get_fields( $cmb, $archive_key, $archive_args ); |
|
166 | + if ( ! empty($archives)) { |
|
167 | + foreach ($archives as $archive_key => $archive_args) { |
|
168 | + $this->get_fields($cmb, $archive_key, $archive_args); |
|
169 | 169 | } |
170 | 170 | } |
171 | 171 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | * @param array $args |
178 | 178 | * @return void |
179 | 179 | */ |
180 | - public function get_fields( $cmb, $section, $args ) { |
|
180 | + public function get_fields($cmb, $section, $args) { |
|
181 | 181 | $cmb->add_field( |
182 | 182 | array( |
183 | 183 | 'id' => 'settings_' . $section . '_sharing', |
@@ -187,21 +187,21 @@ discard block |
||
187 | 187 | 'description' => $args['desc'], |
188 | 188 | ) |
189 | 189 | ); |
190 | - if ( 'global' === $section ) { |
|
190 | + if ('global' === $section) { |
|
191 | 191 | $cmb->add_field( |
192 | 192 | array( |
193 | - 'name' => esc_html__( 'Disable all', 'lsx-sharing' ), |
|
193 | + 'name' => esc_html__('Disable all', 'lsx-sharing'), |
|
194 | 194 | 'id' => $section . '_disable_all', |
195 | - 'description' => esc_html__( 'Disable all share buttons on the site', 'lsx-sharing' ), |
|
195 | + 'description' => esc_html__('Disable all share buttons on the site', 'lsx-sharing'), |
|
196 | 196 | 'type' => 'checkbox', |
197 | 197 | ) |
198 | 198 | ); |
199 | 199 | } else { |
200 | 200 | $cmb->add_field( |
201 | 201 | array( |
202 | - 'name' => esc_html__( 'Disable', 'lsx-sharing' ), |
|
202 | + 'name' => esc_html__('Disable', 'lsx-sharing'), |
|
203 | 203 | 'id' => $section . '_disable_pt', |
204 | - 'description' => esc_html__( 'Disable the share buttons on this post type', 'lsx-sharing' ), |
|
204 | + 'description' => esc_html__('Disable the share buttons on this post type', 'lsx-sharing'), |
|
205 | 205 | 'type' => 'checkbox', |
206 | 206 | ) |
207 | 207 | ); |
@@ -209,44 +209,44 @@ discard block |
||
209 | 209 | |
210 | 210 | $cmb->add_field( |
211 | 211 | array( |
212 | - 'name' => esc_html__( 'Label text', 'lsx-sharing' ), |
|
212 | + 'name' => esc_html__('Label text', 'lsx-sharing'), |
|
213 | 213 | 'id' => $section . '_label_text', |
214 | - 'description' => esc_html__( 'A default label for the sharing.', 'lsx-sharing' ), |
|
214 | + 'description' => esc_html__('A default label for the sharing.', 'lsx-sharing'), |
|
215 | 215 | 'type' => 'text', |
216 | 216 | ) |
217 | 217 | ); |
218 | - if ( 'global' === $section || ( 'global' !== $section && ! \lsx\sharing\includes\functions\is_button_disabled( 'global', 'facebook' ) ) ) { |
|
218 | + if ('global' === $section || ('global' !== $section && ! \lsx\sharing\includes\functions\is_button_disabled('global', 'facebook'))) { |
|
219 | 219 | $cmb->add_field( |
220 | 220 | array( |
221 | - 'name' => esc_html__( 'Disable Facebook', 'lsx-sharing' ), |
|
221 | + 'name' => esc_html__('Disable Facebook', 'lsx-sharing'), |
|
222 | 222 | 'id' => $section . '_disable_facebook', |
223 | - 'description' => esc_html__( 'Disable Facebook share button.', 'lsx-sharing' ), |
|
223 | + 'description' => esc_html__('Disable Facebook share button.', 'lsx-sharing'), |
|
224 | 224 | 'type' => 'checkbox', |
225 | 225 | ) |
226 | 226 | ); |
227 | 227 | } |
228 | - if ( 'global' === $section || ( 'global' !== $section && ! \lsx\sharing\includes\functions\is_button_disabled( 'global', 'twitter' ) ) ) { |
|
228 | + if ('global' === $section || ('global' !== $section && ! \lsx\sharing\includes\functions\is_button_disabled('global', 'twitter'))) { |
|
229 | 229 | $cmb->add_field( |
230 | 230 | array( |
231 | - 'name' => esc_html__( 'Disable Twitter', 'lsx-sharing' ), |
|
231 | + 'name' => esc_html__('Disable Twitter', 'lsx-sharing'), |
|
232 | 232 | 'id' => $section . '_disable_twitter', |
233 | - 'description' => esc_html__( 'Disable Twitter share button.', 'lsx-sharing' ), |
|
233 | + 'description' => esc_html__('Disable Twitter share button.', 'lsx-sharing'), |
|
234 | 234 | 'type' => 'checkbox', |
235 | 235 | ) |
236 | 236 | ); |
237 | 237 | } |
238 | - if ( 'global' === $section || ( 'global' !== $section && ! \lsx\sharing\includes\functions\is_button_disabled( 'global', 'pinterest' ) ) ) { |
|
238 | + if ('global' === $section || ('global' !== $section && ! \lsx\sharing\includes\functions\is_button_disabled('global', 'pinterest'))) { |
|
239 | 239 | $cmb->add_field( |
240 | 240 | array( |
241 | - 'name' => esc_html__( 'Disable Pinterest', 'lsx-sharing' ), |
|
241 | + 'name' => esc_html__('Disable Pinterest', 'lsx-sharing'), |
|
242 | 242 | 'id' => $section . '_disable_pinterest', |
243 | - 'description' => esc_html__( 'Disable Pinterest button.', 'lsx-sharing' ), |
|
243 | + 'description' => esc_html__('Disable Pinterest button.', 'lsx-sharing'), |
|
244 | 244 | 'type' => 'checkbox', |
245 | 245 | ) |
246 | 246 | ); |
247 | 247 | } |
248 | 248 | |
249 | - do_action( 'lsx_sharing_settings_section', $cmb, $section ); |
|
249 | + do_action('lsx_sharing_settings_section', $cmb, $section); |
|
250 | 250 | $cmb->add_field( |
251 | 251 | array( |
252 | 252 | 'id' => $section . '_title_closing', |