@@ -6,11 +6,11 @@ discard block |
||
6 | 6 | * @subpackage config |
7 | 7 | */ |
8 | 8 | |
9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
9 | +if ( ! defined('ABSPATH')) { |
|
10 | 10 | exit; |
11 | 11 | } |
12 | 12 | |
13 | -if ( ! function_exists( 'lsx_setup' ) ) : |
|
13 | +if ( ! function_exists('lsx_setup')) : |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * Theme after_setup_theme action. |
@@ -22,26 +22,26 @@ discard block |
||
22 | 22 | global $content_width; |
23 | 23 | $content_width = 1140; |
24 | 24 | |
25 | - load_theme_textdomain( 'lsx', get_template_directory() . '/languages' ); |
|
25 | + load_theme_textdomain('lsx', get_template_directory() . '/languages'); |
|
26 | 26 | |
27 | - add_image_size( 'lsx-thumbnail-carousel', 350, 230, true ); |
|
28 | - add_image_size( 'lsx-thumbnail-wide', 360, 168, true ); |
|
29 | - add_image_size( 'lsx-thumbnail-square', 350, 350, true ); |
|
30 | - add_image_size( 'lsx-thumbnail-single', 750, 350, true ); |
|
31 | - add_image_size( 'lsx-banner', 1920, 600, true ); |
|
27 | + add_image_size('lsx-thumbnail-carousel', 350, 230, true); |
|
28 | + add_image_size('lsx-thumbnail-wide', 360, 168, true); |
|
29 | + add_image_size('lsx-thumbnail-square', 350, 350, true); |
|
30 | + add_image_size('lsx-thumbnail-single', 750, 350, true); |
|
31 | + add_image_size('lsx-banner', 1920, 600, true); |
|
32 | 32 | |
33 | 33 | register_nav_menus( |
34 | 34 | array( |
35 | - 'primary' => esc_html__( 'Primary Menu', 'lsx' ), |
|
36 | - 'top-menu' => esc_html__( 'Top Menu (right)', 'lsx' ), |
|
37 | - 'top-menu-left' => esc_html__( 'Top Menu (left)', 'lsx' ), |
|
38 | - 'social' => esc_html__( 'Social Menu', 'lsx' ), |
|
39 | - 'footer' => esc_html__( 'Footer Menu', 'lsx' ), |
|
35 | + 'primary' => esc_html__('Primary Menu', 'lsx'), |
|
36 | + 'top-menu' => esc_html__('Top Menu (right)', 'lsx'), |
|
37 | + 'top-menu-left' => esc_html__('Top Menu (left)', 'lsx'), |
|
38 | + 'social' => esc_html__('Social Menu', 'lsx'), |
|
39 | + 'footer' => esc_html__('Footer Menu', 'lsx'), |
|
40 | 40 | ) |
41 | 41 | ); |
42 | 42 | |
43 | - add_theme_support( 'automatic-feed-links' ); |
|
44 | - add_theme_support( 'custom-background' ); |
|
43 | + add_theme_support('automatic-feed-links'); |
|
44 | + add_theme_support('custom-background'); |
|
45 | 45 | |
46 | 46 | add_theme_support( |
47 | 47 | 'custom-logo', |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | ) |
54 | 54 | ); |
55 | 55 | |
56 | - add_theme_support( 'html5', array( 'caption' ) ); |
|
56 | + add_theme_support('html5', array('caption')); |
|
57 | 57 | |
58 | 58 | add_theme_support( |
59 | 59 | 'post-formats', |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | ) |
67 | 67 | ); |
68 | 68 | |
69 | - add_theme_support( 'post-thumbnails' ); |
|
70 | - add_theme_support( 'sensei' ); |
|
69 | + add_theme_support('post-thumbnails'); |
|
70 | + add_theme_support('sensei'); |
|
71 | 71 | |
72 | 72 | add_theme_support( |
73 | 73 | 'site-logo', |
@@ -80,14 +80,14 @@ discard block |
||
80 | 80 | ) |
81 | 81 | ); |
82 | 82 | |
83 | - add_theme_support( 'title-tag' ); |
|
83 | + add_theme_support('title-tag'); |
|
84 | 84 | |
85 | 85 | /* |
86 | 86 | * @TODO - Necessary to test it |
87 | 87 | */ |
88 | 88 | // add_theme_support( 'woocommerce' ); |
89 | 89 | |
90 | - add_theme_support( 'starter-content', array( |
|
90 | + add_theme_support('starter-content', array( |
|
91 | 91 | 'widgets' => array( |
92 | 92 | 'sidebar-home' => array( |
93 | 93 | 'custom_widget_1' => array( |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | array( |
97 | 97 | 'title' => '', |
98 | - 'text' => wp_kses_post( '<div class="row"><div class="col-sm-12 text-center"><h3>Build your perfect website <small>with the LSX theme</small></h3></div></div><div class="row"><div class="col-sm-4 text-center"><h4>Fast</h4><p>"Quick" isn\'t a word most people use when describing their website building experience.</p></div><div class="col-sm-4 text-center"><h4>Easy</h4><p>We\'ve built websites for countless clients, and we know what kind of back-end makes sense easily.</p></div><div class="col-sm-4 text-center"><h4>Comprehensive</h4><p>The LSX extensions come with features out the box that are essential.</p></div></div>' ), |
|
98 | + 'text' => wp_kses_post('<div class="row"><div class="col-sm-12 text-center"><h3>Build your perfect website <small>with the LSX theme</small></h3></div></div><div class="row"><div class="col-sm-4 text-center"><h4>Fast</h4><p>"Quick" isn\'t a word most people use when describing their website building experience.</p></div><div class="col-sm-4 text-center"><h4>Easy</h4><p>We\'ve built websites for countless clients, and we know what kind of back-end makes sense easily.</p></div><div class="col-sm-4 text-center"><h4>Comprehensive</h4><p>The LSX extensions come with features out the box that are essential.</p></div></div>'), |
|
99 | 99 | ), |
100 | 100 | ), |
101 | 101 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | array( |
106 | 106 | 'title' => '', |
107 | - 'text' => wp_kses_post( '<div class="lsx-full-width-alt"><div class="row"><div class="col-xs-12"><h3>A big CTA title</h3><p class="text-center"><a class="btn cta-btn" href="http://www.lsdeb.biz/" target="_blank" rel="noreferrer noopener">Hire Us</a><p></div></div></div>' ), |
|
107 | + 'text' => wp_kses_post('<div class="lsx-full-width-alt"><div class="row"><div class="col-xs-12"><h3>A big CTA title</h3><p class="text-center"><a class="btn cta-btn" href="http://www.lsdeb.biz/" target="_blank" rel="noreferrer noopener">Hire Us</a><p></div></div></div>'), |
|
108 | 108 | ), |
109 | 109 | ), |
110 | 110 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | array( |
115 | 115 | 'title' => '', |
116 | - 'text' => wp_kses_post( '<div class="row"><div class="col-xs-12"><h3>Homepage Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.</p></div></div>' ), |
|
116 | + 'text' => wp_kses_post('<div class="row"><div class="col-xs-12"><h3>Homepage Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.</p></div></div>'), |
|
117 | 117 | ), |
118 | 118 | ), |
119 | 119 | ), |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | 'text', |
124 | 124 | |
125 | 125 | array( |
126 | - 'title' => esc_html__( 'Space for Footer Widgets', 'lsx' ), |
|
127 | - 'text' => esc_html__( 'This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx' ), |
|
126 | + 'title' => esc_html__('Space for Footer Widgets', 'lsx'), |
|
127 | + 'text' => esc_html__('This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx'), |
|
128 | 128 | ), |
129 | 129 | ), |
130 | 130 | |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | 'text', |
133 | 133 | |
134 | 134 | array( |
135 | - 'title' => esc_html__( 'Space for Footer Widgets', 'lsx' ), |
|
136 | - 'text' => esc_html__( 'This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx' ), |
|
135 | + 'title' => esc_html__('Space for Footer Widgets', 'lsx'), |
|
136 | + 'text' => esc_html__('This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx'), |
|
137 | 137 | ), |
138 | 138 | ), |
139 | 139 | |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | 'text', |
142 | 142 | |
143 | 143 | array( |
144 | - 'title' => esc_html__( 'Contact us:', 'lsx' ), |
|
145 | - 'text' => wp_kses_post( '<a href="mailto:[email protected]><i class="fa fa-envelope fa-fw"></i> [email protected]</a><br><a href="tel:+27214489843"><i class="fa fa-phone fa-fw"></i> +27 21 448 9843</a><br><i class="fa fa-skype fa-fw"></i> /lightspeeddevelopment' ), |
|
144 | + 'title' => esc_html__('Contact us:', 'lsx'), |
|
145 | + 'text' => wp_kses_post('<a href="mailto:[email protected]><i class="fa fa-envelope fa-fw"></i> [email protected]</a><br><a href="tel:+27214489843"><i class="fa fa-phone fa-fw"></i> +27 21 448 9843</a><br><i class="fa fa-skype fa-fw"></i> /lightspeeddevelopment'), |
|
146 | 146 | ), |
147 | 147 | ), |
148 | 148 | ), |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | 'text', |
153 | 153 | |
154 | 154 | array( |
155 | - 'title' => esc_html__( 'A Footer Call to Action', 'lsx' ), |
|
156 | - 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.', 'lsx' ), |
|
155 | + 'title' => esc_html__('A Footer Call to Action', 'lsx'), |
|
156 | + 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.', 'lsx'), |
|
157 | 157 | ), |
158 | 158 | ), |
159 | 159 | ), |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | 'home' => array( |
164 | 164 | 'template' => 'page-templates/template-front-page.php', |
165 | 165 | 'thumbnail' => '{{image-banner-example-01}}', |
166 | - 'post_title' => esc_html__( 'LSX is a free WordPress theme', 'lsx' ), |
|
166 | + 'post_title' => esc_html__('LSX is a free WordPress theme', 'lsx'), |
|
167 | 167 | 'post_content' => '', |
168 | 168 | ), |
169 | 169 | |
@@ -180,17 +180,17 @@ discard block |
||
180 | 180 | |
181 | 181 | 'attachments' => array( |
182 | 182 | 'image-banner-example-01' => array( |
183 | - 'post_title' => esc_html_x( 'Banner Example 01', 'Theme starter content', 'lsx' ), |
|
183 | + 'post_title' => esc_html_x('Banner Example 01', 'Theme starter content', 'lsx'), |
|
184 | 184 | 'file' => 'assets/images/admin/banner-example-01.jpg', |
185 | 185 | ), |
186 | 186 | |
187 | 187 | 'image-banner-example-02' => array( |
188 | - 'post_title' => esc_html_x( 'Banner Example 02', 'Theme starter content', 'lsx' ), |
|
188 | + 'post_title' => esc_html_x('Banner Example 02', 'Theme starter content', 'lsx'), |
|
189 | 189 | 'file' => 'assets/images/admin/banner-example-02.jpg', |
190 | 190 | ), |
191 | 191 | |
192 | 192 | 'image-banner-example-03' => array( |
193 | - 'post_title' => esc_html_x( 'Banner Example 03', 'Theme starter content', 'lsx' ), |
|
193 | + 'post_title' => esc_html_x('Banner Example 03', 'Theme starter content', 'lsx'), |
|
194 | 194 | 'file' => 'assets/images/admin/banner-example-03.jpg', |
195 | 195 | ), |
196 | 196 | ), |
@@ -199,12 +199,12 @@ discard block |
||
199 | 199 | 'show_on_front' => 'page', |
200 | 200 | 'page_on_front' => '{{home}}', |
201 | 201 | 'page_for_posts' => '{{blog}}', |
202 | - 'blogdescription' => esc_html__( 'LSX starter content example', 'lsx' ), |
|
202 | + 'blogdescription' => esc_html__('LSX starter content example', 'lsx'), |
|
203 | 203 | ), |
204 | 204 | |
205 | 205 | 'nav_menus' => array( |
206 | 206 | 'primary' => array( |
207 | - 'name' => esc_html__( 'Primary Menu', 'lsx' ), |
|
207 | + 'name' => esc_html__('Primary Menu', 'lsx'), |
|
208 | 208 | |
209 | 209 | 'items' => array( |
210 | 210 | 'page_home', |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | ), |
216 | 216 | |
217 | 217 | 'top-menu' => array( |
218 | - 'name' => esc_html__( 'Top Menu', 'lsx' ), |
|
218 | + 'name' => esc_html__('Top Menu', 'lsx'), |
|
219 | 219 | |
220 | 220 | 'items' => array( |
221 | 221 | 'custom_link_1' => array( |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | ), |
244 | 244 | |
245 | 245 | 'social' => array( |
246 | - 'name' => esc_html__( 'Social Menu', 'lsx' ), |
|
246 | + 'name' => esc_html__('Social Menu', 'lsx'), |
|
247 | 247 | |
248 | 248 | 'items' => array( |
249 | 249 | 'link_facebook', |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | ), |
259 | 259 | |
260 | 260 | 'footer' => array( |
261 | - 'name' => esc_html__( 'Footer Menu', 'lsx' ), |
|
261 | + 'name' => esc_html__('Footer Menu', 'lsx'), |
|
262 | 262 | |
263 | 263 | 'items' => array( |
264 | 264 | 'page_about', |
@@ -272,14 +272,14 @@ discard block |
||
272 | 272 | 'lsx_header_search' => false, |
273 | 273 | 'lsx_layout' => '1c', |
274 | 274 | ), |
275 | - ) ); |
|
275 | + )); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | endif; |
279 | 279 | |
280 | -add_action( 'after_setup_theme', 'lsx_setup' ); |
|
280 | +add_action('after_setup_theme', 'lsx_setup'); |
|
281 | 281 | |
282 | -if ( ! function_exists( 'lsx_init' ) ) : |
|
282 | +if ( ! function_exists('lsx_init')) : |
|
283 | 283 | |
284 | 284 | /** |
285 | 285 | * Theme init action. |
@@ -288,20 +288,20 @@ discard block |
||
288 | 288 | * @subpackage config |
289 | 289 | */ |
290 | 290 | function lsx_init() { |
291 | - add_post_type_support( 'page', 'excerpt' ); |
|
291 | + add_post_type_support('page', 'excerpt'); |
|
292 | 292 | |
293 | - if ( class_exists( 'WooCommerce' ) ) { |
|
294 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 ); |
|
293 | + if (class_exists('WooCommerce')) { |
|
294 | + remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20); |
|
295 | 295 | } |
296 | 296 | |
297 | - remove_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce', 10 ); |
|
297 | + remove_action('comment_form', 'wp_comment_form_unfiltered_html_nonce', 10); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | endif; |
301 | 301 | |
302 | -add_action( 'init', 'lsx_init', 100 ); |
|
302 | +add_action('init', 'lsx_init', 100); |
|
303 | 303 | |
304 | -if ( ! function_exists( 'lsx_process_content_width' ) ) : |
|
304 | +if ( ! function_exists('lsx_process_content_width')) : |
|
305 | 305 | |
306 | 306 | /** |
307 | 307 | * Overwrite the $content_width var, based on the layout of the page. |
@@ -313,8 +313,8 @@ discard block |
||
313 | 313 | global $content_width; |
314 | 314 | |
315 | 315 | if ( |
316 | - is_page_template( 'page-templates/template-front-page.php' ) || |
|
317 | - is_page_template( 'page-templates/template-full-width.php' ) |
|
316 | + is_page_template('page-templates/template-front-page.php') || |
|
317 | + is_page_template('page-templates/template-full-width.php') |
|
318 | 318 | ) { |
319 | 319 | $content_width = 1140; |
320 | 320 | } |
@@ -322,9 +322,9 @@ discard block |
||
322 | 322 | |
323 | 323 | endif; |
324 | 324 | |
325 | -add_action( 'wp_head', 'lsx_process_content_width' ); |
|
325 | +add_action('wp_head', 'lsx_process_content_width'); |
|
326 | 326 | |
327 | -if ( ! function_exists( 'lsx_file_get_contents' ) ) : |
|
327 | +if ( ! function_exists('lsx_file_get_contents')) : |
|
328 | 328 | |
329 | 329 | /** |
330 | 330 | * Get file contents. |
@@ -332,19 +332,19 @@ discard block |
||
332 | 332 | * @package lsx |
333 | 333 | * @subpackage config |
334 | 334 | */ |
335 | - function lsx_file_get_contents( $file ) { |
|
336 | - if ( file_exists( $file ) ) { |
|
335 | + function lsx_file_get_contents($file) { |
|
336 | + if (file_exists($file)) { |
|
337 | 337 | global $wp_filesystem; |
338 | 338 | |
339 | - if ( empty( $wp_filesystem ) ) { |
|
340 | - require_once( ABSPATH . 'wp-admin/includes/file.php' ); |
|
339 | + if (empty($wp_filesystem)) { |
|
340 | + require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
341 | 341 | WP_Filesystem(); |
342 | 342 | } |
343 | 343 | |
344 | - if ( $wp_filesystem ) { |
|
345 | - $contents = $wp_filesystem->get_contents( $file ); |
|
344 | + if ($wp_filesystem) { |
|
345 | + $contents = $wp_filesystem->get_contents($file); |
|
346 | 346 | |
347 | - if ( ! empty( $contents ) ) { |
|
347 | + if ( ! empty($contents)) { |
|
348 | 348 | return $contents; |
349 | 349 | } |
350 | 350 | } |
@@ -6,11 +6,11 @@ discard block |
||
6 | 6 | * @subpackage welcome-page |
7 | 7 | */ |
8 | 8 | |
9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
9 | +if ( ! defined('ABSPATH')) { |
|
10 | 10 | exit; |
11 | 11 | } |
12 | 12 | |
13 | -if ( ! function_exists( 'lsx_activation_admin_notice_dismiss' ) ) : |
|
13 | +if ( ! function_exists('lsx_activation_admin_notice_dismiss')) : |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * Dismiss the admin notice (successful activation). |
@@ -19,15 +19,15 @@ discard block |
||
19 | 19 | * @subpackage welcome-page |
20 | 20 | */ |
21 | 21 | function lsx_activation_admin_notice_dismiss() { |
22 | - update_option( 'lsx-notice-dismissed', '1' ); |
|
22 | + update_option('lsx-notice-dismissed', '1'); |
|
23 | 23 | wp_die(); |
24 | 24 | } |
25 | 25 | |
26 | 26 | endif; |
27 | 27 | |
28 | -add_action( 'wp_ajax_lsx_dismiss_theme_notice', 'lsx_activation_admin_notice_dismiss' ); |
|
28 | +add_action('wp_ajax_lsx_dismiss_theme_notice', 'lsx_activation_admin_notice_dismiss'); |
|
29 | 29 | |
30 | -if ( ! function_exists( 'lsx_activation_admin_notice' ) ) : |
|
30 | +if ( ! function_exists('lsx_activation_admin_notice')) : |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Adds an admin notice upon successful activation. |
@@ -36,16 +36,16 @@ discard block |
||
36 | 36 | * @subpackage welcome-page |
37 | 37 | */ |
38 | 38 | function lsx_activation_admin_notice() { |
39 | - if ( empty( get_option( 'lsx-notice-dismissed' ) ) ) { |
|
40 | - add_action( 'admin_notices', 'lsx_welcome_admin_notice', 99 ); |
|
39 | + if (empty(get_option('lsx-notice-dismissed'))) { |
|
40 | + add_action('admin_notices', 'lsx_welcome_admin_notice', 99); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | 44 | endif; |
45 | 45 | |
46 | -add_action( 'admin_notices', 'lsx_activation_admin_notice' ); |
|
46 | +add_action('admin_notices', 'lsx_activation_admin_notice'); |
|
47 | 47 | |
48 | -if ( ! function_exists( 'lsx_welcome_admin_notice' ) ) : |
|
48 | +if ( ! function_exists('lsx_welcome_admin_notice')) : |
|
49 | 49 | |
50 | 50 | /** |
51 | 51 | * Display an admin notice linking to the welcome screen. |
@@ -60,20 +60,20 @@ discard block |
||
60 | 60 | <?php |
61 | 61 | printf( |
62 | 62 | /* Translators: 1: HTML open tag link, 2: HTML close tag link */ |
63 | - esc_html__( 'Thanks for choosing LSX! You can read hints and tips on how get the most out of your new theme on the %1$swelcome screen%2$s.', 'lsx' ), |
|
64 | - '<a href="' . esc_url( admin_url( 'themes.php?page=lsx-welcome' ) ) . '">', |
|
63 | + esc_html__('Thanks for choosing LSX! You can read hints and tips on how get the most out of your new theme on the %1$swelcome screen%2$s.', 'lsx'), |
|
64 | + '<a href="' . esc_url(admin_url('themes.php?page=lsx-welcome')) . '">', |
|
65 | 65 | '</a>' |
66 | 66 | ); |
67 | 67 | ?> |
68 | 68 | </p> |
69 | - <p><a href="<?php echo esc_url( admin_url( 'themes.php?page=lsx-welcome' ) ); ?>" class="button" style="text-decoration: none;"><?php esc_attr_e( 'Get started with LSX', 'lsx' ); ?></a></p> |
|
69 | + <p><a href="<?php echo esc_url(admin_url('themes.php?page=lsx-welcome')); ?>" class="button" style="text-decoration: none;"><?php esc_attr_e('Get started with LSX', 'lsx'); ?></a></p> |
|
70 | 70 | </div> |
71 | 71 | <?php |
72 | 72 | } |
73 | 73 | |
74 | 74 | endif; |
75 | 75 | |
76 | -if ( ! function_exists( 'lsx_welcome_style' ) ) : |
|
76 | +if ( ! function_exists('lsx_welcome_style')) : |
|
77 | 77 | |
78 | 78 | /** |
79 | 79 | * Load welcome screen css. |
@@ -83,19 +83,19 @@ discard block |
||
83 | 83 | * |
84 | 84 | * @param string $hook_suffix the current page hook suffix. |
85 | 85 | */ |
86 | - function lsx_welcome_style( $hook_suffix ) { |
|
87 | - if ( 'appearance_page_lsx-welcome' === $hook_suffix ) { |
|
88 | - wp_enqueue_style( 'lsx-welcome-screen-mailchimp', '//cdn-images.mailchimp.com/embedcode/classic-10_7.css', array(), LSX_VERSION ); |
|
89 | - wp_enqueue_style( 'lsx-welcome-screen', get_template_directory_uri() . '/assets/css/admin/welcome.css', array( 'lsx-welcome-screen-mailchimp' ), LSX_VERSION ); |
|
90 | - wp_style_add_data( 'lsx-welcome-screen', 'rtl', 'replace' ); |
|
86 | + function lsx_welcome_style($hook_suffix) { |
|
87 | + if ('appearance_page_lsx-welcome' === $hook_suffix) { |
|
88 | + wp_enqueue_style('lsx-welcome-screen-mailchimp', '//cdn-images.mailchimp.com/embedcode/classic-10_7.css', array(), LSX_VERSION); |
|
89 | + wp_enqueue_style('lsx-welcome-screen', get_template_directory_uri() . '/assets/css/admin/welcome.css', array('lsx-welcome-screen-mailchimp'), LSX_VERSION); |
|
90 | + wp_style_add_data('lsx-welcome-screen', 'rtl', 'replace'); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | 94 | endif; |
95 | 95 | |
96 | -add_action( 'admin_enqueue_scripts', 'lsx_welcome_style' ); |
|
96 | +add_action('admin_enqueue_scripts', 'lsx_welcome_style'); |
|
97 | 97 | |
98 | -if ( ! function_exists( 'lsx_welcome_register_menu' ) ) : |
|
98 | +if ( ! function_exists('lsx_welcome_register_menu')) : |
|
99 | 99 | |
100 | 100 | /** |
101 | 101 | * Creates the dashboard page. |
@@ -104,14 +104,14 @@ discard block |
||
104 | 104 | * @subpackage welcome-page |
105 | 105 | */ |
106 | 106 | function lsx_welcome_register_menu() { |
107 | - add_theme_page( 'LSX', 'LSX', 'activate_plugins', 'lsx-welcome', 'lsx_welcome_screen' ); |
|
107 | + add_theme_page('LSX', 'LSX', 'activate_plugins', 'lsx-welcome', 'lsx_welcome_screen'); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | endif; |
111 | 111 | |
112 | -add_action( 'admin_menu', 'lsx_welcome_register_menu' ); |
|
112 | +add_action('admin_menu', 'lsx_welcome_register_menu'); |
|
113 | 113 | |
114 | -if ( ! function_exists( 'lsx_welcome_screen' ) ) : |
|
114 | +if ( ! function_exists('lsx_welcome_screen')) : |
|
115 | 115 | |
116 | 116 | /** |
117 | 117 | * The welcome screen. |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * @hooked lsx_welcome_enhance - 20 |
134 | 134 | * @hooked lsx_welcome_footer - 30 |
135 | 135 | */ |
136 | - do_action( 'lsx_welcome' ); |
|
136 | + do_action('lsx_welcome'); |
|
137 | 137 | ?> |
138 | 138 | </div> |
139 | 139 | <?php |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | endif; |
143 | 143 | |
144 | -if ( ! function_exists( 'lsx_welcome_header' ) ) : |
|
144 | +if ( ! function_exists('lsx_welcome_header')) : |
|
145 | 145 | |
146 | 146 | /** |
147 | 147 | * Welcome screen intro. |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | |
156 | 156 | endif; |
157 | 157 | |
158 | -add_action( 'lsx_welcome', 'lsx_welcome_header', 10 ); |
|
158 | +add_action('lsx_welcome', 'lsx_welcome_header', 10); |
|
159 | 159 | |
160 | -if ( ! function_exists( 'lsx_welcome_enhance' ) ) : |
|
160 | +if ( ! function_exists('lsx_welcome_enhance')) : |
|
161 | 161 | |
162 | 162 | /** |
163 | 163 | * Welcome screen enhance section. |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | |
172 | 172 | endif; |
173 | 173 | |
174 | -add_action( 'lsx_welcome', 'lsx_welcome_enhance', 20 ); |
|
174 | +add_action('lsx_welcome', 'lsx_welcome_enhance', 20); |
|
175 | 175 | |
176 | -if ( ! function_exists( 'lsx_welcome_footer' ) ) : |
|
176 | +if ( ! function_exists('lsx_welcome_footer')) : |
|
177 | 177 | |
178 | 178 | /** |
179 | 179 | * Welcome screen contribute section. |
@@ -187,4 +187,4 @@ discard block |
||
187 | 187 | |
188 | 188 | endif; |
189 | 189 | |
190 | -add_action( 'lsx_welcome', 'lsx_welcome_footer', 30 ); |
|
190 | +add_action('lsx_welcome', 'lsx_welcome_footer', 30); |
@@ -6,11 +6,11 @@ discard block |
||
6 | 6 | * @subpackage widgets |
7 | 7 | */ |
8 | 8 | |
9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
9 | +if ( ! defined('ABSPATH')) { |
|
10 | 10 | exit; |
11 | 11 | } |
12 | 12 | |
13 | -if ( ! function_exists( 'lsx_widget_area_init' ) ) : |
|
13 | +if ( ! function_exists('lsx_widget_area_init')) : |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * Register widgetized area and update sidebar with default widgets. |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | function lsx_widget_area_init() { |
22 | 22 | register_sidebar( |
23 | 23 | array( |
24 | - 'name' => esc_html__( 'Home', 'lsx' ), |
|
24 | + 'name' => esc_html__('Home', 'lsx'), |
|
25 | 25 | 'id' => 'sidebar-home', |
26 | 26 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
27 | 27 | 'after_widget' => '</aside>', |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | register_sidebar( |
34 | 34 | array( |
35 | - 'name' => esc_html__( 'Sidebar', 'lsx' ), |
|
35 | + 'name' => esc_html__('Sidebar', 'lsx'), |
|
36 | 36 | 'id' => 'sidebar-1', |
37 | 37 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
38 | 38 | 'after_widget' => '</aside>', |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | register_sidebar( |
45 | 45 | array( |
46 | - 'name' => esc_html__( 'Footer', 'lsx' ), |
|
46 | + 'name' => esc_html__('Footer', 'lsx'), |
|
47 | 47 | 'id' => 'sidebar-footer', |
48 | 48 | 'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">', |
49 | 49 | 'after_widget' => '</aside></div>', |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | register_sidebar( |
56 | 56 | array( |
57 | - 'name' => esc_html__( 'Footer Call to Action', 'lsx' ), |
|
57 | + 'name' => esc_html__('Footer Call to Action', 'lsx'), |
|
58 | 58 | 'id' => 'sidebar-footer-cta', |
59 | 59 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
60 | 60 | 'after_widget' => '</aside>', |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | |
67 | 67 | endif; |
68 | 68 | |
69 | -add_action( 'widgets_init', 'lsx_widget_area_init' ); |
|
69 | +add_action('widgets_init', 'lsx_widget_area_init'); |
|
70 | 70 | |
71 | -if ( ! function_exists( 'lsx_sidebar_footer_params' ) ) : |
|
71 | +if ( ! function_exists('lsx_sidebar_footer_params')) : |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * Register widgetized area and update sidebar with default widgets. |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | * @package lsx |
77 | 77 | * @subpackage widgets |
78 | 78 | */ |
79 | - function lsx_sidebar_footer_params( $params ) { |
|
79 | + function lsx_sidebar_footer_params($params) { |
|
80 | 80 | $sidebar_id = $params[0]['id']; |
81 | 81 | |
82 | - if ( 'sidebar-footer' === $sidebar_id ) { |
|
82 | + if ('sidebar-footer' === $sidebar_id) { |
|
83 | 83 | $total_widgets = wp_get_sidebars_widgets(); |
84 | - $sidebar_widgets = count( $total_widgets[ $sidebar_id ] ); |
|
85 | - $params[0]['before_widget'] = str_replace( 'class="styler', 'class="col-md-' . floor( 12 / $sidebar_widgets ), $params[0]['before_widget'] ); |
|
84 | + $sidebar_widgets = count($total_widgets[$sidebar_id]); |
|
85 | + $params[0]['before_widget'] = str_replace('class="styler', 'class="col-md-' . floor(12 / $sidebar_widgets), $params[0]['before_widget']); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | return $params; |
@@ -90,4 +90,4 @@ discard block |
||
90 | 90 | |
91 | 91 | endif; |
92 | 92 | |
93 | -add_filter( 'dynamic_sidebar_params', 'lsx_sidebar_footer_params' ); |
|
93 | +add_filter('dynamic_sidebar_params', 'lsx_sidebar_footer_params'); |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @subpackage sensei |
7 | 7 | */ |
8 | 8 | |
9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
9 | +if ( ! defined('ABSPATH')) { |
|
10 | 10 | exit; // Exit if accessed directly. |
11 | 11 | } |
12 | 12 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * Constructor. |
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | - add_action( 'init', array( $this, 'init' ) ); |
|
29 | + add_action('init', array($this, 'init')); |
|
30 | 30 | } // End __construct() |
31 | 31 | |
32 | 32 | /** |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @return self |
36 | 36 | */ |
37 | 37 | public static function instance() { |
38 | - if ( ! self::$instance ) { |
|
38 | + if ( ! self::$instance) { |
|
39 | 39 | self::$instance = new self(); |
40 | 40 | } |
41 | 41 | return self::$instance; |
@@ -49,32 +49,32 @@ discard block |
||
49 | 49 | global $woothemes_sensei; |
50 | 50 | |
51 | 51 | // Switching the course filters and the headers around. |
52 | - remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 10, 0 ); |
|
53 | - remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_sorting' ) ); |
|
54 | - remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_filters' ) ); |
|
55 | - add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 11, 0 ); |
|
56 | - add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_sorting' ), 12 ); |
|
57 | - add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_filters' ), 12 ); |
|
52 | + remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 10, 0); |
|
53 | + remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting')); |
|
54 | + remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters')); |
|
55 | + add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 11, 0); |
|
56 | + add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting'), 12); |
|
57 | + add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters'), 12); |
|
58 | 58 | |
59 | 59 | // First add the thumbnail. |
60 | - add_action( 'sensei_course_content_inside_before', array( $this, 'get_course_thumbnail' ), 1 ); |
|
60 | + add_action('sensei_course_content_inside_before', array($this, 'get_course_thumbnail'), 1); |
|
61 | 61 | |
62 | 62 | // This is for our wrapper, we run it on 2, after the thumbnail we added. |
63 | - add_action( 'sensei_course_content_inside_before', array( $this, 'course_body_div_open' ), 1 ); |
|
64 | - add_action( 'sensei_course_content_inside_after', array( $this, 'course_body_div_close' ), 50 ); |
|
63 | + add_action('sensei_course_content_inside_before', array($this, 'course_body_div_open'), 1); |
|
64 | + add_action('sensei_course_content_inside_after', array($this, 'course_body_div_close'), 50); |
|
65 | 65 | |
66 | 66 | // This is for our wrapper, we run it on 2, after the thumbnail we added. |
67 | - add_action( 'sensei_course_content_inside_before', array( $this, 'course_body_div_results_open' ), 20 ); |
|
68 | - add_action( 'sensei_course_content_inside_after', array( $this, 'course_body_div_results_close' ), 49 ); |
|
67 | + add_action('sensei_course_content_inside_before', array($this, 'course_body_div_results_open'), 20); |
|
68 | + add_action('sensei_course_content_inside_after', array($this, 'course_body_div_results_close'), 49); |
|
69 | 69 | |
70 | - add_action( 'sensei_single_course_content_inside_before', array( $this, 'display_course_amount' ), 20 ); |
|
70 | + add_action('sensei_single_course_content_inside_before', array($this, 'display_course_amount'), 20); |
|
71 | 71 | |
72 | 72 | // removes the course image above the content. |
73 | - remove_action( 'sensei_course_content_inside_before', array( $woothemes_sensei->course, 'course_image' ), 30, 1 ); |
|
73 | + remove_action('sensei_course_content_inside_before', array($woothemes_sensei->course, 'course_image'), 30, 1); |
|
74 | 74 | // add the course image to the left of the content. |
75 | - add_action( 'lsx_sensei_course_content_inside_before', array( $woothemes_sensei->course, 'course_image' ), 30, 1 ); |
|
75 | + add_action('lsx_sensei_course_content_inside_before', array($woothemes_sensei->course, 'course_image'), 30, 1); |
|
76 | 76 | |
77 | - add_filter( 'attach_shortcode_hooks', 'lsx_attach_shortcode_hooks', 10, 1 ); |
|
77 | + add_filter('attach_shortcode_hooks', 'lsx_attach_shortcode_hooks', 10, 1); |
|
78 | 78 | |
79 | 79 | } |
80 | 80 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | public function get_course_thumbnail() { |
87 | 87 | ?> |
88 | 88 | <div class="course-thumbnail"> |
89 | - <?php do_action( 'lsx_sensei_course_content_inside_before', get_the_ID() ); ?> |
|
89 | + <?php do_action('lsx_sensei_course_content_inside_before', get_the_ID()); ?> |
|
90 | 90 | </div> |
91 | 91 | <?php |
92 | 92 | } |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function course_body_div_open() { |
100 | 100 | global $post, $current_user; |
101 | - $is_user_taking_course = Sensei_Utils::user_started_course( $post->ID, $current_user->ID ); |
|
101 | + $is_user_taking_course = Sensei_Utils::user_started_course($post->ID, $current_user->ID); |
|
102 | 102 | $user_taking_course_class = ''; |
103 | - if ( ! empty( $is_user_taking_course ) ) { |
|
103 | + if ( ! empty($is_user_taking_course)) { |
|
104 | 104 | $user_taking_course_class = 'currently-in-course'; |
105 | 105 | } |
106 | 106 | ?> |
107 | - <div class="course-body <?php echo esc_html( $user_taking_course_class ); ?>"> |
|
107 | + <div class="course-body <?php echo esc_html($user_taking_course_class); ?>"> |
|
108 | 108 | <?php |
109 | 109 | } |
110 | 110 | |
@@ -148,16 +148,16 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function display_course_amount() { |
150 | 150 | global $post, $current_user; |
151 | - $is_user_taking_course = Sensei_Utils::user_started_course( $post->ID, $current_user->ID ); |
|
152 | - $wc_post_id = absint( get_post_meta( $post->ID, '_course_woocommerce_product', true ) ); |
|
153 | - if ( class_exists( 'Sensei_WC' ) ) { |
|
154 | - $course_purchasable = Sensei_WC::is_course_purchasable( $post->ID ); |
|
151 | + $is_user_taking_course = Sensei_Utils::user_started_course($post->ID, $current_user->ID); |
|
152 | + $wc_post_id = absint(get_post_meta($post->ID, '_course_woocommerce_product', true)); |
|
153 | + if (class_exists('Sensei_WC')) { |
|
154 | + $course_purchasable = Sensei_WC::is_course_purchasable($post->ID); |
|
155 | 155 | $currency = get_woocommerce_currency_symbol(); |
156 | - $product = new WC_Product( $wc_post_id ); |
|
157 | - if ( ( ! empty( $product->price ) ) && ( ! $is_user_taking_course ) ) { |
|
158 | - echo '<span class="course-product-price price"><span>' . esc_html( $currency ) . ' </span>' . sprintf( '%0.2f', esc_html( $product->price ) ) . '</span>'; |
|
159 | - } elseif ( ( '' === $product->get_price() || 0 == $product->get_price() ) && $course_purchasable ) { |
|
160 | - echo '<span class="course-product-price price">' . wp_kses_post( 'Free!', 'lsx' ) . '</span>'; |
|
156 | + $product = new WC_Product($wc_post_id); |
|
157 | + if (( ! empty($product->price)) && ( ! $is_user_taking_course)) { |
|
158 | + echo '<span class="course-product-price price"><span>' . esc_html($currency) . ' </span>' . sprintf('%0.2f', esc_html($product->price)) . '</span>'; |
|
159 | + } elseif (('' === $product->get_price() || 0 == $product->get_price()) && $course_purchasable) { |
|
160 | + echo '<span class="course-product-price price">' . wp_kses_post('Free!', 'lsx') . '</span>'; |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @subpackage sensei |
7 | 7 | */ |
8 | 8 | |
9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
9 | +if ( ! defined('ABSPATH')) { |
|
10 | 10 | exit; // Exit if accessed directly. |
11 | 11 | } |
12 | 12 | |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | * Constructor. |
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | - add_action( 'init', array( $this, 'init' ) ); |
|
30 | - add_action( 'widgets_init', array( $this, 'lsx_widget_area_sensei_init' ), 100 ); |
|
31 | - add_filter( 'body_class', array( $this, 'lsx_widget_area_sensei_is_active' ) ); |
|
29 | + add_action('init', array($this, 'init')); |
|
30 | + add_action('widgets_init', array($this, 'lsx_widget_area_sensei_init'), 100); |
|
31 | + add_filter('body_class', array($this, 'lsx_widget_area_sensei_is_active')); |
|
32 | 32 | } // End __construct() |
33 | 33 | |
34 | 34 | /** |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * @return self |
38 | 38 | */ |
39 | 39 | public static function instance() { |
40 | - if ( ! self::$instance ) { |
|
40 | + if ( ! self::$instance) { |
|
41 | 41 | self::$instance = new self(); |
42 | 42 | } |
43 | 43 | return self::$instance; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * Run our changes. |
48 | 48 | */ |
49 | 49 | public function init() { |
50 | - add_action( 'lsx_content_top', array( $this, 'lsx_sensei_lesson_sidebar' ) ); |
|
50 | + add_action('lsx_content_top', array($this, 'lsx_sensei_lesson_sidebar')); |
|
51 | 51 | |
52 | 52 | } |
53 | 53 | |
@@ -57,15 +57,15 @@ discard block |
||
57 | 57 | * @return void |
58 | 58 | */ |
59 | 59 | public function lsx_widget_area_sensei_init() { |
60 | - if ( class_exists( 'Sensei_Course_Participants' ) || class_exists( 'Sensei_Course_Progress' ) ) { |
|
61 | - register_sidebar( array( |
|
62 | - 'name' => esc_html__( 'LSX Sensei Sidebar', 'lsx' ), |
|
60 | + if (class_exists('Sensei_Course_Participants') || class_exists('Sensei_Course_Progress')) { |
|
61 | + register_sidebar(array( |
|
62 | + 'name' => esc_html__('LSX Sensei Sidebar', 'lsx'), |
|
63 | 63 | 'id' => 'lsx-sensei-sidebar', |
64 | 64 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
65 | 65 | 'after_widget' => '</aside>', |
66 | 66 | 'before_title' => '<h3 class="widget-title">', |
67 | 67 | 'after_title' => '</h3>', |
68 | - ) ); |
|
68 | + )); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | * @param [type] $classes |
76 | 76 | * @return classes |
77 | 77 | */ |
78 | - public function lsx_widget_area_sensei_is_active( $classes ) { |
|
78 | + public function lsx_widget_area_sensei_is_active($classes) { |
|
79 | 79 | |
80 | - if ( class_exists( 'Sensei_Lesson' ) && is_active_sidebar( 'lsx-sensei-sidebar' ) ) { |
|
80 | + if (class_exists('Sensei_Lesson') && is_active_sidebar('lsx-sensei-sidebar')) { |
|
81 | 81 | $classes[] = 'lsx-sensei-sidebar-active'; |
82 | 82 | } |
83 | 83 | |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | * @return void |
91 | 91 | */ |
92 | 92 | public function lsx_sensei_lesson_sidebar() { |
93 | - if ( class_exists( 'Sensei_Lesson' ) && ( class_exists( 'Sensei_Course_Participants' ) || class_exists( 'Sensei_Course_Progress' ) ) ) { |
|
94 | - if ( ( is_single() && ( is_singular( 'lesson' ) ) ) || ( is_single() && ( is_singular( 'quiz' ) ) ) ) { |
|
95 | - if ( is_active_sidebar( 'lsx-sensei-sidebar' ) ) { |
|
93 | + if (class_exists('Sensei_Lesson') && (class_exists('Sensei_Course_Participants') || class_exists('Sensei_Course_Progress'))) { |
|
94 | + if ((is_single() && (is_singular('lesson'))) || (is_single() && (is_singular('quiz')))) { |
|
95 | + if (is_active_sidebar('lsx-sensei-sidebar')) { |
|
96 | 96 | echo '<div id="secondary" class="widget-area lsx-sensei-sidebar">'; |
97 | - dynamic_sidebar( 'lsx-sensei-sidebar' ); |
|
97 | + dynamic_sidebar('lsx-sensei-sidebar'); |
|
98 | 98 | echo '</div>'; |
99 | 99 | } |
100 | 100 | } |
@@ -7,15 +7,15 @@ discard block |
||
7 | 7 | * @category core |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
10 | +if ( ! defined('ABSPATH')) { |
|
11 | 11 | exit; |
12 | 12 | } |
13 | 13 | |
14 | -if ( ! class_exists( 'WP_Customize_Control' ) ) { |
|
14 | +if ( ! class_exists('WP_Customize_Control')) { |
|
15 | 15 | return; |
16 | 16 | } |
17 | 17 | |
18 | -if ( ! class_exists( 'LSX_Customize_Core_Control' ) ) : |
|
18 | +if ( ! class_exists('LSX_Customize_Core_Control')) : |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * LSX_Customize_Core_Control Class |
@@ -35,16 +35,16 @@ discard block |
||
35 | 35 | ?> |
36 | 36 | <label> |
37 | 37 | <?php |
38 | - if ( ! empty( $this->label ) ) { |
|
38 | + if ( ! empty($this->label)) { |
|
39 | 39 | ?> |
40 | - <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
|
40 | + <span class="customize-control-title"><?php echo esc_html($this->label); ?></span> |
|
41 | 41 | <?php |
42 | 42 | } |
43 | - if ( ! empty( $this->description ) ) { |
|
43 | + if ( ! empty($this->description)) { |
|
44 | 44 | ?> |
45 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> |
|
45 | + <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> |
|
46 | 46 | <?php } ?> |
47 | - <input <?php $this->link(); ?> type="checkbox" value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->input_attrs(); ?>> |
|
47 | + <input <?php $this->link(); ?> type="checkbox" value="<?php echo esc_attr($this->value()); ?>" <?php $this->input_attrs(); ?>> |
|
48 | 48 | </label> |
49 | 49 | <?php |
50 | 50 | } |
@@ -6,11 +6,11 @@ discard block |
||
6 | 6 | * @subpackage customizer |
7 | 7 | */ |
8 | 8 | |
9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
9 | +if ( ! defined('ABSPATH')) { |
|
10 | 10 | exit; |
11 | 11 | } |
12 | 12 | |
13 | -if ( ! class_exists( 'LSX_Theme_Customizer' ) ) : |
|
13 | +if ( ! class_exists('LSX_Theme_Customizer')) : |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * Customizer Configuration File |
@@ -26,22 +26,22 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * Initialize the plugin by setting localization and loading public scripts and styles. |
28 | 28 | */ |
29 | - public function __construct( $controls ) { |
|
29 | + public function __construct($controls) { |
|
30 | 30 | require get_template_directory() . '/includes/classes/class-lsx-customize-core-control.php'; |
31 | 31 | require get_template_directory() . '/includes/classes/class-lsx-customize-layout-control.php'; |
32 | 32 | require get_template_directory() . '/includes/classes/class-lsx-customize-header-layout-control.php'; |
33 | 33 | |
34 | 34 | $this->controls = $controls; |
35 | 35 | |
36 | - add_action( 'customize_preview_init', array( $this, 'customize_preview_js' ), 20 ); |
|
37 | - add_action( 'customize_register', array( $this, 'customizer' ), 11 ); |
|
36 | + add_action('customize_preview_init', array($this, 'customize_preview_js'), 20); |
|
37 | + add_action('customize_register', array($this, 'customizer'), 11); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. |
42 | 42 | */ |
43 | 43 | public function customize_preview_js() { |
44 | - wp_enqueue_script( 'lsx_customizer', get_template_directory_uri() . '/assets/js/admin/customizer.js', array( 'customize-preview' ), LSX_VERSION, true ); |
|
44 | + wp_enqueue_script('lsx_customizer', get_template_directory_uri() . '/assets/js/admin/customizer.js', array('customize-preview'), LSX_VERSION, true); |
|
45 | 45 | |
46 | 46 | wp_localize_script( |
47 | 47 | 'lsx_customizer', |
@@ -55,52 +55,52 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * Create customiser controls. |
57 | 57 | */ |
58 | - public function customizer( $wp_customize ) { |
|
58 | + public function customizer($wp_customize) { |
|
59 | 59 | // Start panels. |
60 | - if ( ! empty( $this->controls['panels'] ) ) { |
|
61 | - foreach ( $this->controls['panels'] as $panel_slug => $args ) { |
|
62 | - $this->add_panel( $panel_slug, $args, $wp_customize ); |
|
60 | + if ( ! empty($this->controls['panels'])) { |
|
61 | + foreach ($this->controls['panels'] as $panel_slug => $args) { |
|
62 | + $this->add_panel($panel_slug, $args, $wp_customize); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | 66 | // Start sections. |
67 | - if ( ! empty( $this->controls['sections'] ) ) { |
|
68 | - foreach ( $this->controls['sections'] as $section_slug => $args ) { |
|
69 | - $this->add_section( $section_slug, $args, $wp_customize ); |
|
67 | + if ( ! empty($this->controls['sections'])) { |
|
68 | + foreach ($this->controls['sections'] as $section_slug => $args) { |
|
69 | + $this->add_section($section_slug, $args, $wp_customize); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | 73 | // Start settings. |
74 | - if ( ! empty( $this->controls['settings'] ) ) { |
|
75 | - foreach ( $this->controls['settings'] as $settings_slug => $args ) { |
|
76 | - $this->add_setting( $settings_slug, $args, $wp_customize ); |
|
74 | + if ( ! empty($this->controls['settings'])) { |
|
75 | + foreach ($this->controls['settings'] as $settings_slug => $args) { |
|
76 | + $this->add_setting($settings_slug, $args, $wp_customize); |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | 80 | // Start fields. |
81 | - if ( ! empty( $this->controls['fields'] ) ) { |
|
82 | - foreach ( $this->controls['fields'] as $field_slug => $args ) { |
|
83 | - $this->add_control( $field_slug, $args, $wp_customize ); |
|
81 | + if ( ! empty($this->controls['fields'])) { |
|
82 | + foreach ($this->controls['fields'] as $field_slug => $args) { |
|
83 | + $this->add_control($field_slug, $args, $wp_customize); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | 87 | // Start selective refresh. |
88 | - if ( ! empty( $this->controls['selective_refresh'] ) ) { |
|
89 | - foreach ( $this->controls['selective_refresh'] as $field_slug => $args ) { |
|
90 | - $this->add_selective_refresh( $field_slug, $args, $wp_customize ); |
|
88 | + if ( ! empty($this->controls['selective_refresh'])) { |
|
89 | + foreach ($this->controls['selective_refresh'] as $field_slug => $args) { |
|
90 | + $this->add_selective_refresh($field_slug, $args, $wp_customize); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; |
|
95 | - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; |
|
96 | - $wp_customize->get_setting( 'background_color' )->transport = 'postMessage'; |
|
94 | + $wp_customize->get_setting('blogname')->transport = 'postMessage'; |
|
95 | + $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; |
|
96 | + $wp_customize->get_setting('background_color')->transport = 'postMessage'; |
|
97 | 97 | |
98 | 98 | $wp_customize->selective_refresh->add_partial( |
99 | 99 | 'blogname', |
100 | 100 | array( |
101 | 101 | 'selector' => 'h1.site-title a', |
102 | 102 | 'render_callback' => function() { |
103 | - bloginfo( 'name' ); |
|
103 | + bloginfo('name'); |
|
104 | 104 | }, |
105 | 105 | ) |
106 | 106 | ); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | array( |
111 | 111 | 'selector' => '.site-description', |
112 | 112 | 'render_callback' => function() { |
113 | - bloginfo( 'description' ); |
|
113 | + bloginfo('description'); |
|
114 | 114 | }, |
115 | 115 | ) |
116 | 116 | ); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | /** |
120 | 120 | * Create a panel. |
121 | 121 | */ |
122 | - private function add_panel( $slug, $args, $wp_customize ) { |
|
122 | + private function add_panel($slug, $args, $wp_customize) { |
|
123 | 123 | $default_args = array( |
124 | 124 | 'title' => null, |
125 | 125 | 'description' => null, |
@@ -127,26 +127,26 @@ discard block |
||
127 | 127 | |
128 | 128 | $wp_customize->add_panel( |
129 | 129 | $slug, |
130 | - array_merge( $default_args, $args ) |
|
130 | + array_merge($default_args, $args) |
|
131 | 131 | ); |
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
135 | 135 | * Create a section. |
136 | 136 | */ |
137 | - private function add_section( $slug, $args, $wp_customize ) { |
|
137 | + private function add_section($slug, $args, $wp_customize) { |
|
138 | 138 | $default_args = array( |
139 | 139 | 'capability' => 'edit_theme_options', |
140 | 140 | 'description' => null, |
141 | 141 | ); |
142 | 142 | |
143 | - $wp_customize->add_section( $slug, array_merge( $default_args, $args ) ); |
|
143 | + $wp_customize->add_section($slug, array_merge($default_args, $args)); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
147 | 147 | * Create a setting. |
148 | 148 | */ |
149 | - private function add_setting( $slug, $args, $wp_customize ) { |
|
149 | + private function add_setting($slug, $args, $wp_customize) { |
|
150 | 150 | $wp_customize->add_setting( |
151 | 151 | $slug, |
152 | 152 | array_merge( |
@@ -165,23 +165,23 @@ discard block |
||
165 | 165 | /** |
166 | 166 | * Create a control. |
167 | 167 | */ |
168 | - private function add_control( $slug, $args, $wp_customize ) { |
|
168 | + private function add_control($slug, $args, $wp_customize) { |
|
169 | 169 | $default_args = array(); |
170 | 170 | |
171 | - if ( isset( $args['control'] ) && class_exists( $args['control'] ) ) { |
|
171 | + if (isset($args['control']) && class_exists($args['control'])) { |
|
172 | 172 | $control_class = $args['control']; |
173 | - unset( $args['control'] ); |
|
173 | + unset($args['control']); |
|
174 | 174 | |
175 | - $control = new $control_class( $wp_customize, $slug, array_merge( $default_args, $args ) ); |
|
176 | - $wp_customize->add_control( $control ); |
|
175 | + $control = new $control_class($wp_customize, $slug, array_merge($default_args, $args)); |
|
176 | + $wp_customize->add_control($control); |
|
177 | 177 | } else { |
178 | - if ( isset( $args['control'] ) ) { |
|
179 | - unset( $args['control'] ); |
|
178 | + if (isset($args['control'])) { |
|
179 | + unset($args['control']); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | $wp_customize->add_control( |
183 | 183 | $slug, |
184 | - array_merge( $default_args, $args ) |
|
184 | + array_merge($default_args, $args) |
|
185 | 185 | ); |
186 | 186 | } |
187 | 187 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | /** |
190 | 190 | * Create a selective refresh. |
191 | 191 | */ |
192 | - private function add_selective_refresh( $slug, $args, $wp_customize ) { |
|
192 | + private function add_selective_refresh($slug, $args, $wp_customize) { |
|
193 | 193 | $default_args = array( |
194 | 194 | 'selector' => null, |
195 | 195 | 'render_callback' => null, |
@@ -197,23 +197,23 @@ discard block |
||
197 | 197 | |
198 | 198 | $wp_customize->selective_refresh->add_partial( |
199 | 199 | $slug, |
200 | - array_merge( $default_args, $args ) |
|
200 | + array_merge($default_args, $args) |
|
201 | 201 | ); |
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
205 | 205 | * Returns a registered field. |
206 | 206 | */ |
207 | - public function get_control( $id ) { |
|
208 | - $field = $this->controls['fields'][ $id ]; |
|
207 | + public function get_control($id) { |
|
208 | + $field = $this->controls['fields'][$id]; |
|
209 | 209 | return $field; |
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
213 | 213 | * Returns a registered setting. |
214 | 214 | */ |
215 | - public function get_setting( $id ) { |
|
216 | - $setting = $this->controls['settings'][ $id ]; |
|
215 | + public function get_setting($id) { |
|
216 | + $setting = $this->controls['settings'][$id]; |
|
217 | 217 | return $setting; |
218 | 218 | } |
219 | 219 |
@@ -7,15 +7,15 @@ discard block |
||
7 | 7 | * @category bootstrap-navigation-walker |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
10 | +if ( ! defined('ABSPATH')) { |
|
11 | 11 | exit; |
12 | 12 | } |
13 | 13 | |
14 | -if ( ! class_exists( 'Walker_Nav_Menu' ) ) { |
|
14 | +if ( ! class_exists('Walker_Nav_Menu')) { |
|
15 | 15 | return; |
16 | 16 | } |
17 | 17 | |
18 | -if ( ! class_exists( 'LSX_Bootstrap_Navwalker' ) ) : |
|
18 | +if ( ! class_exists('LSX_Bootstrap_Navwalker')) : |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Cleaner Bootstrap walker |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | * @param string $output Passed by reference. Used to append additional content. |
36 | 36 | * @param int $depth Depth of page. Used for padding. |
37 | 37 | */ |
38 | - public function start_lvl( &$output, $depth = 0, $args = array() ) { |
|
39 | - $indent = str_repeat( "\t", $depth ); |
|
38 | + public function start_lvl(&$output, $depth = 0, $args = array()) { |
|
39 | + $indent = str_repeat("\t", $depth); |
|
40 | 40 | $output .= "\n$indent<ul role=\"menu\" class=\" dropdown-menu\">\n"; |
41 | 41 | } |
42 | 42 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * Used to append additional content. |
45 | 45 | * @param string $item Passed by reference. |
46 | 46 | */ |
47 | - public function filter_default_pages( &$item ) { |
|
47 | + public function filter_default_pages(&$item) { |
|
48 | 48 | return $item; |
49 | 49 | } |
50 | 50 | |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | * @param int $current_page Menu item ID. |
59 | 59 | * @param object $args |
60 | 60 | */ |
61 | - public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { |
|
62 | - $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; |
|
61 | + public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { |
|
62 | + $indent = ($depth) ? str_repeat("\t", $depth) : ''; |
|
63 | 63 | |
64 | 64 | /** |
65 | 65 | * If this is a default menu being called we need to fix |
66 | 66 | * the item object thats coming through. |
67 | 67 | */ |
68 | - if ( ! isset( $item->title ) ) { |
|
68 | + if ( ! isset($item->title)) { |
|
69 | 69 | return; |
70 | 70 | } |
71 | 71 | |
@@ -77,63 +77,63 @@ discard block |
||
77 | 77 | * comparison that is not case sensitive. The strcasecmp() function returns |
78 | 78 | * a 0 if the strings are equal. |
79 | 79 | */ |
80 | - if ( 0 == strcasecmp( $item->attr_title, 'divider' ) && 1 === $depth ) { |
|
80 | + if (0 == strcasecmp($item->attr_title, 'divider') && 1 === $depth) { |
|
81 | 81 | $output .= $indent . '<li role="presentation" class="divider">'; |
82 | - } elseif ( 0 == strcasecmp( $item->title, 'divider' ) && 1 === $depth ) { |
|
82 | + } elseif (0 == strcasecmp($item->title, 'divider') && 1 === $depth) { |
|
83 | 83 | $output .= $indent . '<li role="presentation" class="divider">'; |
84 | - } elseif ( 0 == strcasecmp( $item->attr_title, 'dropdown-header' ) && 1 === $depth ) { |
|
85 | - $output .= $indent . '<li role="presentation" class="dropdown-header">' . esc_attr( $item->title ); |
|
86 | - } elseif ( 0 == strcasecmp( $item->attr_title, 'disabled' ) ) { |
|
87 | - $output .= $indent . '<li role="presentation" class="disabled"><a href="#">' . esc_attr( $item->title ) . '</a>'; |
|
84 | + } elseif (0 == strcasecmp($item->attr_title, 'dropdown-header') && 1 === $depth) { |
|
85 | + $output .= $indent . '<li role="presentation" class="dropdown-header">' . esc_attr($item->title); |
|
86 | + } elseif (0 == strcasecmp($item->attr_title, 'disabled')) { |
|
87 | + $output .= $indent . '<li role="presentation" class="disabled"><a href="#">' . esc_attr($item->title) . '</a>'; |
|
88 | 88 | } else { |
89 | 89 | $class_names = ''; |
90 | 90 | $value = ''; |
91 | 91 | |
92 | - $classes = empty( $item->classes ) ? array() : (array) $item->classes; |
|
92 | + $classes = empty($item->classes) ? array() : (array) $item->classes; |
|
93 | 93 | $classes[] = 'menu-item-' . $item->ID; |
94 | 94 | |
95 | - $classes = apply_filters( 'lsx_nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ); |
|
95 | + $classes = apply_filters('lsx_nav_menu_css_class', array_filter($classes), $item, $args, $depth); |
|
96 | 96 | |
97 | - $class_names = join( ' ', $classes ); |
|
97 | + $class_names = join(' ', $classes); |
|
98 | 98 | |
99 | - if ( $args->has_children ) |
|
99 | + if ($args->has_children) |
|
100 | 100 | $class_names .= ' dropdown'; |
101 | 101 | |
102 | - if ( in_array( 'current-menu-item', $classes ) ) |
|
102 | + if (in_array('current-menu-item', $classes)) |
|
103 | 103 | $class_names .= ' active'; |
104 | 104 | |
105 | - if ( in_array( 'current-menu-parent', $classes ) ) |
|
105 | + if (in_array('current-menu-parent', $classes)) |
|
106 | 106 | $class_names .= ' active'; |
107 | 107 | |
108 | 108 | //Check if this is ment to be a "social" type menu |
109 | - $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; |
|
109 | + $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : ''; |
|
110 | 110 | |
111 | - $id = apply_filters( 'nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args ); |
|
112 | - $id = $id ? ' id="' . esc_attr( $id ) . '"' : ''; |
|
111 | + $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args); |
|
112 | + $id = $id ? ' id="' . esc_attr($id) . '"' : ''; |
|
113 | 113 | |
114 | 114 | $output .= $indent . '<li' . $id . $value . $class_names . '>'; |
115 | 115 | |
116 | 116 | $atts = array(); |
117 | - $atts['title'] = ! empty( $item->attr_title ) ? $item->attr_title : $item->title; |
|
118 | - $atts['target'] = ! empty( $item->target ) ? $item->target : ''; |
|
119 | - $atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : ''; |
|
117 | + $atts['title'] = ! empty($item->attr_title) ? $item->attr_title : $item->title; |
|
118 | + $atts['target'] = ! empty($item->target) ? $item->target : ''; |
|
119 | + $atts['rel'] = ! empty($item->xfn) ? $item->xfn : ''; |
|
120 | 120 | |
121 | 121 | // If item has_children add atts to a. |
122 | - if ( $args->has_children ) { |
|
123 | - $atts['href'] = ! empty( $item->url ) ? $item->url : ''; |
|
122 | + if ($args->has_children) { |
|
123 | + $atts['href'] = ! empty($item->url) ? $item->url : ''; |
|
124 | 124 | $atts['data-toggle'] = 'dropdown'; |
125 | 125 | $atts['class'] = 'dropdown-toggle'; |
126 | 126 | $atts['aria-haspopup'] = 'true'; |
127 | 127 | } else { |
128 | - $atts['href'] = ! empty( $item->url ) ? $item->url : ''; |
|
128 | + $atts['href'] = ! empty($item->url) ? $item->url : ''; |
|
129 | 129 | } |
130 | 130 | |
131 | - $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args ); |
|
131 | + $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args); |
|
132 | 132 | |
133 | 133 | $attributes = ''; |
134 | - foreach ( $atts as $attr => $value ) { |
|
135 | - if ( ! empty( $value ) ) { |
|
136 | - $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value ); |
|
134 | + foreach ($atts as $attr => $value) { |
|
135 | + if ( ! empty($value)) { |
|
136 | + $value = ('href' === $attr) ? esc_url($value) : esc_attr($value); |
|
137 | 137 | $attributes .= ' ' . $attr . '="' . $value . '"'; |
138 | 138 | } |
139 | 139 | } |
@@ -141,11 +141,11 @@ discard block |
||
141 | 141 | $item_output = $args->before; |
142 | 142 | |
143 | 143 | $item_output .= '<a' . $attributes . '>'; |
144 | - $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; |
|
145 | - $item_output .= ( $args->has_children && 0 === $depth ) ? ' <span class="caret"></span></a>' : '</a>'; |
|
144 | + $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after; |
|
145 | + $item_output .= ($args->has_children && 0 === $depth) ? ' <span class="caret"></span></a>' : '</a>'; |
|
146 | 146 | $item_output .= $args->after; |
147 | 147 | |
148 | - $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); |
|
148 | + $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); |
|
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
@@ -169,18 +169,18 @@ discard block |
||
169 | 169 | * @param string $output Passed by reference. Used to append additional content. |
170 | 170 | * @return null Null on failure with no changes to parameters. |
171 | 171 | */ |
172 | - public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) { |
|
173 | - if ( ! $element ) { |
|
172 | + public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output) { |
|
173 | + if ( ! $element) { |
|
174 | 174 | return; |
175 | 175 | } |
176 | 176 | |
177 | 177 | $id_field = $this->db_fields['id']; |
178 | 178 | |
179 | - if ( is_object( $args[0] ) ) { |
|
180 | - $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] ); |
|
179 | + if (is_object($args[0])) { |
|
180 | + $args[0]->has_children = ! empty($children_elements[$element->$id_field]); |
|
181 | 181 | } |
182 | 182 | |
183 | - parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); |
|
183 | + parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
@@ -194,18 +194,18 @@ discard block |
||
194 | 194 | * @param array $args passed from the wp_nav_menu function. |
195 | 195 | * |
196 | 196 | */ |
197 | - public static function fallback( $args ) { |
|
198 | - if ( current_user_can( 'manage_options' ) ) { |
|
197 | + public static function fallback($args) { |
|
198 | + if (current_user_can('manage_options')) { |
|
199 | 199 | $fb_output = null; |
200 | 200 | |
201 | - if ( $args['container'] ) { |
|
201 | + if ($args['container']) { |
|
202 | 202 | $fb_output = '<' . $args['container']; |
203 | 203 | |
204 | - if ( $args['container_id'] ) { |
|
204 | + if ($args['container_id']) { |
|
205 | 205 | $fb_output .= ' id="' . $args['container_id'] . '"'; |
206 | 206 | } |
207 | 207 | |
208 | - if ( $args['container_class'] ) { |
|
208 | + if ($args['container_class']) { |
|
209 | 209 | $fb_output .= ' class="' . $args['container_class'] . '"'; |
210 | 210 | } |
211 | 211 | |
@@ -214,23 +214,23 @@ discard block |
||
214 | 214 | |
215 | 215 | $fb_output .= '<ul'; |
216 | 216 | |
217 | - if ( $args['menu_id'] ) { |
|
217 | + if ($args['menu_id']) { |
|
218 | 218 | $fb_output .= ' id="' . $args['menu_id'] . '"'; |
219 | 219 | } |
220 | 220 | |
221 | - if ( $args['menu_class'] ) { |
|
221 | + if ($args['menu_class']) { |
|
222 | 222 | $fb_output .= ' class="' . $args['menu_class'] . '"'; |
223 | 223 | } |
224 | 224 | |
225 | 225 | $fb_output .= '>'; |
226 | - $fb_output .= '<li><a href="' . esc_url( admin_url( 'nav-menus.php' ) ) . '">' . esc_html__( 'Add a menu', 'lsx' ) . '</a></li>'; |
|
226 | + $fb_output .= '<li><a href="' . esc_url(admin_url('nav-menus.php')) . '">' . esc_html__('Add a menu', 'lsx') . '</a></li>'; |
|
227 | 227 | $fb_output .= '</ul>'; |
228 | 228 | |
229 | - if ( $args['container'] ) { |
|
229 | + if ($args['container']) { |
|
230 | 230 | $fb_output .= '</' . $args['container'] . '>'; |
231 | 231 | } |
232 | 232 | |
233 | - echo wp_kses_post( $fb_output ); |
|
233 | + echo wp_kses_post($fb_output); |
|
234 | 234 | } |
235 | 235 | } |
236 | 236 |
@@ -7,15 +7,15 @@ discard block |
||
7 | 7 | * @category header-layout |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
10 | +if ( ! defined('ABSPATH')) { |
|
11 | 11 | exit; |
12 | 12 | } |
13 | 13 | |
14 | -if ( ! class_exists( 'WP_Customize_Control' ) ) { |
|
14 | +if ( ! class_exists('WP_Customize_Control')) { |
|
15 | 15 | return; |
16 | 16 | } |
17 | 17 | |
18 | -if ( ! class_exists( 'LSX_Customize_Header_Layout_Control' ) ) : |
|
18 | +if ( ! class_exists('LSX_Customize_Header_Layout_Control')) : |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * LSX_Customize_Header_Layout_Control Class |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | public $statuses; |
31 | 31 | public $layouts = array(); |
32 | 32 | |
33 | - public function __construct( $manager, $id, $args = array() ) { |
|
34 | - parent::__construct( $manager, $id, $args ); |
|
33 | + public function __construct($manager, $id, $args = array()) { |
|
34 | + parent::__construct($manager, $id, $args); |
|
35 | 35 | |
36 | - if ( ! empty( $args['choices'] ) ) { |
|
36 | + if ( ! empty($args['choices'])) { |
|
37 | 37 | $this->layouts = $args['choices']; |
38 | 38 | } |
39 | 39 | } |
@@ -42,39 +42,39 @@ discard block |
||
42 | 42 | * Enqueue scripts/styles for the color picker. |
43 | 43 | */ |
44 | 44 | public function enqueue() { |
45 | - wp_enqueue_script( 'lsx-header-layout-control', get_template_directory_uri() . '/assets/js/admin/customizer-header-layout.js', array( 'jquery' ), LSX_VERSION, true ); |
|
45 | + wp_enqueue_script('lsx-header-layout-control', get_template_directory_uri() . '/assets/js/admin/customizer-header-layout.js', array('jquery'), LSX_VERSION, true); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Render output. |
50 | 50 | */ |
51 | 51 | public function render_content() { |
52 | - $post_id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); |
|
52 | + $post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id)); |
|
53 | 53 | $class = 'customize-control customize-control-' . $this->type; |
54 | 54 | $value = $this->value(); |
55 | 55 | ?> |
56 | 56 | <label> |
57 | 57 | <?php |
58 | - if ( ! empty( $this->label ) ) { |
|
58 | + if ( ! empty($this->label)) { |
|
59 | 59 | ?> |
60 | - <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
|
60 | + <span class="customize-control-title"><?php echo esc_html($this->label); ?></span> |
|
61 | 61 | <?php |
62 | 62 | } |
63 | - if ( ! empty( $this->description ) ) { |
|
63 | + if ( ! empty($this->description)) { |
|
64 | 64 | ?> |
65 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> |
|
65 | + <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> |
|
66 | 66 | <?php } ?> |
67 | 67 | <div class="header-layouts-selector"> |
68 | 68 | <?php |
69 | - foreach ( $this->layouts as $layout ) { |
|
69 | + foreach ($this->layouts as $layout) { |
|
70 | 70 | $sel = 'border: 1px solid transparent;'; |
71 | - if ( $value === $layout ) { |
|
71 | + if ($value === $layout) { |
|
72 | 72 | $sel = 'border: 1px solid rgb(43, 166, 203);'; |
73 | 73 | } |
74 | - echo '<img class="header-layout-button" style="padding:2px;' . esc_attr( $sel ) . '" src="' . esc_attr( get_template_directory_uri() ) . '/assets/images/admin/header-' . esc_attr( $layout ) . '.png" data-option="' . esc_attr( $layout ) . '">'; |
|
74 | + echo '<img class="header-layout-button" style="padding:2px;' . esc_attr($sel) . '" src="' . esc_attr(get_template_directory_uri()) . '/assets/images/admin/header-' . esc_attr($layout) . '.png" data-option="' . esc_attr($layout) . '">'; |
|
75 | 75 | } |
76 | 76 | ?> |
77 | - <input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr( $class ); ?>" id="<?php echo esc_attr( $post_id ); ?>" type="hidden" value="<?php echo esc_attr( $value ); ?>" <?php $this->input_attrs(); ?>> |
|
77 | + <input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr($class); ?>" id="<?php echo esc_attr($post_id); ?>" type="hidden" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> |
|
78 | 78 | </div> |
79 | 79 | </label> |
80 | 80 | <?php |