@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | /** |
4 | 4 | * Google Font_Collection Class |
5 | 5 | **/ |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | **/ |
16 | 16 | public function __construct($fonts) |
17 | 17 | { |
18 | - if(empty($fonts)) |
|
18 | + if (empty($fonts)) |
|
19 | 19 | { |
20 | 20 | //we didn't get the required data |
21 | 21 | return false; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | // create fonts |
25 | 25 | foreach ($fonts as $key => $value) |
26 | 26 | { |
27 | - if( empty( $value["system"] ) ){ |
|
27 | + if (empty($value["system"])) { |
|
28 | 28 | $this->fonts[$value["title"]] = new LSX_Google_Font($value["title"], $value["location"], $value["cssDeclaration"], $value["cssClass"]); |
29 | 29 | } |
30 | 30 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | foreach ($this->fonts as $key => $value) |
107 | 107 | { |
108 | 108 | $protocol = 'http'; |
109 | - if(is_ssl()){ $protocol.='s'; } |
|
109 | + if (is_ssl()) { $protocol .= 's'; } |
|
110 | 110 | ?> |
111 | 111 | <link href="<?php echo $protocol; ?>://fonts.googleapis.com/css?family=<?php echo $value->__get("location"); ?>" rel='stylesheet' type='text/css'> |
112 | 112 | <?php |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Add and remove body_class() classes |
@@ -8,21 +8,21 @@ discard block |
||
8 | 8 | /* |
9 | 9 | * Add the header layout class |
10 | 10 | */ |
11 | - $header_layout = get_theme_mod('lsx_header_layout','inline'); |
|
12 | - $classes[] = 'header-'.$header_layout; |
|
11 | + $header_layout = get_theme_mod('lsx_header_layout', 'inline'); |
|
12 | + $classes[] = 'header-' . $header_layout; |
|
13 | 13 | |
14 | 14 | |
15 | 15 | // Add post/page slug |
16 | - if (is_single() || is_page() && !is_front_page()) { |
|
16 | + if (is_single() || is_page() && ! is_front_page()) { |
|
17 | 17 | $classes[] = basename(get_permalink()); |
18 | 18 | } |
19 | 19 | |
20 | - if(!class_exists('Lsx_Banners')){ |
|
21 | - $post_types = array('page','post'); |
|
22 | - $post_types = apply_filters('lsx_allowed_post_type_banners',$post_types); |
|
20 | + if ( ! class_exists('Lsx_Banners')) { |
|
21 | + $post_types = array('page', 'post'); |
|
22 | + $post_types = apply_filters('lsx_allowed_post_type_banners', $post_types); |
|
23 | 23 | |
24 | - if((is_singular($post_types) && has_post_thumbnail()) |
|
25 | - || (is_singular('jetpack-portfolio'))){ |
|
24 | + if ((is_singular($post_types) && has_post_thumbnail()) |
|
25 | + || (is_singular('jetpack-portfolio'))) { |
|
26 | 26 | $classes[] = 'page-has-banner'; |
27 | 27 | } |
28 | 28 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $classes[] = 'has-top-menu'; |
32 | 32 | } |
33 | 33 | |
34 | - if ( get_theme_mod( 'lsx_preloader_content_status', '1' ) === '1' ) { |
|
34 | + if (get_theme_mod('lsx_preloader_content_status', '1') === '1') { |
|
35 | 35 | $classes[] = 'preloader-content-enable'; |
36 | 36 | } |
37 | 37 | |
@@ -55,30 +55,30 @@ discard block |
||
55 | 55 | * @param string $sep Optional separator. |
56 | 56 | * @return string The filtered title. |
57 | 57 | */ |
58 | -function lsx_wp_title( $title, $sep ) { |
|
58 | +function lsx_wp_title($title, $sep) { |
|
59 | 59 | global $page, $paged; |
60 | 60 | |
61 | - if ( is_feed() ) { |
|
61 | + if (is_feed()) { |
|
62 | 62 | return $title; |
63 | 63 | } |
64 | 64 | |
65 | 65 | // Add the blog name |
66 | - $title .= get_bloginfo( 'name' ); |
|
66 | + $title .= get_bloginfo('name'); |
|
67 | 67 | |
68 | 68 | // Add the blog description for the home/front page. |
69 | - $site_description = get_bloginfo( 'description', 'display' ); |
|
70 | - if ( $site_description && ( is_home() || is_front_page() ) ) { |
|
69 | + $site_description = get_bloginfo('description', 'display'); |
|
70 | + if ($site_description && (is_home() || is_front_page())) { |
|
71 | 71 | $title .= " $sep $site_description"; |
72 | 72 | } |
73 | 73 | |
74 | 74 | // Add a page number if necessary: |
75 | - if ( $paged >= 2 || $page >= 2 ) { |
|
76 | - $title .= " $sep " . sprintf( __( 'Page %s', 'lsx' ), max( $paged, $page ) ); |
|
75 | + if ($paged >= 2 || $page >= 2) { |
|
76 | + $title .= " $sep " . sprintf(__('Page %s', 'lsx'), max($paged, $page)); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | return $title; |
80 | 80 | } |
81 | -add_filter( 'wp_title', 'lsx_wp_title', 10, 2 ); |
|
81 | +add_filter('wp_title', 'lsx_wp_title', 10, 2); |
|
82 | 82 | |
83 | 83 | |
84 | 84 | /** |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | function lsx_remove_self_closing_tags($input) { |
100 | 100 | return str_replace(' />', '>', $input); |
101 | 101 | } |
102 | -add_filter('get_avatar', 'lsx_remove_self_closing_tags'); // <img /> |
|
103 | -add_filter('comment_id_fields', 'lsx_remove_self_closing_tags'); // <input /> |
|
102 | +add_filter('get_avatar', 'lsx_remove_self_closing_tags'); // <img /> |
|
103 | +add_filter('comment_id_fields', 'lsx_remove_self_closing_tags'); // <input /> |
|
104 | 104 | add_filter('post_thumbnail_html', 'lsx_remove_self_closing_tags'); // <img /> |
105 | 105 | |
106 | 106 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | add_filter('style_loader_tag', 'lsx_clean_style_tag'); |
117 | 117 | |
118 | 118 | |
119 | -if (!function_exists('lsx_get_attachment_id')) { |
|
119 | +if ( ! function_exists('lsx_get_attachment_id')) { |
|
120 | 120 | /** |
121 | 121 | * Get the Attachment ID for a given image URL. |
122 | 122 | * |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | function lsx_get_attachment_id($url) { |
128 | 128 | $dir = wp_upload_dir(); |
129 | 129 | // baseurl never has a trailing slash |
130 | - if (false === strpos($url, $dir['baseurl'].'/')) { |
|
130 | + if (false === strpos($url, $dir['baseurl'] . '/')) { |
|
131 | 131 | // URL points to a place outside of upload directory |
132 | 132 | return false; |
133 | 133 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $query['meta_query'][0]['key'] = '_wp_attached_file'; |
146 | 146 | // query attachments |
147 | 147 | $ids = get_posts($query); |
148 | - if (!empty($ids)) { |
|
148 | + if ( ! empty($ids)) { |
|
149 | 149 | foreach ($ids as $id) { |
150 | 150 | // first entry of returned array is the URL |
151 | 151 | $temp_url = wp_get_attachment_image_src($id, 'full'); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | function lsx_is_element_empty($element) { |
190 | 190 | $element = trim($element); |
191 | - return empty($element)?false:true; |
|
191 | + return empty($element) ? false : true; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | |
@@ -199,39 +199,39 @@ discard block |
||
199 | 199 | * @subpackage extras |
200 | 200 | * @category thumbnails |
201 | 201 | */ |
202 | -function lsx_get_thumbnail($size,$image_src = false){ |
|
202 | +function lsx_get_thumbnail($size, $image_src = false) { |
|
203 | 203 | |
204 | - if(false === $image_src){ |
|
204 | + if (false === $image_src) { |
|
205 | 205 | $post_id = get_the_ID(); |
206 | - $post_thumbnail_id = get_post_thumbnail_id( $post_id ); |
|
207 | - }elseif(false != $image_src ){ |
|
208 | - if(is_numeric($image_src)){ |
|
206 | + $post_thumbnail_id = get_post_thumbnail_id($post_id); |
|
207 | + }elseif (false != $image_src) { |
|
208 | + if (is_numeric($image_src)) { |
|
209 | 209 | $post_thumbnail_id = $image_src; |
210 | - }else{ |
|
210 | + } else { |
|
211 | 211 | $post_thumbnail_id = lsx_get_attachment_id_from_src($image_src); |
212 | 212 | } |
213 | 213 | } |
214 | - $size = apply_filters('lsx_thumbnail_size',$size); |
|
214 | + $size = apply_filters('lsx_thumbnail_size', $size); |
|
215 | 215 | $img = false; |
216 | - if($size === 'lsx-thumbnail-wide' || $size === 'thumbnail'){ |
|
216 | + if ($size === 'lsx-thumbnail-wide' || $size === 'thumbnail') { |
|
217 | 217 | $srcset = false; |
218 | - $img = wp_get_attachment_image_src($post_thumbnail_id,$size); |
|
218 | + $img = wp_get_attachment_image_src($post_thumbnail_id, $size); |
|
219 | 219 | $img = $img[0]; |
220 | - }else{ |
|
220 | + } else { |
|
221 | 221 | $srcset = true; |
222 | - $img = wp_get_attachment_image_srcset($post_thumbnail_id,$size); |
|
223 | - if($img == false) { |
|
222 | + $img = wp_get_attachment_image_srcset($post_thumbnail_id, $size); |
|
223 | + if ($img == false) { |
|
224 | 224 | $srcset = false; |
225 | - $img = wp_get_attachment_image_src($post_thumbnail_id,$size); |
|
225 | + $img = wp_get_attachment_image_src($post_thumbnail_id, $size); |
|
226 | 226 | $img = $img[0]; |
227 | 227 | } |
228 | 228 | } |
229 | 229 | if ($srcset) { |
230 | - $img = '<img alt="'.get_the_title(get_the_ID()).'" class="attachment-responsive wp-post-image lsx-responsive" srcset="'.$img.'" />'; |
|
230 | + $img = '<img alt="' . get_the_title(get_the_ID()) . '" class="attachment-responsive wp-post-image lsx-responsive" srcset="' . $img . '" />'; |
|
231 | 231 | } else { |
232 | - $img = '<img alt="'.get_the_title(get_the_ID()).'" class="attachment-responsive wp-post-image lsx-responsive" src="'.$img.'" />'; |
|
232 | + $img = '<img alt="' . get_the_title(get_the_ID()) . '" class="attachment-responsive wp-post-image lsx-responsive" src="' . $img . '" />'; |
|
233 | 233 | } |
234 | - $img = apply_filters('lsx_lazyload_filter_images',$img); |
|
234 | + $img = apply_filters('lsx_lazyload_filter_images', $img); |
|
235 | 235 | return $img; |
236 | 236 | } |
237 | 237 | |
@@ -242,8 +242,8 @@ discard block |
||
242 | 242 | * @subpackage extras |
243 | 243 | * @category thumbnails |
244 | 244 | */ |
245 | -function lsx_thumbnail($size = 'thumbnail',$image_src = false){ |
|
246 | - echo lsx_get_thumbnail($size,$image_src); |
|
245 | +function lsx_thumbnail($size = 'thumbnail', $image_src = false) { |
|
246 | + echo lsx_get_thumbnail($size, $image_src); |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | |
@@ -268,24 +268,24 @@ discard block |
||
268 | 268 | * @subpackage extras |
269 | 269 | * @category banner |
270 | 270 | */ |
271 | -if (!function_exists('lsx_page_banner')) { |
|
271 | +if ( ! function_exists('lsx_page_banner')) { |
|
272 | 272 | function lsx_page_banner() { |
273 | 273 | |
274 | - $post_types = array('page','post'); |
|
275 | - $post_types = apply_filters('lsx_allowed_post_type_banners',$post_types); |
|
274 | + $post_types = array('page', 'post'); |
|
275 | + $post_types = apply_filters('lsx_allowed_post_type_banners', $post_types); |
|
276 | 276 | |
277 | - if ( (is_singular($post_types) && has_post_thumbnail()) |
|
278 | - || (is_singular('jetpack-portfolio')) ) { ?> |
|
277 | + if ((is_singular($post_types) && has_post_thumbnail()) |
|
278 | + || (is_singular('jetpack-portfolio'))) { ?> |
|
279 | 279 | |
280 | 280 | <?php |
281 | 281 | $bg_image = ''; |
282 | - if(has_post_thumbnail()){ |
|
283 | - $bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full'); |
|
282 | + if (has_post_thumbnail()) { |
|
283 | + $bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full'); |
|
284 | 284 | $bg_image = $bg_image[0]; |
285 | 285 | } |
286 | 286 | ?> |
287 | 287 | |
288 | - <?php if ( ! empty( $bg_image ) ) : ?> |
|
288 | + <?php if ( ! empty($bg_image)) : ?> |
|
289 | 289 | |
290 | 290 | <div class="page-banner-wrap"> |
291 | 291 | <div class="page-banner"> |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | <?php } |
306 | 306 | } |
307 | 307 | } |
308 | -add_action( 'lsx_header_after', 'lsx_page_banner' ); |
|
308 | +add_action('lsx_header_after', 'lsx_page_banner'); |
|
309 | 309 | |
310 | 310 | |
311 | 311 | /** |
@@ -315,11 +315,11 @@ discard block |
||
315 | 315 | * @subpackage extras |
316 | 316 | * @category mobile |
317 | 317 | */ |
318 | -function lsx_allow_sms_protocol( $protocols ) { |
|
318 | +function lsx_allow_sms_protocol($protocols) { |
|
319 | 319 | $protocols[] = 'sms'; |
320 | 320 | return $protocols; |
321 | 321 | } |
322 | -add_filter( 'kses_allowed_protocols', 'lsx_allow_sms_protocol' ); |
|
322 | +add_filter('kses_allowed_protocols', 'lsx_allow_sms_protocol'); |
|
323 | 323 | |
324 | 324 | |
325 | 325 | /** |
@@ -327,28 +327,28 @@ discard block |
||
327 | 327 | */ |
328 | 328 | function mv_browser_body_class($classes) { |
329 | 329 | global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone; |
330 | - if($is_lynx) $classes[] = 'lynx'; |
|
331 | - elseif($is_gecko) $classes[] = 'gecko'; |
|
332 | - elseif($is_opera) $classes[] = 'opera'; |
|
333 | - elseif($is_NS4) $classes[] = 'ns4'; |
|
334 | - elseif($is_safari) $classes[] = 'safari'; |
|
335 | - elseif($is_chrome) $classes[] = 'chrome'; |
|
336 | - elseif($is_IE) { |
|
330 | + if ($is_lynx) $classes[] = 'lynx'; |
|
331 | + elseif ($is_gecko) $classes[] = 'gecko'; |
|
332 | + elseif ($is_opera) $classes[] = 'opera'; |
|
333 | + elseif ($is_NS4) $classes[] = 'ns4'; |
|
334 | + elseif ($is_safari) $classes[] = 'safari'; |
|
335 | + elseif ($is_chrome) $classes[] = 'chrome'; |
|
336 | + elseif ($is_IE) { |
|
337 | 337 | $classes[] = 'ie'; |
338 | - if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $_SERVER['HTTP_USER_AGENT'], $browser_version)) |
|
339 | - $classes[] = 'ie'.$browser_version[1]; |
|
338 | + if (preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $_SERVER['HTTP_USER_AGENT'], $browser_version)) |
|
339 | + $classes[] = 'ie' . $browser_version[1]; |
|
340 | 340 | } else $classes[] = 'unknown'; |
341 | - if($is_iphone) $classes[] = 'iphone'; |
|
342 | - if ( stristr( $_SERVER['HTTP_USER_AGENT'],"mac") ) { |
|
341 | + if ($is_iphone) $classes[] = 'iphone'; |
|
342 | + if (stristr($_SERVER['HTTP_USER_AGENT'], "mac")) { |
|
343 | 343 | $classes[] = 'osx'; |
344 | - } elseif ( stristr( $_SERVER['HTTP_USER_AGENT'],"linux") ) { |
|
344 | + } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "linux")) { |
|
345 | 345 | $classes[] = 'linux'; |
346 | - } elseif ( stristr( $_SERVER['HTTP_USER_AGENT'],"windows") ) { |
|
346 | + } elseif (stristr($_SERVER['HTTP_USER_AGENT'], "windows")) { |
|
347 | 347 | $classes[] = 'windows'; |
348 | 348 | } |
349 | 349 | return $classes; |
350 | 350 | } |
351 | -add_filter('body_class','mv_browser_body_class'); |
|
351 | +add_filter('body_class', 'mv_browser_body_class'); |
|
352 | 352 | |
353 | 353 | |
354 | 354 | /** |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | * @param $form Object |
362 | 362 | * @return String |
363 | 363 | */ |
364 | -function lsx_form_submit_button($button, $form){ |
|
364 | +function lsx_form_submit_button($button, $form) { |
|
365 | 365 | return "<button class='btn btn-primary' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>"; |
366 | 366 | } |
367 | 367 | add_filter("gform_submit_button", "lsx_form_submit_button", 10, 2); |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | //return ' ... <a class="moretag" href="'. get_permalink($post->ID) . '">'.__('Continue reading','lsx').'</a>'; |
376 | 376 | return '...'; |
377 | 377 | } |
378 | -add_filter( 'excerpt_more', 'lsx_excerpt_more' ); |
|
378 | +add_filter('excerpt_more', 'lsx_excerpt_more'); |
|
379 | 379 | |
380 | 380 | |
381 | 381 | /** |
@@ -384,44 +384,44 @@ discard block |
||
384 | 384 | function lsx_the_excerpt_filter($excerpt) { |
385 | 385 | $show_full_content = has_post_format(apply_filters('lsx_the_excerpt_filter_post_types', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio'))); |
386 | 386 | |
387 | - if (!$show_full_content) { |
|
388 | - if ('' !== $excerpt && !stristr($excerpt, 'moretag')) { |
|
389 | - $pagination = wp_link_pages( array( |
|
387 | + if ( ! $show_full_content) { |
|
388 | + if ('' !== $excerpt && ! stristr($excerpt, 'moretag')) { |
|
389 | + $pagination = wp_link_pages(array( |
|
390 | 390 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
391 | 391 | 'after' => '</div></div>', |
392 | 392 | 'link_before' => '<span>', |
393 | 393 | 'link_after' => '</span>', |
394 | 394 | 'echo' => 0 |
395 | - ) ); |
|
395 | + )); |
|
396 | 396 | |
397 | - if ( ! empty( $pagination ) ) { |
|
397 | + if ( ! empty($pagination)) { |
|
398 | 398 | $excerpt .= $pagination; |
399 | 399 | } |
400 | 400 | else { |
401 | - $excerpt .= '<p><a class="moretag" href="'.get_permalink().'">'.__('Continue reading','lsx').'</a></p>'; |
|
401 | + $excerpt .= '<p><a class="moretag" href="' . get_permalink() . '">' . __('Continue reading', 'lsx') . '</a></p>'; |
|
402 | 402 | } |
403 | 403 | } |
404 | 404 | } |
405 | 405 | |
406 | 406 | return $excerpt; |
407 | 407 | } |
408 | -add_filter( 'the_excerpt', 'lsx_the_excerpt_filter' , 1 , 20 ); |
|
408 | +add_filter('the_excerpt', 'lsx_the_excerpt_filter', 1, 20); |
|
409 | 409 | |
410 | 410 | |
411 | 411 | /** |
412 | 412 | * Allow HTML tags in excerpt |
413 | 413 | */ |
414 | -if ( ! function_exists( 'wpse_custom_wp_trim_excerpt' ) ) { |
|
414 | +if ( ! function_exists('wpse_custom_wp_trim_excerpt')) { |
|
415 | 415 | function wpse_custom_wp_trim_excerpt($wpse_excerpt) { |
416 | 416 | global $post; |
417 | 417 | $raw_excerpt = $wpse_excerpt; |
418 | 418 | |
419 | - if ( '' == $wpse_excerpt ) { |
|
419 | + if ('' == $wpse_excerpt) { |
|
420 | 420 | $wpse_excerpt = get_the_content(''); |
421 | 421 | $show_full_content = has_post_format(array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio')); |
422 | 422 | |
423 | - if (!$show_full_content) { |
|
424 | - $wpse_excerpt = strip_shortcodes( $wpse_excerpt ); |
|
423 | + if ( ! $show_full_content) { |
|
424 | + $wpse_excerpt = strip_shortcodes($wpse_excerpt); |
|
425 | 425 | $wpse_excerpt = apply_filters('the_content', $wpse_excerpt); |
426 | 426 | $wpse_excerpt = str_replace(']]>', ']]>', $wpse_excerpt); |
427 | 427 | //$wpse_excerpt = strip_tags($wpse_excerpt, '<blockquote>,<p>'); |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | $wpse_excerpt = trim(force_balance_tags($excerptOutput)); |
450 | 450 | |
451 | 451 | if ($has_more) { |
452 | - $excerpt_end = '<a class="moretag" href="'.get_permalink().'">'.__('More','lsx').'</a>'; |
|
452 | + $excerpt_end = '<a class="moretag" href="' . get_permalink() . '">' . __('More', 'lsx') . '</a>'; |
|
453 | 453 | $excerpt_end = apply_filters('excerpt_more', ' ' . $excerpt_end); |
454 | 454 | |
455 | 455 | $pos = strrpos($wpse_excerpt, '</'); |
@@ -477,4 +477,4 @@ discard block |
||
477 | 477 | } |
478 | 478 | remove_filter('get_the_excerpt', 'wp_trim_excerpt'); |
479 | 479 | add_filter('get_the_excerpt', 'wpse_custom_wp_trim_excerpt'); |
480 | -remove_filter( 'the_excerpt', 'wpautop' ); |
|
480 | +remove_filter('the_excerpt', 'wpautop'); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Enqueue scripts and styles. |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | function lsx_scripts() { |
11 | 11 | global $content_width; |
12 | 12 | |
13 | - wp_enqueue_style('lsx_main_style', get_stylesheet_uri() , false, '23a2bd43791de3fa3cab2d2af5fec6a2'); |
|
13 | + wp_enqueue_style('lsx_main_style', get_stylesheet_uri(), false, '23a2bd43791de3fa3cab2d2af5fec6a2'); |
|
14 | 14 | |
15 | 15 | wp_enqueue_style('lsx_main', get_template_directory_uri() . '/css/app.css', false, '48a2bd26791de3fa7cab2d2af5fec6a2'); |
16 | 16 | |
17 | - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { |
|
18 | - wp_enqueue_script( 'comment-reply' ); |
|
17 | + if (is_singular() && comments_open() && get_option('thread_comments')) { |
|
18 | + wp_enqueue_script('comment-reply'); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/vendor/bootstrap.min.js', array('jquery'), 'c9f983e2965b9c7888dac272e56c4f4b', false); |
@@ -26,38 +26,38 @@ discard block |
||
26 | 26 | wp_enqueue_script('picturefill', get_template_directory_uri() . '/js/vendor/picturefill.min.js', array(), null, false); |
27 | 27 | |
28 | 28 | wp_enqueue_script('masonry'); |
29 | - wp_enqueue_script('imagesLoaded', get_template_directory_uri().'/js/vendor/imagesloaded.pkgd.min.js', array('jquery','masonry')); |
|
30 | - if(defined('WP_DEBUG') && true === WP_DEBUG){ |
|
29 | + wp_enqueue_script('imagesLoaded', get_template_directory_uri() . '/js/vendor/imagesloaded.pkgd.min.js', array('jquery', 'masonry')); |
|
30 | + if (defined('WP_DEBUG') && true === WP_DEBUG) { |
|
31 | 31 | wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.js', array('masonry'), null, false); |
32 | - }else{ |
|
32 | + } else { |
|
33 | 33 | wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.min.js', array('masonry'), null, false); |
34 | 34 | } |
35 | 35 | |
36 | 36 | //Set some parameters that we can use in the JS |
37 | 37 | $is_portfolio = false; |
38 | - if(is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag') || is_page_template('page-templates/template-portfolio.php')){ |
|
38 | + if (is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag') || is_page_template('page-templates/template-portfolio.php')) { |
|
39 | 39 | $is_portfolio = true; |
40 | 40 | } |
41 | 41 | $param_array = array( |
42 | 42 | 'is_portfolio' => $is_portfolio |
43 | 43 | ); |
44 | 44 | //Set the columns for the archives |
45 | - $param_array['columns'] = apply_filters('lsx_archive_column_number',3); |
|
46 | - wp_localize_script( 'lsx_script', 'lsx_params', $param_array ); |
|
45 | + $param_array['columns'] = apply_filters('lsx_archive_column_number', 3); |
|
46 | + wp_localize_script('lsx_script', 'lsx_params', $param_array); |
|
47 | 47 | |
48 | 48 | |
49 | - wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css'); |
|
49 | + wp_enqueue_style('fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css'); |
|
50 | 50 | |
51 | 51 | |
52 | - if(is_child_theme() && file_exists(get_stylesheet_directory() . '/custom.css')) { |
|
53 | - wp_enqueue_style( 'child-css', get_stylesheet_directory_uri() . '/custom.css' ); |
|
52 | + if (is_child_theme() && file_exists(get_stylesheet_directory() . '/custom.css')) { |
|
53 | + wp_enqueue_style('child-css', get_stylesheet_directory_uri() . '/custom.css'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | wp_enqueue_style('medium-break', get_template_directory_uri() . '/css/medium-nav-break.css', false); |
57 | 57 | |
58 | 58 | |
59 | - $font = get_theme_mod('lsx_font','raleway_open_sans'); |
|
60 | - switch($font){ |
|
59 | + $font = get_theme_mod('lsx_font', 'raleway_open_sans'); |
|
60 | + switch ($font) { |
|
61 | 61 | case 'raleway_open_sans': |
62 | 62 | $header_font_location = 'Raleway'; |
63 | 63 | $body_font_location = 'Open+Sans'; |
@@ -86,18 +86,18 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | $http_var = 'http'; |
89 | - if(is_ssl()){ $http_var .= 's'; } |
|
89 | + if (is_ssl()) { $http_var .= 's'; } |
|
90 | 90 | |
91 | 91 | //Call the Google Fonts and then Enque them. |
92 | - wp_register_style('lsx-header-font', $http_var.'://fonts.googleapis.com/css?family='.$header_font_location); |
|
93 | - wp_register_style('lsx-body-font', $http_var.'://fonts.googleapis.com/css?family='.$body_font_location); |
|
94 | - wp_enqueue_style( 'lsx-header-font'); |
|
95 | - wp_enqueue_style( 'lsx-body-font'); |
|
92 | + wp_register_style('lsx-header-font', $http_var . '://fonts.googleapis.com/css?family=' . $header_font_location); |
|
93 | + wp_register_style('lsx-body-font', $http_var . '://fonts.googleapis.com/css?family=' . $body_font_location); |
|
94 | + wp_enqueue_style('lsx-header-font'); |
|
95 | + wp_enqueue_style('lsx-body-font'); |
|
96 | 96 | |
97 | - wp_enqueue_style('lsx_font_scheme', esc_url( get_template_directory_uri() . '/css/'.$font.'.css'), false, '48a2bd26791de3fa7cab2d2af5fec6a4'); |
|
97 | + wp_enqueue_style('lsx_font_scheme', esc_url(get_template_directory_uri() . '/css/' . $font . '.css'), false, '48a2bd26791de3fa7cab2d2af5fec6a4'); |
|
98 | 98 | |
99 | 99 | } |
100 | -add_action( 'wp_enqueue_scripts', 'lsx_scripts' ); |
|
100 | +add_action('wp_enqueue_scripts', 'lsx_scripts'); |
|
101 | 101 | |
102 | 102 | /** |
103 | 103 | * Defer JavaScript |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | * @package lsx |
106 | 106 | * @subpackage scripts |
107 | 107 | */ |
108 | -function lsx_scripts_defer_parsing( $url ) { |
|
109 | - if ( ! ( is_admin() ) ) { |
|
110 | - if ( FALSE === strpos( $url, '.js' ) ) return $url; |
|
111 | - if ( strpos( $url, 'jquery.js' ) ) return $url; |
|
112 | - if ( strpos( $url, ' defer ' ) ) return $url; |
|
108 | +function lsx_scripts_defer_parsing($url) { |
|
109 | + if ( ! (is_admin())) { |
|
110 | + if (FALSE === strpos($url, '.js')) return $url; |
|
111 | + if (strpos($url, 'jquery.js')) return $url; |
|
112 | + if (strpos($url, ' defer ')) return $url; |
|
113 | 113 | return "$url' defer onload='"; |
114 | 114 | } |
115 | 115 | |
116 | 116 | return $url; |
117 | 117 | } |
118 | -add_filter( 'clean_url', 'lsx_scripts_defer_parsing', 11, 1 ); |
|
118 | +add_filter('clean_url', 'lsx_scripts_defer_parsing', 11, 1); |
@@ -1,22 +1,22 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Transform SCSS to CSS |
6 | 6 | */ |
7 | -function lsx_customizer_colour__scss_to_css( $scss ) { |
|
7 | +function lsx_customizer_colour__scss_to_css($scss) { |
|
8 | 8 | $css = ''; |
9 | - $scssphp_file = get_template_directory() .'/vendor/leafo/scssphp/scss.inc.php'; |
|
9 | + $scssphp_file = get_template_directory() . '/vendor/leafo/scssphp/scss.inc.php'; |
|
10 | 10 | |
11 | - if ( ! empty( $scss ) && file_exists( $scssphp_file ) ) { |
|
11 | + if ( ! empty($scss) && file_exists($scssphp_file)) { |
|
12 | 12 | require_once $scssphp_file; |
13 | 13 | |
14 | 14 | $compiler = new \Leafo\ScssPhp\Compiler(); |
15 | - $compiler->setFormatter( 'Leafo\ScssPhp\Formatter\Compact' ); |
|
15 | + $compiler->setFormatter('Leafo\ScssPhp\Formatter\Compact'); |
|
16 | 16 | |
17 | 17 | try { |
18 | - $css = $compiler->compile( $scss ); |
|
19 | - } catch ( Exception $e ) { |
|
18 | + $css = $compiler->compile($scss); |
|
19 | + } catch (Exception $e) { |
|
20 | 20 | $error = $e->getMessage(); |
21 | 21 | return "/*\n\n\$error:\n\n{$error}\n\n\$scss:\n\n{$scss} */"; |
22 | 22 | } |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | * |
30 | 30 | */ |
31 | 31 | function lsx_customizer_colour__add_footer_styles() { |
32 | - wp_enqueue_style( 'lsx_customizer_colour', get_stylesheet_uri() ); |
|
32 | + wp_enqueue_style('lsx_customizer_colour', get_stylesheet_uri()); |
|
33 | 33 | } |
34 | -add_action( 'wp_footer', 'lsx_customizer_colour__add_footer_styles', 11 ); |
|
34 | +add_action('wp_footer', 'lsx_customizer_colour__add_footer_styles', 11); |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Outputs an Underscore template for generating CSS for the color scheme. |
@@ -41,28 +41,28 @@ discard block |
||
41 | 41 | |
42 | 42 | $colors = array(); |
43 | 43 | |
44 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
45 | - $colors[$key] = 'unquote("{{ data.'.$key.' }}")'; |
|
44 | + foreach ($customizer_colour_names as $key => $value) { |
|
45 | + $colors[$key] = 'unquote("{{ data.' . $key . ' }}")'; |
|
46 | 46 | } |
47 | 47 | ?> |
48 | 48 | <script type="text/html" id="tmpl-lsx-color-scheme"> |
49 | - <?php echo lsx_customizer_colour__top_menu_get_css( $colors ) ?> |
|
50 | - <?php echo lsx_customizer_colour__header_get_css( $colors ) ?> |
|
51 | - <?php echo lsx_customizer_colour__main_menu_get_css( $colors ) ?> |
|
49 | + <?php echo lsx_customizer_colour__top_menu_get_css($colors) ?> |
|
50 | + <?php echo lsx_customizer_colour__header_get_css($colors) ?> |
|
51 | + <?php echo lsx_customizer_colour__main_menu_get_css($colors) ?> |
|
52 | 52 | |
53 | - <?php echo lsx_customizer_colour__banner_get_css( $colors ) ?> |
|
54 | - <?php echo lsx_customizer_colour__body_get_css( $colors ) ?> |
|
53 | + <?php echo lsx_customizer_colour__banner_get_css($colors) ?> |
|
54 | + <?php echo lsx_customizer_colour__body_get_css($colors) ?> |
|
55 | 55 | |
56 | - <?php echo lsx_customizer_colour__footer_cta_get_css( $colors ) ?> |
|
57 | - <?php echo lsx_customizer_colour__footer_widgets_get_css( $colors ) ?> |
|
58 | - <?php echo lsx_customizer_colour__footer_get_css( $colors ) ?> |
|
56 | + <?php echo lsx_customizer_colour__footer_cta_get_css($colors) ?> |
|
57 | + <?php echo lsx_customizer_colour__footer_widgets_get_css($colors) ?> |
|
58 | + <?php echo lsx_customizer_colour__footer_get_css($colors) ?> |
|
59 | 59 | |
60 | - <?php echo lsx_customizer_colour__button_get_css( $colors ) ?> |
|
61 | - <?php echo lsx_customizer_colour__button_cta_get_css( $colors ) ?> |
|
60 | + <?php echo lsx_customizer_colour__button_get_css($colors) ?> |
|
61 | + <?php echo lsx_customizer_colour__button_cta_get_css($colors) ?> |
|
62 | 62 | </script> |
63 | 63 | <?php |
64 | 64 | } |
65 | -add_action( 'customize_controls_print_footer_scripts', 'lsx_customizer_colour__color_scheme_css_template' ); |
|
65 | +add_action('customize_controls_print_footer_scripts', 'lsx_customizer_colour__color_scheme_css_template'); |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Retrieves the current color scheme. |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | function lsx_customizer_colour__get_color_scheme() { |
71 | 71 | global $customizer_colour_choices; |
72 | 72 | |
73 | - $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); |
|
73 | + $color_scheme_option = get_theme_mod('color_scheme', 'default'); |
|
74 | 74 | $color_schemes = $customizer_colour_choices; |
75 | 75 | |
76 | - if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { |
|
77 | - return $color_schemes[ $color_scheme_option ]['colors']; |
|
76 | + if (array_key_exists($color_scheme_option, $color_schemes)) { |
|
77 | + return $color_schemes[$color_scheme_option]['colors']; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | return $color_schemes['default']['colors']; |
@@ -83,22 +83,22 @@ discard block |
||
83 | 83 | /** |
84 | 84 | * Converts a HEX value to RGB. |
85 | 85 | */ |
86 | -function lsx_customizer_colour__hex2rgb( $color ) { |
|
87 | - $color = trim( $color, '#' ); |
|
88 | - |
|
89 | - if ( strlen( $color ) === 3 ) { |
|
90 | - $r = hexdec( substr( $color, 0, 1 ).substr( $color, 0, 1 ) ); |
|
91 | - $g = hexdec( substr( $color, 1, 1 ).substr( $color, 1, 1 ) ); |
|
92 | - $b = hexdec( substr( $color, 2, 1 ).substr( $color, 2, 1 ) ); |
|
93 | - } else if ( strlen( $color ) === 6 ) { |
|
94 | - $r = hexdec( substr( $color, 0, 2 ) ); |
|
95 | - $g = hexdec( substr( $color, 2, 2 ) ); |
|
96 | - $b = hexdec( substr( $color, 4, 2 ) ); |
|
86 | +function lsx_customizer_colour__hex2rgb($color) { |
|
87 | + $color = trim($color, '#'); |
|
88 | + |
|
89 | + if (strlen($color) === 3) { |
|
90 | + $r = hexdec(substr($color, 0, 1) . substr($color, 0, 1)); |
|
91 | + $g = hexdec(substr($color, 1, 1) . substr($color, 1, 1)); |
|
92 | + $b = hexdec(substr($color, 2, 1) . substr($color, 2, 1)); |
|
93 | + } else if (strlen($color) === 6) { |
|
94 | + $r = hexdec(substr($color, 0, 2)); |
|
95 | + $g = hexdec(substr($color, 2, 2)); |
|
96 | + $b = hexdec(substr($color, 4, 2)); |
|
97 | 97 | } else { |
98 | 98 | return array(); |
99 | 99 | } |
100 | 100 | |
101 | - return array( 'red' => $r, 'green' => $g, 'blue' => $b ); |
|
101 | + return array('red' => $r, 'green' => $g, 'blue' => $b); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /* ################################################################################# */ |
@@ -109,33 +109,33 @@ discard block |
||
109 | 109 | */ |
110 | 110 | function lsx_customizer_colour__button_set_theme_mod() { |
111 | 111 | $theme_mods = lsx_customizer_colour__button_get_theme_mods(); |
112 | - $styles = lsx_customizer_colour__button_get_css( $theme_mods ); |
|
112 | + $styles = lsx_customizer_colour__button_get_css($theme_mods); |
|
113 | 113 | |
114 | - set_theme_mod( 'lsx_customizer_colour__button_theme_mod', $styles ); |
|
114 | + set_theme_mod('lsx_customizer_colour__button_theme_mod', $styles); |
|
115 | 115 | } |
116 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__button_set_theme_mod' ); |
|
117 | -add_action( 'customize_save_after', 'lsx_customizer_colour__button_set_theme_mod' ); |
|
116 | +add_action('after_switch_theme', 'lsx_customizer_colour__button_set_theme_mod'); |
|
117 | +add_action('customize_save_after', 'lsx_customizer_colour__button_set_theme_mod'); |
|
118 | 118 | |
119 | 119 | /** |
120 | 120 | * Enqueues front-end CSS for the button. |
121 | 121 | */ |
122 | 122 | function lsx_customizer_colour__button_css() { |
123 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__button_theme_mod' ); |
|
123 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__button_theme_mod'); |
|
124 | 124 | |
125 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
125 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
126 | 126 | $theme_mods = lsx_customizer_colour__button_get_theme_mods(); |
127 | - $styles = lsx_customizer_colour__button_get_css( $theme_mods ); |
|
127 | + $styles = lsx_customizer_colour__button_get_css($theme_mods); |
|
128 | 128 | |
129 | - if ( false === $styles_from_theme_mod ) { |
|
130 | - set_theme_mod( 'lsx_customizer_colour__button_theme_mod', $styles ); |
|
129 | + if (false === $styles_from_theme_mod) { |
|
130 | + set_theme_mod('lsx_customizer_colour__button_theme_mod', $styles); |
|
131 | 131 | } |
132 | 132 | } else { |
133 | 133 | $styles = $styles_from_theme_mod; |
134 | 134 | } |
135 | 135 | |
136 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
136 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
137 | 137 | } |
138 | -add_action( 'wp_footer', 'lsx_customizer_colour__button_css', 12 ); |
|
138 | +add_action('wp_footer', 'lsx_customizer_colour__button_css', 12); |
|
139 | 139 | |
140 | 140 | /** |
141 | 141 | * Get button CSS theme mods. |
@@ -147,32 +147,32 @@ discard block |
||
147 | 147 | $colors = array(); |
148 | 148 | $counter = 0; |
149 | 149 | |
150 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
150 | + foreach ($customizer_colour_names as $key => $value) { |
|
151 | 151 | $colors[$key] = $color_scheme[$counter]; |
152 | 152 | $counter++; |
153 | 153 | } |
154 | 154 | |
155 | 155 | return array( |
156 | - 'button_background_color' => get_theme_mod( 'button_background_color', $colors['button_background_color'] ), |
|
157 | - 'button_background_hover_color' => get_theme_mod( 'button_background_hover_color', $colors['button_background_hover_color'] ), |
|
158 | - 'button_text_color' => get_theme_mod( 'button_text_color', $colors['button_text_color'] ), |
|
159 | - 'button_text_color_hover' => get_theme_mod( 'button_text_color_hover', $colors['button_text_color_hover'] ) |
|
156 | + 'button_background_color' => get_theme_mod('button_background_color', $colors['button_background_color']), |
|
157 | + 'button_background_hover_color' => get_theme_mod('button_background_hover_color', $colors['button_background_hover_color']), |
|
158 | + 'button_text_color' => get_theme_mod('button_text_color', $colors['button_text_color']), |
|
159 | + 'button_text_color_hover' => get_theme_mod('button_text_color_hover', $colors['button_text_color_hover']) |
|
160 | 160 | ); |
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
164 | 164 | * Returns CSS for the button. |
165 | 165 | */ |
166 | -function lsx_customizer_colour__button_get_css( $colors ) { |
|
166 | +function lsx_customizer_colour__button_get_css($colors) { |
|
167 | 167 | global $customizer_colour_names; |
168 | 168 | |
169 | 169 | $colors_template = array(); |
170 | 170 | |
171 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
171 | + foreach ($customizer_colour_names as $key => $value) { |
|
172 | 172 | $colors_template[$key] = ''; |
173 | 173 | } |
174 | 174 | |
175 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
175 | + $colors = wp_parse_args($colors, $colors_template); |
|
176 | 176 | |
177 | 177 | $css = <<<CSS |
178 | 178 | /* |
@@ -262,8 +262,8 @@ discard block |
||
262 | 262 | } |
263 | 263 | CSS; |
264 | 264 | |
265 | - $css = apply_filters( 'lsx_customizer_colour_selectors_button', $css, $colors ); |
|
266 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
265 | + $css = apply_filters('lsx_customizer_colour_selectors_button', $css, $colors); |
|
266 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
267 | 267 | return $css; |
268 | 268 | } |
269 | 269 | |
@@ -276,33 +276,33 @@ discard block |
||
276 | 276 | */ |
277 | 277 | function lsx_customizer_colour__button_cta_set_theme_mod() { |
278 | 278 | $theme_mods = lsx_customizer_colour__button_cta_get_theme_mods(); |
279 | - $styles = lsx_customizer_colour__button_cta_get_css( $theme_mods ); |
|
279 | + $styles = lsx_customizer_colour__button_cta_get_css($theme_mods); |
|
280 | 280 | |
281 | - set_theme_mod( 'lsx_customizer_colour__button_cta_theme_mod', $styles ); |
|
281 | + set_theme_mod('lsx_customizer_colour__button_cta_theme_mod', $styles); |
|
282 | 282 | } |
283 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__button_cta_set_theme_mod' ); |
|
284 | -add_action( 'customize_save_after', 'lsx_customizer_colour__button_cta_set_theme_mod' ); |
|
283 | +add_action('after_switch_theme', 'lsx_customizer_colour__button_cta_set_theme_mod'); |
|
284 | +add_action('customize_save_after', 'lsx_customizer_colour__button_cta_set_theme_mod'); |
|
285 | 285 | |
286 | 286 | /** |
287 | 287 | * Enqueues front-end CSS for the button cta. |
288 | 288 | */ |
289 | 289 | function lsx_customizer_colour__button_cta_css() { |
290 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__button_cta_theme_mod' ); |
|
290 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__button_cta_theme_mod'); |
|
291 | 291 | |
292 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
292 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
293 | 293 | $theme_mods = lsx_customizer_colour__button_cta_get_theme_mods(); |
294 | - $styles = lsx_customizer_colour__button_cta_get_css( $theme_mods ); |
|
294 | + $styles = lsx_customizer_colour__button_cta_get_css($theme_mods); |
|
295 | 295 | |
296 | - if ( false === $styles_from_theme_mod ) { |
|
297 | - set_theme_mod( 'lsx_customizer_colour__button_cta_theme_mod', $styles ); |
|
296 | + if (false === $styles_from_theme_mod) { |
|
297 | + set_theme_mod('lsx_customizer_colour__button_cta_theme_mod', $styles); |
|
298 | 298 | } |
299 | 299 | } else { |
300 | 300 | $styles = $styles_from_theme_mod; |
301 | 301 | } |
302 | 302 | |
303 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
303 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
304 | 304 | } |
305 | -add_action( 'wp_footer', 'lsx_customizer_colour__button_cta_css', 12 ); |
|
305 | +add_action('wp_footer', 'lsx_customizer_colour__button_cta_css', 12); |
|
306 | 306 | |
307 | 307 | /** |
308 | 308 | * Get button cta CSS theme mods. |
@@ -314,32 +314,32 @@ discard block |
||
314 | 314 | $colors = array(); |
315 | 315 | $counter = 0; |
316 | 316 | |
317 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
317 | + foreach ($customizer_colour_names as $key => $value) { |
|
318 | 318 | $colors[$key] = $color_scheme[$counter]; |
319 | 319 | $counter++; |
320 | 320 | } |
321 | 321 | |
322 | 322 | return array( |
323 | - 'button_cta_background_color' => get_theme_mod( 'button_cta_background_color', $colors['button_cta_background_color'] ), |
|
324 | - 'button_cta_background_hover_color' => get_theme_mod( 'button_cta_background_hover_color', $colors['button_cta_background_hover_color'] ), |
|
325 | - 'button_cta_text_color' => get_theme_mod( 'button_cta_text_color', $colors['button_cta_text_color'] ), |
|
326 | - 'button_cta_text_color_hover' => get_theme_mod( 'button_cta_text_color_hover', $colors['button_cta_text_color_hover'] ) |
|
323 | + 'button_cta_background_color' => get_theme_mod('button_cta_background_color', $colors['button_cta_background_color']), |
|
324 | + 'button_cta_background_hover_color' => get_theme_mod('button_cta_background_hover_color', $colors['button_cta_background_hover_color']), |
|
325 | + 'button_cta_text_color' => get_theme_mod('button_cta_text_color', $colors['button_cta_text_color']), |
|
326 | + 'button_cta_text_color_hover' => get_theme_mod('button_cta_text_color_hover', $colors['button_cta_text_color_hover']) |
|
327 | 327 | ); |
328 | 328 | } |
329 | 329 | |
330 | 330 | /** |
331 | 331 | * Returns CSS for the button cta. |
332 | 332 | */ |
333 | -function lsx_customizer_colour__button_cta_get_css( $colors ) { |
|
333 | +function lsx_customizer_colour__button_cta_get_css($colors) { |
|
334 | 334 | global $customizer_colour_names; |
335 | 335 | |
336 | 336 | $colors_template = array(); |
337 | 337 | |
338 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
338 | + foreach ($customizer_colour_names as $key => $value) { |
|
339 | 339 | $colors_template[$key] = ''; |
340 | 340 | } |
341 | 341 | |
342 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
342 | + $colors = wp_parse_args($colors, $colors_template); |
|
343 | 343 | |
344 | 344 | $css = <<<CSS |
345 | 345 | /* |
@@ -405,8 +405,8 @@ discard block |
||
405 | 405 | } |
406 | 406 | CSS; |
407 | 407 | |
408 | - $css = apply_filters( 'lsx_customizer_colour_selectors_button_cta', $css, $colors ); |
|
409 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
408 | + $css = apply_filters('lsx_customizer_colour_selectors_button_cta', $css, $colors); |
|
409 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
410 | 410 | return $css; |
411 | 411 | } |
412 | 412 | |
@@ -419,33 +419,33 @@ discard block |
||
419 | 419 | */ |
420 | 420 | function lsx_customizer_colour__top_menu_set_theme_mod() { |
421 | 421 | $theme_mods = lsx_customizer_colour__top_menu_get_theme_mods(); |
422 | - $styles = lsx_customizer_colour__top_menu_get_css( $theme_mods ); |
|
422 | + $styles = lsx_customizer_colour__top_menu_get_css($theme_mods); |
|
423 | 423 | |
424 | - set_theme_mod( 'lsx_customizer_colour__top_menu_theme_mod', $styles ); |
|
424 | + set_theme_mod('lsx_customizer_colour__top_menu_theme_mod', $styles); |
|
425 | 425 | } |
426 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__top_menu_set_theme_mod' ); |
|
427 | -add_action( 'customize_save_after', 'lsx_customizer_colour__top_menu_set_theme_mod' ); |
|
426 | +add_action('after_switch_theme', 'lsx_customizer_colour__top_menu_set_theme_mod'); |
|
427 | +add_action('customize_save_after', 'lsx_customizer_colour__top_menu_set_theme_mod'); |
|
428 | 428 | |
429 | 429 | /** |
430 | 430 | * Enqueues front-end CSS for the top menu. |
431 | 431 | */ |
432 | 432 | function lsx_customizer_colour__top_menu_css() { |
433 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__top_menu_theme_mod' ); |
|
433 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__top_menu_theme_mod'); |
|
434 | 434 | |
435 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
435 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
436 | 436 | $theme_mods = lsx_customizer_colour__top_menu_get_theme_mods(); |
437 | - $styles = lsx_customizer_colour__top_menu_get_css( $theme_mods ); |
|
437 | + $styles = lsx_customizer_colour__top_menu_get_css($theme_mods); |
|
438 | 438 | |
439 | - if ( false === $styles_from_theme_mod ) { |
|
440 | - set_theme_mod( 'lsx_customizer_colour__top_menu_theme_mod', $styles ); |
|
439 | + if (false === $styles_from_theme_mod) { |
|
440 | + set_theme_mod('lsx_customizer_colour__top_menu_theme_mod', $styles); |
|
441 | 441 | } |
442 | 442 | } else { |
443 | 443 | $styles = $styles_from_theme_mod; |
444 | 444 | } |
445 | 445 | |
446 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
446 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
447 | 447 | } |
448 | -add_action( 'wp_footer', 'lsx_customizer_colour__top_menu_css', 12 ); |
|
448 | +add_action('wp_footer', 'lsx_customizer_colour__top_menu_css', 12); |
|
449 | 449 | |
450 | 450 | /** |
451 | 451 | * Get top menu CSS theme mods. |
@@ -457,31 +457,31 @@ discard block |
||
457 | 457 | $colors = array(); |
458 | 458 | $counter = 0; |
459 | 459 | |
460 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
460 | + foreach ($customizer_colour_names as $key => $value) { |
|
461 | 461 | $colors[$key] = $color_scheme[$counter]; |
462 | 462 | $counter++; |
463 | 463 | } |
464 | 464 | |
465 | 465 | return array( |
466 | - 'top_menu_background_color' => get_theme_mod( 'top_menu_background_color', $colors['top_menu_background_color'] ), |
|
467 | - 'top_menu_text_color' => get_theme_mod( 'top_menu_text_color', $colors['top_menu_text_color'] ), |
|
468 | - 'top_menu_text_hover_color' => get_theme_mod( 'top_menu_text_hover_color', $colors['top_menu_text_hover_color'] ) |
|
466 | + 'top_menu_background_color' => get_theme_mod('top_menu_background_color', $colors['top_menu_background_color']), |
|
467 | + 'top_menu_text_color' => get_theme_mod('top_menu_text_color', $colors['top_menu_text_color']), |
|
468 | + 'top_menu_text_hover_color' => get_theme_mod('top_menu_text_hover_color', $colors['top_menu_text_hover_color']) |
|
469 | 469 | ); |
470 | 470 | } |
471 | 471 | |
472 | 472 | /** |
473 | 473 | * Returns CSS for the top menu. |
474 | 474 | */ |
475 | -function lsx_customizer_colour__top_menu_get_css( $colors ) { |
|
475 | +function lsx_customizer_colour__top_menu_get_css($colors) { |
|
476 | 476 | global $customizer_colour_names; |
477 | 477 | |
478 | 478 | $colors_template = array(); |
479 | 479 | |
480 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
480 | + foreach ($customizer_colour_names as $key => $value) { |
|
481 | 481 | $colors_template[$key] = ''; |
482 | 482 | } |
483 | 483 | |
484 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
484 | + $colors = wp_parse_args($colors, $colors_template); |
|
485 | 485 | |
486 | 486 | $css = <<<CSS |
487 | 487 | /* |
@@ -521,8 +521,8 @@ discard block |
||
521 | 521 | } |
522 | 522 | CSS; |
523 | 523 | |
524 | - $css = apply_filters( 'lsx_customizer_colour_selectors_top_menu', $css, $colors ); |
|
525 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
524 | + $css = apply_filters('lsx_customizer_colour_selectors_top_menu', $css, $colors); |
|
525 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
526 | 526 | return $css; |
527 | 527 | } |
528 | 528 | |
@@ -535,33 +535,33 @@ discard block |
||
535 | 535 | */ |
536 | 536 | function lsx_customizer_colour__header_set_theme_mod() { |
537 | 537 | $theme_mods = lsx_customizer_colour__header_get_theme_mods(); |
538 | - $styles = lsx_customizer_colour__header_get_css( $theme_mods ); |
|
538 | + $styles = lsx_customizer_colour__header_get_css($theme_mods); |
|
539 | 539 | |
540 | - set_theme_mod( 'lsx_customizer_colour__header_theme_mod', $styles ); |
|
540 | + set_theme_mod('lsx_customizer_colour__header_theme_mod', $styles); |
|
541 | 541 | } |
542 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__header_set_theme_mod' ); |
|
543 | -add_action( 'customize_save_after', 'lsx_customizer_colour__header_set_theme_mod' ); |
|
542 | +add_action('after_switch_theme', 'lsx_customizer_colour__header_set_theme_mod'); |
|
543 | +add_action('customize_save_after', 'lsx_customizer_colour__header_set_theme_mod'); |
|
544 | 544 | |
545 | 545 | /** |
546 | 546 | * Enqueues front-end CSS for the header. |
547 | 547 | */ |
548 | 548 | function lsx_customizer_colour__header_css() { |
549 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__header_theme_mod' ); |
|
549 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__header_theme_mod'); |
|
550 | 550 | |
551 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
551 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
552 | 552 | $theme_mods = lsx_customizer_colour__header_get_theme_mods(); |
553 | - $styles = lsx_customizer_colour__header_get_css( $theme_mods ); |
|
553 | + $styles = lsx_customizer_colour__header_get_css($theme_mods); |
|
554 | 554 | |
555 | - if ( false === $styles_from_theme_mod ) { |
|
556 | - set_theme_mod( 'lsx_customizer_colour__header_theme_mod', $styles ); |
|
555 | + if (false === $styles_from_theme_mod) { |
|
556 | + set_theme_mod('lsx_customizer_colour__header_theme_mod', $styles); |
|
557 | 557 | } |
558 | 558 | } else { |
559 | 559 | $styles = $styles_from_theme_mod; |
560 | 560 | } |
561 | 561 | |
562 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
562 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
563 | 563 | } |
564 | -add_action( 'wp_footer', 'lsx_customizer_colour__header_css', 12 ); |
|
564 | +add_action('wp_footer', 'lsx_customizer_colour__header_css', 12); |
|
565 | 565 | |
566 | 566 | /** |
567 | 567 | * Get header CSS theme mods. |
@@ -573,32 +573,32 @@ discard block |
||
573 | 573 | $colors = array(); |
574 | 574 | $counter = 0; |
575 | 575 | |
576 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
576 | + foreach ($customizer_colour_names as $key => $value) { |
|
577 | 577 | $colors[$key] = $color_scheme[$counter]; |
578 | 578 | $counter++; |
579 | 579 | } |
580 | 580 | |
581 | 581 | return array( |
582 | - 'header_background_color' => get_theme_mod( 'header_background_color', $colors['header_background_color'] ), |
|
583 | - 'header_title_color' => get_theme_mod( 'header_title_color', $colors['header_title_color'] ), |
|
584 | - 'header_title_hover_color' => get_theme_mod( 'header_title_hover_color', $colors['header_title_hover_color'] ), |
|
585 | - 'header_description_color' => get_theme_mod( 'header_description_color', $colors['header_description_color'] ) |
|
582 | + 'header_background_color' => get_theme_mod('header_background_color', $colors['header_background_color']), |
|
583 | + 'header_title_color' => get_theme_mod('header_title_color', $colors['header_title_color']), |
|
584 | + 'header_title_hover_color' => get_theme_mod('header_title_hover_color', $colors['header_title_hover_color']), |
|
585 | + 'header_description_color' => get_theme_mod('header_description_color', $colors['header_description_color']) |
|
586 | 586 | ); |
587 | 587 | } |
588 | 588 | |
589 | 589 | /** |
590 | 590 | * Returns CSS for the header. |
591 | 591 | */ |
592 | -function lsx_customizer_colour__header_get_css( $colors ) { |
|
592 | +function lsx_customizer_colour__header_get_css($colors) { |
|
593 | 593 | global $customizer_colour_names; |
594 | 594 | |
595 | 595 | $colors_template = array(); |
596 | 596 | |
597 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
597 | + foreach ($customizer_colour_names as $key => $value) { |
|
598 | 598 | $colors_template[$key] = ''; |
599 | 599 | } |
600 | 600 | |
601 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
601 | + $colors = wp_parse_args($colors, $colors_template); |
|
602 | 602 | |
603 | 603 | $css = <<<CSS |
604 | 604 | /* |
@@ -635,8 +635,8 @@ discard block |
||
635 | 635 | } |
636 | 636 | CSS; |
637 | 637 | |
638 | - $css = apply_filters( 'lsx_customizer_colour_selectors_header', $css, $colors ); |
|
639 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
638 | + $css = apply_filters('lsx_customizer_colour_selectors_header', $css, $colors); |
|
639 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
640 | 640 | return $css; |
641 | 641 | } |
642 | 642 | |
@@ -649,33 +649,33 @@ discard block |
||
649 | 649 | */ |
650 | 650 | function lsx_customizer_colour__main_menu_set_theme_mod() { |
651 | 651 | $theme_mods = lsx_customizer_colour__main_menu_get_theme_mods(); |
652 | - $styles = lsx_customizer_colour__main_menu_get_css( $theme_mods ); |
|
652 | + $styles = lsx_customizer_colour__main_menu_get_css($theme_mods); |
|
653 | 653 | |
654 | - set_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod', $styles ); |
|
654 | + set_theme_mod('lsx_customizer_colour__main_menu_theme_mod', $styles); |
|
655 | 655 | } |
656 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__main_menu_set_theme_mod' ); |
|
657 | -add_action( 'customize_save_after', 'lsx_customizer_colour__main_menu_set_theme_mod' ); |
|
656 | +add_action('after_switch_theme', 'lsx_customizer_colour__main_menu_set_theme_mod'); |
|
657 | +add_action('customize_save_after', 'lsx_customizer_colour__main_menu_set_theme_mod'); |
|
658 | 658 | |
659 | 659 | /** |
660 | 660 | * Enqueues front-end CSS for the main menu. |
661 | 661 | */ |
662 | 662 | function lsx_customizer_colour__main_menu_css() { |
663 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod' ); |
|
663 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__main_menu_theme_mod'); |
|
664 | 664 | |
665 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
665 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
666 | 666 | $theme_mods = lsx_customizer_colour__main_menu_get_theme_mods(); |
667 | - $styles = lsx_customizer_colour__main_menu_get_css( $theme_mods ); |
|
667 | + $styles = lsx_customizer_colour__main_menu_get_css($theme_mods); |
|
668 | 668 | |
669 | - if ( false === $styles_from_theme_mod ) { |
|
670 | - set_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod', $styles ); |
|
669 | + if (false === $styles_from_theme_mod) { |
|
670 | + set_theme_mod('lsx_customizer_colour__main_menu_theme_mod', $styles); |
|
671 | 671 | } |
672 | 672 | } else { |
673 | 673 | $styles = $styles_from_theme_mod; |
674 | 674 | } |
675 | 675 | |
676 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
676 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
677 | 677 | } |
678 | -add_action( 'wp_footer', 'lsx_customizer_colour__main_menu_css', 12 ); |
|
678 | +add_action('wp_footer', 'lsx_customizer_colour__main_menu_css', 12); |
|
679 | 679 | |
680 | 680 | /** |
681 | 681 | * Get main menu CSS theme mods. |
@@ -687,33 +687,33 @@ discard block |
||
687 | 687 | $colors = array(); |
688 | 688 | $counter = 0; |
689 | 689 | |
690 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
690 | + foreach ($customizer_colour_names as $key => $value) { |
|
691 | 691 | $colors[$key] = $color_scheme[$counter]; |
692 | 692 | $counter++; |
693 | 693 | } |
694 | 694 | |
695 | 695 | return array( |
696 | - 'main_menu_background_hover1_color' => get_theme_mod( 'main_menu_background_hover1_color', $colors['main_menu_background_hover1_color'] ), |
|
697 | - 'main_menu_background_hover2_color' => get_theme_mod( 'main_menu_background_hover2_color', $colors['main_menu_background_hover2_color'] ), |
|
698 | - 'main_menu_text_color' => get_theme_mod( 'main_menu_text_color', $colors['main_menu_text_color'] ), |
|
699 | - 'main_menu_text_hover1_color' => get_theme_mod( 'main_menu_text_hover1_color', $colors['main_menu_text_hover1_color'] ), |
|
700 | - 'main_menu_text_hover2_color' => get_theme_mod( 'main_menu_text_hover2_color', $colors['main_menu_text_hover2_color'] ) |
|
696 | + 'main_menu_background_hover1_color' => get_theme_mod('main_menu_background_hover1_color', $colors['main_menu_background_hover1_color']), |
|
697 | + 'main_menu_background_hover2_color' => get_theme_mod('main_menu_background_hover2_color', $colors['main_menu_background_hover2_color']), |
|
698 | + 'main_menu_text_color' => get_theme_mod('main_menu_text_color', $colors['main_menu_text_color']), |
|
699 | + 'main_menu_text_hover1_color' => get_theme_mod('main_menu_text_hover1_color', $colors['main_menu_text_hover1_color']), |
|
700 | + 'main_menu_text_hover2_color' => get_theme_mod('main_menu_text_hover2_color', $colors['main_menu_text_hover2_color']) |
|
701 | 701 | ); |
702 | 702 | } |
703 | 703 | |
704 | 704 | /** |
705 | 705 | * Returns CSS for the main menu. |
706 | 706 | */ |
707 | -function lsx_customizer_colour__main_menu_get_css( $colors ) { |
|
707 | +function lsx_customizer_colour__main_menu_get_css($colors) { |
|
708 | 708 | global $customizer_colour_names; |
709 | 709 | |
710 | 710 | $colors_template = array(); |
711 | 711 | |
712 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
712 | + foreach ($customizer_colour_names as $key => $value) { |
|
713 | 713 | $colors_template[$key] = ''; |
714 | 714 | } |
715 | 715 | |
716 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
716 | + $colors = wp_parse_args($colors, $colors_template); |
|
717 | 717 | |
718 | 718 | $css = <<<CSS |
719 | 719 | /* |
@@ -812,8 +812,8 @@ discard block |
||
812 | 812 | } |
813 | 813 | CSS; |
814 | 814 | |
815 | - $css = apply_filters( 'lsx_customizer_colour_selectors_main_menu', $css, $colors ); |
|
816 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
815 | + $css = apply_filters('lsx_customizer_colour_selectors_main_menu', $css, $colors); |
|
816 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
817 | 817 | return $css; |
818 | 818 | } |
819 | 819 | |
@@ -826,33 +826,33 @@ discard block |
||
826 | 826 | */ |
827 | 827 | function lsx_customizer_colour__banner_set_theme_mod() { |
828 | 828 | $theme_mods = lsx_customizer_colour__banner_get_theme_mods(); |
829 | - $styles = lsx_customizer_colour__banner_get_css( $theme_mods ); |
|
829 | + $styles = lsx_customizer_colour__banner_get_css($theme_mods); |
|
830 | 830 | |
831 | - set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles ); |
|
831 | + set_theme_mod('lsx_customizer_colour__banner_theme_mod', $styles); |
|
832 | 832 | } |
833 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__banner_set_theme_mod' ); |
|
834 | -add_action( 'customize_save_after', 'lsx_customizer_colour__banner_set_theme_mod' ); |
|
833 | +add_action('after_switch_theme', 'lsx_customizer_colour__banner_set_theme_mod'); |
|
834 | +add_action('customize_save_after', 'lsx_customizer_colour__banner_set_theme_mod'); |
|
835 | 835 | |
836 | 836 | /** |
837 | 837 | * Enqueues front-end CSS for the banner. |
838 | 838 | */ |
839 | 839 | function lsx_customizer_colour__banner_css() { |
840 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__banner_theme_mod' ); |
|
840 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__banner_theme_mod'); |
|
841 | 841 | |
842 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
842 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
843 | 843 | $theme_mods = lsx_customizer_colour__banner_get_theme_mods(); |
844 | - $styles = lsx_customizer_colour__banner_get_css( $theme_mods ); |
|
844 | + $styles = lsx_customizer_colour__banner_get_css($theme_mods); |
|
845 | 845 | |
846 | - if ( false === $styles_from_theme_mod ) { |
|
847 | - set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles ); |
|
846 | + if (false === $styles_from_theme_mod) { |
|
847 | + set_theme_mod('lsx_customizer_colour__banner_theme_mod', $styles); |
|
848 | 848 | } |
849 | 849 | } else { |
850 | 850 | $styles = $styles_from_theme_mod; |
851 | 851 | } |
852 | 852 | |
853 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
853 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
854 | 854 | } |
855 | -add_action( 'wp_footer', 'lsx_customizer_colour__banner_css', 12 ); |
|
855 | +add_action('wp_footer', 'lsx_customizer_colour__banner_css', 12); |
|
856 | 856 | |
857 | 857 | /** |
858 | 858 | * Get banner CSS theme mods. |
@@ -864,31 +864,31 @@ discard block |
||
864 | 864 | $colors = array(); |
865 | 865 | $counter = 0; |
866 | 866 | |
867 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
867 | + foreach ($customizer_colour_names as $key => $value) { |
|
868 | 868 | $colors[$key] = $color_scheme[$counter]; |
869 | 869 | $counter++; |
870 | 870 | } |
871 | 871 | |
872 | 872 | return array( |
873 | - 'banner_background_color' => get_theme_mod( 'banner_background_color', $colors['banner_background_color'] ), |
|
874 | - 'banner_text_color' => get_theme_mod( 'banner_text_color', $colors['banner_text_color'] ), |
|
875 | - 'banner_text_image_color' => get_theme_mod( 'banner_text_image_color', $colors['banner_text_image_color'] ) |
|
873 | + 'banner_background_color' => get_theme_mod('banner_background_color', $colors['banner_background_color']), |
|
874 | + 'banner_text_color' => get_theme_mod('banner_text_color', $colors['banner_text_color']), |
|
875 | + 'banner_text_image_color' => get_theme_mod('banner_text_image_color', $colors['banner_text_image_color']) |
|
876 | 876 | ); |
877 | 877 | } |
878 | 878 | |
879 | 879 | /** |
880 | 880 | * Returns CSS for the banner. |
881 | 881 | */ |
882 | -function lsx_customizer_colour__banner_get_css( $colors ) { |
|
882 | +function lsx_customizer_colour__banner_get_css($colors) { |
|
883 | 883 | global $customizer_colour_names; |
884 | 884 | |
885 | 885 | $colors_template = array(); |
886 | 886 | |
887 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
887 | + foreach ($customizer_colour_names as $key => $value) { |
|
888 | 888 | $colors_template[$key] = ''; |
889 | 889 | } |
890 | 890 | |
891 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
891 | + $colors = wp_parse_args($colors, $colors_template); |
|
892 | 892 | |
893 | 893 | $css = <<<CSS |
894 | 894 | /* |
@@ -917,8 +917,8 @@ discard block |
||
917 | 917 | } |
918 | 918 | CSS; |
919 | 919 | |
920 | - $css = apply_filters( 'lsx_customizer_colour_selectors_banner', $css, $colors ); |
|
921 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
920 | + $css = apply_filters('lsx_customizer_colour_selectors_banner', $css, $colors); |
|
921 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
922 | 922 | return $css; |
923 | 923 | } |
924 | 924 | |
@@ -931,33 +931,33 @@ discard block |
||
931 | 931 | */ |
932 | 932 | function lsx_customizer_colour__body_set_theme_mod() { |
933 | 933 | $theme_mods = lsx_customizer_colour__body_get_theme_mods(); |
934 | - $styles = lsx_customizer_colour__body_get_css( $theme_mods ); |
|
934 | + $styles = lsx_customizer_colour__body_get_css($theme_mods); |
|
935 | 935 | |
936 | - set_theme_mod( 'lsx_customizer_colour__body_theme_mod', $styles ); |
|
936 | + set_theme_mod('lsx_customizer_colour__body_theme_mod', $styles); |
|
937 | 937 | } |
938 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__body_set_theme_mod' ); |
|
939 | -add_action( 'customize_save_after', 'lsx_customizer_colour__body_set_theme_mod' ); |
|
938 | +add_action('after_switch_theme', 'lsx_customizer_colour__body_set_theme_mod'); |
|
939 | +add_action('customize_save_after', 'lsx_customizer_colour__body_set_theme_mod'); |
|
940 | 940 | |
941 | 941 | /** |
942 | 942 | * Enqueues front-end CSS for the body. |
943 | 943 | */ |
944 | 944 | function lsx_customizer_colour__body_css() { |
945 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__body_theme_mod' ); |
|
945 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__body_theme_mod'); |
|
946 | 946 | |
947 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
947 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
948 | 948 | $theme_mods = lsx_customizer_colour__body_get_theme_mods(); |
949 | - $styles = lsx_customizer_colour__body_get_css( $theme_mods ); |
|
949 | + $styles = lsx_customizer_colour__body_get_css($theme_mods); |
|
950 | 950 | |
951 | - if ( false === $styles_from_theme_mod ) { |
|
952 | - set_theme_mod( 'lsx_customizer_colour__body_theme_mod', $styles ); |
|
951 | + if (false === $styles_from_theme_mod) { |
|
952 | + set_theme_mod('lsx_customizer_colour__body_theme_mod', $styles); |
|
953 | 953 | } |
954 | 954 | } else { |
955 | 955 | $styles = $styles_from_theme_mod; |
956 | 956 | } |
957 | 957 | |
958 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
958 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
959 | 959 | } |
960 | -add_action( 'wp_footer', 'lsx_customizer_colour__body_css', 12 ); |
|
960 | +add_action('wp_footer', 'lsx_customizer_colour__body_css', 12); |
|
961 | 961 | |
962 | 962 | /** |
963 | 963 | * Get body CSS theme mods. |
@@ -969,36 +969,36 @@ discard block |
||
969 | 969 | $colors = array(); |
970 | 970 | $counter = 0; |
971 | 971 | |
972 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
972 | + foreach ($customizer_colour_names as $key => $value) { |
|
973 | 973 | $colors[$key] = $color_scheme[$counter]; |
974 | 974 | $counter++; |
975 | 975 | } |
976 | 976 | |
977 | 977 | return array( |
978 | - 'body_background_color' => get_theme_mod( 'body_background_color', $colors['body_background_color'] ), |
|
979 | - 'body_line_color' => get_theme_mod( 'body_line_color', $colors['body_line_color'] ), |
|
980 | - 'body_text_heading_color' => get_theme_mod( 'body_text_heading_color', $colors['body_text_heading_color'] ), |
|
981 | - 'body_text_color' => get_theme_mod( 'body_text_color', $colors['body_text_color'] ), |
|
982 | - 'body_link_color' => get_theme_mod( 'body_link_color', $colors['body_link_color'] ), |
|
983 | - 'body_link_hover_color' => get_theme_mod( 'body_link_hover_color', $colors['body_link_hover_color'] ) |
|
978 | + 'body_background_color' => get_theme_mod('body_background_color', $colors['body_background_color']), |
|
979 | + 'body_line_color' => get_theme_mod('body_line_color', $colors['body_line_color']), |
|
980 | + 'body_text_heading_color' => get_theme_mod('body_text_heading_color', $colors['body_text_heading_color']), |
|
981 | + 'body_text_color' => get_theme_mod('body_text_color', $colors['body_text_color']), |
|
982 | + 'body_link_color' => get_theme_mod('body_link_color', $colors['body_link_color']), |
|
983 | + 'body_link_hover_color' => get_theme_mod('body_link_hover_color', $colors['body_link_hover_color']) |
|
984 | 984 | ); |
985 | 985 | } |
986 | 986 | |
987 | 987 | /** |
988 | 988 | * Returns CSS for the body. |
989 | 989 | */ |
990 | -function lsx_customizer_colour__body_get_css( $colors ) { |
|
990 | +function lsx_customizer_colour__body_get_css($colors) { |
|
991 | 991 | global $customizer_colour_names; |
992 | 992 | |
993 | 993 | $colors_template = array(); |
994 | 994 | |
995 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
995 | + foreach ($customizer_colour_names as $key => $value) { |
|
996 | 996 | $colors_template[$key] = ''; |
997 | 997 | } |
998 | 998 | |
999 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
999 | + $colors = wp_parse_args($colors, $colors_template); |
|
1000 | 1000 | |
1001 | - $rgb = lsx_customizer_colour__hex2rgb( $colors['body_line_color'] ); |
|
1001 | + $rgb = lsx_customizer_colour__hex2rgb($colors['body_line_color']); |
|
1002 | 1002 | $colors['body_line_color_rgba'] = "rgba({$rgb['red']}, {$rgb['green']}, {$rgb['blue']}, 0.5)"; |
1003 | 1003 | |
1004 | 1004 | $css = <<<CSS |
@@ -1243,8 +1243,8 @@ discard block |
||
1243 | 1243 | } |
1244 | 1244 | CSS; |
1245 | 1245 | |
1246 | - $css = apply_filters( 'lsx_customizer_colour_selectors_body', $css, $colors ); |
|
1247 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
1246 | + $css = apply_filters('lsx_customizer_colour_selectors_body', $css, $colors); |
|
1247 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
1248 | 1248 | return $css; |
1249 | 1249 | } |
1250 | 1250 | |
@@ -1257,33 +1257,33 @@ discard block |
||
1257 | 1257 | */ |
1258 | 1258 | function lsx_customizer_colour__footer_cta_set_theme_mod() { |
1259 | 1259 | $theme_mods = lsx_customizer_colour__footer_cta_get_theme_mods(); |
1260 | - $styles = lsx_customizer_colour__footer_cta_get_css( $theme_mods ); |
|
1260 | + $styles = lsx_customizer_colour__footer_cta_get_css($theme_mods); |
|
1261 | 1261 | |
1262 | - set_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod', $styles ); |
|
1262 | + set_theme_mod('lsx_customizer_colour__footer_cta_theme_mod', $styles); |
|
1263 | 1263 | } |
1264 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__footer_cta_set_theme_mod' ); |
|
1265 | -add_action( 'customize_save_after', 'lsx_customizer_colour__footer_cta_set_theme_mod' ); |
|
1264 | +add_action('after_switch_theme', 'lsx_customizer_colour__footer_cta_set_theme_mod'); |
|
1265 | +add_action('customize_save_after', 'lsx_customizer_colour__footer_cta_set_theme_mod'); |
|
1266 | 1266 | |
1267 | 1267 | /** |
1268 | 1268 | * Enqueues front-end CSS for the footer cta. |
1269 | 1269 | */ |
1270 | 1270 | function lsx_customizer_colour__footer_cta_css() { |
1271 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod' ); |
|
1271 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_cta_theme_mod'); |
|
1272 | 1272 | |
1273 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
1273 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
1274 | 1274 | $theme_mods = lsx_customizer_colour__footer_cta_get_theme_mods(); |
1275 | - $styles = lsx_customizer_colour__footer_cta_get_css( $theme_mods ); |
|
1275 | + $styles = lsx_customizer_colour__footer_cta_get_css($theme_mods); |
|
1276 | 1276 | |
1277 | - if ( false === $styles_from_theme_mod ) { |
|
1278 | - set_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod', $styles ); |
|
1277 | + if (false === $styles_from_theme_mod) { |
|
1278 | + set_theme_mod('lsx_customizer_colour__footer_cta_theme_mod', $styles); |
|
1279 | 1279 | } |
1280 | 1280 | } else { |
1281 | 1281 | $styles = $styles_from_theme_mod; |
1282 | 1282 | } |
1283 | 1283 | |
1284 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
1284 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
1285 | 1285 | } |
1286 | -add_action( 'wp_footer', 'lsx_customizer_colour__footer_cta_css', 12 ); |
|
1286 | +add_action('wp_footer', 'lsx_customizer_colour__footer_cta_css', 12); |
|
1287 | 1287 | |
1288 | 1288 | /** |
1289 | 1289 | * Get footer cta CSS theme mods. |
@@ -1295,32 +1295,32 @@ discard block |
||
1295 | 1295 | $colors = array(); |
1296 | 1296 | $counter = 0; |
1297 | 1297 | |
1298 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
1298 | + foreach ($customizer_colour_names as $key => $value) { |
|
1299 | 1299 | $colors[$key] = $color_scheme[$counter]; |
1300 | 1300 | $counter++; |
1301 | 1301 | } |
1302 | 1302 | |
1303 | 1303 | return array( |
1304 | - 'footer_cta_background_color' => get_theme_mod( 'footer_cta_background_color', $colors['footer_cta_background_color'] ), |
|
1305 | - 'footer_cta_text_color' => get_theme_mod( 'footer_cta_text_color', $colors['footer_cta_text_color'] ), |
|
1306 | - 'footer_cta_link_color' => get_theme_mod( 'footer_cta_link_color', $colors['footer_cta_link_color'] ), |
|
1307 | - 'footer_cta_link_hover_color' => get_theme_mod( 'footer_cta_link_hover_color', $colors['footer_cta_link_hover_color'] ) |
|
1304 | + 'footer_cta_background_color' => get_theme_mod('footer_cta_background_color', $colors['footer_cta_background_color']), |
|
1305 | + 'footer_cta_text_color' => get_theme_mod('footer_cta_text_color', $colors['footer_cta_text_color']), |
|
1306 | + 'footer_cta_link_color' => get_theme_mod('footer_cta_link_color', $colors['footer_cta_link_color']), |
|
1307 | + 'footer_cta_link_hover_color' => get_theme_mod('footer_cta_link_hover_color', $colors['footer_cta_link_hover_color']) |
|
1308 | 1308 | ); |
1309 | 1309 | } |
1310 | 1310 | |
1311 | 1311 | /** |
1312 | 1312 | * Returns CSS for the footer cta. |
1313 | 1313 | */ |
1314 | -function lsx_customizer_colour__footer_cta_get_css( $colors ) { |
|
1314 | +function lsx_customizer_colour__footer_cta_get_css($colors) { |
|
1315 | 1315 | global $customizer_colour_names; |
1316 | 1316 | |
1317 | 1317 | $colors_template = array(); |
1318 | 1318 | |
1319 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
1319 | + foreach ($customizer_colour_names as $key => $value) { |
|
1320 | 1320 | $colors_template[$key] = ''; |
1321 | 1321 | } |
1322 | 1322 | |
1323 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
1323 | + $colors = wp_parse_args($colors, $colors_template); |
|
1324 | 1324 | |
1325 | 1325 | $css = <<<CSS |
1326 | 1326 | /* |
@@ -1355,8 +1355,8 @@ discard block |
||
1355 | 1355 | } |
1356 | 1356 | CSS; |
1357 | 1357 | |
1358 | - $css = apply_filters( 'lsx_customizer_colour_selectors_footer_cta', $css, $colors ); |
|
1359 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
1358 | + $css = apply_filters('lsx_customizer_colour_selectors_footer_cta', $css, $colors); |
|
1359 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
1360 | 1360 | return $css; |
1361 | 1361 | } |
1362 | 1362 | |
@@ -1368,33 +1368,33 @@ discard block |
||
1368 | 1368 | */ |
1369 | 1369 | function lsx_customizer_colour__footer_widgets_set_theme_mod() { |
1370 | 1370 | $theme_mods = lsx_customizer_colour__footer_widgets_get_theme_mods(); |
1371 | - $styles = lsx_customizer_colour__footer_widgets_get_css( $theme_mods ); |
|
1371 | + $styles = lsx_customizer_colour__footer_widgets_get_css($theme_mods); |
|
1372 | 1372 | |
1373 | - set_theme_mod( 'lsx_customizer_colour__footer_widgets_theme_mod', $styles ); |
|
1373 | + set_theme_mod('lsx_customizer_colour__footer_widgets_theme_mod', $styles); |
|
1374 | 1374 | } |
1375 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__footer_widgets_set_theme_mod' ); |
|
1376 | -add_action( 'customize_save_after', 'lsx_customizer_colour__footer_widgets_set_theme_mod' ); |
|
1375 | +add_action('after_switch_theme', 'lsx_customizer_colour__footer_widgets_set_theme_mod'); |
|
1376 | +add_action('customize_save_after', 'lsx_customizer_colour__footer_widgets_set_theme_mod'); |
|
1377 | 1377 | |
1378 | 1378 | /** |
1379 | 1379 | * Enqueues front-end CSS for the footer widgets. |
1380 | 1380 | */ |
1381 | 1381 | function lsx_customizer_colour__footer_widgets_css() { |
1382 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_widgets_theme_mod' ); |
|
1382 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_widgets_theme_mod'); |
|
1383 | 1383 | |
1384 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
1384 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
1385 | 1385 | $theme_mods = lsx_customizer_colour__footer_widgets_get_theme_mods(); |
1386 | - $styles = lsx_customizer_colour__footer_widgets_get_css( $theme_mods ); |
|
1386 | + $styles = lsx_customizer_colour__footer_widgets_get_css($theme_mods); |
|
1387 | 1387 | |
1388 | - if ( false === $styles_from_theme_mod ) { |
|
1389 | - set_theme_mod( 'lsx_customizer_colour__footer_widgets_theme_mod', $styles ); |
|
1388 | + if (false === $styles_from_theme_mod) { |
|
1389 | + set_theme_mod('lsx_customizer_colour__footer_widgets_theme_mod', $styles); |
|
1390 | 1390 | } |
1391 | 1391 | } else { |
1392 | 1392 | $styles = $styles_from_theme_mod; |
1393 | 1393 | } |
1394 | 1394 | |
1395 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
1395 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
1396 | 1396 | } |
1397 | -add_action( 'wp_footer', 'lsx_customizer_colour__footer_widgets_css', 12 ); |
|
1397 | +add_action('wp_footer', 'lsx_customizer_colour__footer_widgets_css', 12); |
|
1398 | 1398 | |
1399 | 1399 | /** |
1400 | 1400 | * Get footer widgets CSS theme mods. |
@@ -1406,32 +1406,32 @@ discard block |
||
1406 | 1406 | $colors = array(); |
1407 | 1407 | $counter = 0; |
1408 | 1408 | |
1409 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
1409 | + foreach ($customizer_colour_names as $key => $value) { |
|
1410 | 1410 | $colors[$key] = $color_scheme[$counter]; |
1411 | 1411 | $counter++; |
1412 | 1412 | } |
1413 | 1413 | |
1414 | 1414 | return array( |
1415 | - 'footer_widgets_background_color' => get_theme_mod( 'footer_widgets_background_color', $colors['footer_widgets_background_color'] ), |
|
1416 | - 'footer_widgets_text_color' => get_theme_mod( 'footer_widgets_text_color', $colors['footer_widgets_text_color'] ), |
|
1417 | - 'footer_widgets_link_color' => get_theme_mod( 'footer_widgets_link_color', $colors['footer_widgets_link_color'] ), |
|
1418 | - 'footer_widgets_link_hover_color' => get_theme_mod( 'footer_widgets_link_hover_color', $colors['footer_widgets_link_hover_color'] ) |
|
1415 | + 'footer_widgets_background_color' => get_theme_mod('footer_widgets_background_color', $colors['footer_widgets_background_color']), |
|
1416 | + 'footer_widgets_text_color' => get_theme_mod('footer_widgets_text_color', $colors['footer_widgets_text_color']), |
|
1417 | + 'footer_widgets_link_color' => get_theme_mod('footer_widgets_link_color', $colors['footer_widgets_link_color']), |
|
1418 | + 'footer_widgets_link_hover_color' => get_theme_mod('footer_widgets_link_hover_color', $colors['footer_widgets_link_hover_color']) |
|
1419 | 1419 | ); |
1420 | 1420 | } |
1421 | 1421 | |
1422 | 1422 | /** |
1423 | 1423 | * Returns CSS for the footer widgets. |
1424 | 1424 | */ |
1425 | -function lsx_customizer_colour__footer_widgets_get_css( $colors ) { |
|
1425 | +function lsx_customizer_colour__footer_widgets_get_css($colors) { |
|
1426 | 1426 | global $customizer_colour_names; |
1427 | 1427 | |
1428 | 1428 | $colors_template = array(); |
1429 | 1429 | |
1430 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
1430 | + foreach ($customizer_colour_names as $key => $value) { |
|
1431 | 1431 | $colors_template[$key] = ''; |
1432 | 1432 | } |
1433 | 1433 | |
1434 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
1434 | + $colors = wp_parse_args($colors, $colors_template); |
|
1435 | 1435 | |
1436 | 1436 | $css = <<<CSS |
1437 | 1437 | /* |
@@ -1470,8 +1470,8 @@ discard block |
||
1470 | 1470 | } |
1471 | 1471 | CSS; |
1472 | 1472 | |
1473 | - $css = apply_filters( 'lsx_customizer_colour_selectors_footer_widgets', $css, $colors ); |
|
1474 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
1473 | + $css = apply_filters('lsx_customizer_colour_selectors_footer_widgets', $css, $colors); |
|
1474 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
1475 | 1475 | return $css; |
1476 | 1476 | } |
1477 | 1477 | |
@@ -1483,33 +1483,33 @@ discard block |
||
1483 | 1483 | */ |
1484 | 1484 | function lsx_customizer_colour__footer_set_theme_mod() { |
1485 | 1485 | $theme_mods = lsx_customizer_colour__footer_get_theme_mods(); |
1486 | - $styles = lsx_customizer_colour__footer_get_css( $theme_mods ); |
|
1486 | + $styles = lsx_customizer_colour__footer_get_css($theme_mods); |
|
1487 | 1487 | |
1488 | - set_theme_mod( 'lsx_customizer_colour__footer_theme_mod', $styles ); |
|
1488 | + set_theme_mod('lsx_customizer_colour__footer_theme_mod', $styles); |
|
1489 | 1489 | } |
1490 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__footer_set_theme_mod' ); |
|
1491 | -add_action( 'customize_save_after', 'lsx_customizer_colour__footer_set_theme_mod' ); |
|
1490 | +add_action('after_switch_theme', 'lsx_customizer_colour__footer_set_theme_mod'); |
|
1491 | +add_action('customize_save_after', 'lsx_customizer_colour__footer_set_theme_mod'); |
|
1492 | 1492 | |
1493 | 1493 | /** |
1494 | 1494 | * Enqueues front-end CSS for the footer. |
1495 | 1495 | */ |
1496 | 1496 | function lsx_customizer_colour__footer_css() { |
1497 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_theme_mod' ); |
|
1497 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_theme_mod'); |
|
1498 | 1498 | |
1499 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
1499 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
1500 | 1500 | $theme_mods = lsx_customizer_colour__footer_get_theme_mods(); |
1501 | - $styles = lsx_customizer_colour__footer_get_css( $theme_mods ); |
|
1501 | + $styles = lsx_customizer_colour__footer_get_css($theme_mods); |
|
1502 | 1502 | |
1503 | - if ( false === $styles_from_theme_mod ) { |
|
1504 | - set_theme_mod( 'lsx_customizer_colour__footer_theme_mod', $styles ); |
|
1503 | + if (false === $styles_from_theme_mod) { |
|
1504 | + set_theme_mod('lsx_customizer_colour__footer_theme_mod', $styles); |
|
1505 | 1505 | } |
1506 | 1506 | } else { |
1507 | 1507 | $styles = $styles_from_theme_mod; |
1508 | 1508 | } |
1509 | 1509 | |
1510 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
1510 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
1511 | 1511 | } |
1512 | -add_action( 'wp_footer', 'lsx_customizer_colour__footer_css', 12 ); |
|
1512 | +add_action('wp_footer', 'lsx_customizer_colour__footer_css', 12); |
|
1513 | 1513 | |
1514 | 1514 | /** |
1515 | 1515 | * Get footer CSS theme mods. |
@@ -1521,32 +1521,32 @@ discard block |
||
1521 | 1521 | $colors = array(); |
1522 | 1522 | $counter = 0; |
1523 | 1523 | |
1524 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
1524 | + foreach ($customizer_colour_names as $key => $value) { |
|
1525 | 1525 | $colors[$key] = $color_scheme[$counter]; |
1526 | 1526 | $counter++; |
1527 | 1527 | } |
1528 | 1528 | |
1529 | 1529 | return array( |
1530 | - 'footer_background_color' => get_theme_mod( 'footer_background_color', $colors['footer_background_color'] ), |
|
1531 | - 'footer_text_color' => get_theme_mod( 'footer_text_color', $colors['footer_text_color'] ), |
|
1532 | - 'footer_link_color' => get_theme_mod( 'footer_link_color', $colors['footer_link_color'] ), |
|
1533 | - 'footer_link_hover_color' => get_theme_mod( 'footer_link_hover_color', $colors['footer_link_hover_color'] ) |
|
1530 | + 'footer_background_color' => get_theme_mod('footer_background_color', $colors['footer_background_color']), |
|
1531 | + 'footer_text_color' => get_theme_mod('footer_text_color', $colors['footer_text_color']), |
|
1532 | + 'footer_link_color' => get_theme_mod('footer_link_color', $colors['footer_link_color']), |
|
1533 | + 'footer_link_hover_color' => get_theme_mod('footer_link_hover_color', $colors['footer_link_hover_color']) |
|
1534 | 1534 | ); |
1535 | 1535 | } |
1536 | 1536 | |
1537 | 1537 | /** |
1538 | 1538 | * Returns CSS for the footer. |
1539 | 1539 | */ |
1540 | -function lsx_customizer_colour__footer_get_css( $colors ) { |
|
1540 | +function lsx_customizer_colour__footer_get_css($colors) { |
|
1541 | 1541 | global $customizer_colour_names; |
1542 | 1542 | |
1543 | 1543 | $colors_template = array(); |
1544 | 1544 | |
1545 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
1545 | + foreach ($customizer_colour_names as $key => $value) { |
|
1546 | 1546 | $colors_template[$key] = ''; |
1547 | 1547 | } |
1548 | 1548 | |
1549 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
1549 | + $colors = wp_parse_args($colors, $colors_template); |
|
1550 | 1550 | |
1551 | 1551 | $css = <<<CSS |
1552 | 1552 | /* |
@@ -1586,8 +1586,8 @@ discard block |
||
1586 | 1586 | } |
1587 | 1587 | CSS; |
1588 | 1588 | |
1589 | - $css = apply_filters( 'lsx_customizer_colour_selectors_footer', $css, $colors ); |
|
1590 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
1589 | + $css = apply_filters('lsx_customizer_colour_selectors_footer', $css, $colors); |
|
1590 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
1591 | 1591 | return $css; |
1592 | 1592 | } |
1593 | 1593 | |
@@ -1599,7 +1599,7 @@ discard block |
||
1599 | 1599 | * Customize Colour Control Class |
1600 | 1600 | */ |
1601 | 1601 | |
1602 | -if ( ! class_exists( 'WP_Customize_Control' ) ) { |
|
1602 | +if ( ! class_exists('WP_Customize_Control')) { |
|
1603 | 1603 | return; |
1604 | 1604 | } |
1605 | 1605 | |
@@ -1609,37 +1609,37 @@ discard block |
||
1609 | 1609 | * Enqueue control related scripts/styles. |
1610 | 1610 | */ |
1611 | 1611 | public function enqueue() { |
1612 | - wp_enqueue_script( 'lsx-colour-control', get_template_directory_uri() .'/js/customizer-colour.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), null, true ); |
|
1613 | - wp_localize_script( 'lsx-colour-control', 'colorScheme', $this->choices ); |
|
1612 | + wp_enqueue_script('lsx-colour-control', get_template_directory_uri() . '/js/customizer-colour.js', array('customize-controls', 'iris', 'underscore', 'wp-util'), null, true); |
|
1613 | + wp_localize_script('lsx-colour-control', 'colorScheme', $this->choices); |
|
1614 | 1614 | |
1615 | 1615 | global $customizer_colour_names; |
1616 | 1616 | $colors = array(); |
1617 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
1617 | + foreach ($customizer_colour_names as $key => $value) { |
|
1618 | 1618 | $colors[] = $key; |
1619 | 1619 | } |
1620 | - wp_localize_script( 'lsx-colour-control', 'colorSchemeKeys', $colors ); |
|
1620 | + wp_localize_script('lsx-colour-control', 'colorSchemeKeys', $colors); |
|
1621 | 1621 | } |
1622 | 1622 | |
1623 | 1623 | /** |
1624 | 1624 | * Render the control's content. |
1625 | 1625 | */ |
1626 | 1626 | public function render_content() { |
1627 | - if ( empty( $this->choices ) ) { |
|
1627 | + if (empty($this->choices)) { |
|
1628 | 1628 | return; |
1629 | 1629 | } |
1630 | 1630 | |
1631 | 1631 | ?> |
1632 | 1632 | <label> |
1633 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
1634 | - <span class="customize-control-title"><?php echo esc_html( $this->label ) ?></span> |
|
1633 | + <?php if ( ! empty($this->label)) { ?> |
|
1634 | + <span class="customize-control-title"><?php echo esc_html($this->label) ?></span> |
|
1635 | 1635 | <?php } |
1636 | - if ( ! empty( $this->description ) ) { ?> |
|
1636 | + if ( ! empty($this->description)) { ?> |
|
1637 | 1637 | <span class="description customize-control-description"><?php echo $this->description ?></span> |
1638 | 1638 | <?php } ?> |
1639 | 1639 | <select <?php $this->link() ?>> |
1640 | 1640 | <?php |
1641 | - foreach ( $this->choices as $value => $label ) { |
|
1642 | - echo '<option value="'. esc_attr( $value ) .'"'. selected( $this->value(), $value, false ) .'>'. $label['label'] .'</option>'; |
|
1641 | + foreach ($this->choices as $value => $label) { |
|
1642 | + echo '<option value="' . esc_attr($value) . '"' . selected($this->value(), $value, false) . '>' . $label['label'] . '</option>'; |
|
1643 | 1643 | } |
1644 | 1644 | ?> |
1645 | 1645 | </select> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Customizer Configuration File |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @author [email protected] <lsdev.biz> |
10 | 10 | * |
11 | 11 | */ |
12 | -if ( ! class_exists( 'LSX_Theme_Customizer' ) ) { |
|
12 | +if ( ! class_exists('LSX_Theme_Customizer')) { |
|
13 | 13 | |
14 | 14 | class LSX_Theme_Customizer { |
15 | 15 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @since 1.0.0 |
31 | 31 | */ |
32 | - public function __construct( $controls ) { |
|
32 | + public function __construct($controls) { |
|
33 | 33 | require get_template_directory() . '/inc/google-font.php'; |
34 | 34 | require get_template_directory() . '/inc/google-font-collection.php'; |
35 | 35 | require get_template_directory() . '/inc/customizer-core.php'; |
@@ -40,19 +40,19 @@ discard block |
||
40 | 40 | |
41 | 41 | $this->controls = $controls; |
42 | 42 | |
43 | - add_action( 'customize_preview_init', array($this,'customize_preview_js' ),20); |
|
44 | - add_action( 'customize_register', array($this,'customizer'), 11 ); |
|
43 | + add_action('customize_preview_init', array($this, 'customize_preview_js'), 20); |
|
44 | + add_action('customize_register', array($this, 'customizer'), 11); |
|
45 | 45 | |
46 | - add_action( 'wp_ajax_customizer_site_title', array($this,'ajax_site_title') ); |
|
47 | - add_action( 'wp_ajax_nopriv_customizer_site_title', array($this,'ajax_site_title') ); |
|
46 | + add_action('wp_ajax_customizer_site_title', array($this, 'ajax_site_title')); |
|
47 | + add_action('wp_ajax_nopriv_customizer_site_title', array($this, 'ajax_site_title')); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | 51 | * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. |
52 | 52 | */ |
53 | 53 | function customize_preview_js() { |
54 | - wp_enqueue_script( 'lsx_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ) , wp_get_theme()->Version, true ); |
|
55 | - wp_localize_script( 'lsx_customizer', 'lsx_customizer_params', array( 'template_directory' => get_template_directory_uri() ) ); |
|
54 | + wp_enqueue_script('lsx_customizer', get_template_directory_uri() . '/js/customizer.js', array('customize-preview'), wp_get_theme()->Version, true); |
|
55 | + wp_localize_script('lsx_customizer', 'lsx_customizer_params', array('template_directory' => get_template_directory_uri())); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -60,40 +60,40 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @since 1.0.0 |
62 | 62 | */ |
63 | - public function customizer( $wp_customize ) { |
|
63 | + public function customizer($wp_customize) { |
|
64 | 64 | // start panels |
65 | - if( !empty( $this->controls['panels'] ) ){ |
|
66 | - foreach( $this->controls['panels'] as $panel_slug => $args ){ |
|
67 | - $this->add_panel( $panel_slug, $args, $wp_customize ); |
|
65 | + if ( ! empty($this->controls['panels'])) { |
|
66 | + foreach ($this->controls['panels'] as $panel_slug => $args) { |
|
67 | + $this->add_panel($panel_slug, $args, $wp_customize); |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | 71 | // start sections |
72 | - if( !empty( $this->controls['sections'] ) ){ |
|
73 | - foreach( $this->controls['sections'] as $section_slug => $args ){ |
|
74 | - $this->add_section( $section_slug, $args, $wp_customize ); |
|
72 | + if ( ! empty($this->controls['sections'])) { |
|
73 | + foreach ($this->controls['sections'] as $section_slug => $args) { |
|
74 | + $this->add_section($section_slug, $args, $wp_customize); |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
78 | 78 | // start settings |
79 | - if( !empty( $this->controls['settings'] ) ){ |
|
80 | - foreach( $this->controls['settings'] as $settings_slug => $args ){ |
|
81 | - $this->add_setting( $settings_slug, $args, $wp_customize ); |
|
79 | + if ( ! empty($this->controls['settings'])) { |
|
80 | + foreach ($this->controls['settings'] as $settings_slug => $args) { |
|
81 | + $this->add_setting($settings_slug, $args, $wp_customize); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
85 | 85 | // start fields |
86 | - if( !empty( $this->controls['fields'] ) ){ |
|
87 | - foreach( $this->controls['fields'] as $field_slug => $args ){ |
|
88 | - $this->add_control( $field_slug, $args, $wp_customize ); |
|
86 | + if ( ! empty($this->controls['fields'])) { |
|
87 | + foreach ($this->controls['fields'] as $field_slug => $args) { |
|
88 | + $this->add_control($field_slug, $args, $wp_customize); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; |
|
93 | - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; |
|
94 | - $wp_customize->get_setting( 'background_color' )->transport = 'postMessage'; |
|
92 | + $wp_customize->get_setting('blogname')->transport = 'postMessage'; |
|
93 | + $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; |
|
94 | + $wp_customize->get_setting('background_color')->transport = 'postMessage'; |
|
95 | 95 | |
96 | - $wp_customize->remove_control( 'background_color' ); |
|
96 | + $wp_customize->remove_control('background_color'); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * |
102 | 102 | * @since 1.0.0 |
103 | 103 | */ |
104 | - private function add_panel( $slug, $args, $wp_customize ) { |
|
104 | + private function add_panel($slug, $args, $wp_customize) { |
|
105 | 105 | $default_args = array( |
106 | 106 | 'title' => null, |
107 | 107 | 'description' => null, |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | $wp_customize->add_panel( |
111 | 111 | $slug, |
112 | - array_merge( $default_args, $args ) |
|
112 | + array_merge($default_args, $args) |
|
113 | 113 | ); |
114 | 114 | } |
115 | 115 | |
@@ -118,14 +118,14 @@ discard block |
||
118 | 118 | * |
119 | 119 | * @since 1.0.0 |
120 | 120 | */ |
121 | - private function add_section( $slug, $args, $wp_customize ) { |
|
121 | + private function add_section($slug, $args, $wp_customize) { |
|
122 | 122 | $default_args = array( |
123 | 123 | 'capability' => 'edit_theme_options', //Capability needed to tweak |
124 | 124 | 'description' => null, //Descriptive tooltip |
125 | 125 | ); |
126 | 126 | |
127 | - $wp_customize->add_section( $slug, |
|
128 | - array_merge( $default_args, $args ) |
|
127 | + $wp_customize->add_section($slug, |
|
128 | + array_merge($default_args, $args) |
|
129 | 129 | ); |
130 | 130 | } |
131 | 131 | |
@@ -134,15 +134,15 @@ discard block |
||
134 | 134 | * |
135 | 135 | * @since 1.0.0 |
136 | 136 | */ |
137 | - private function add_setting( $slug, $args, $wp_customize ) { |
|
138 | - $wp_customize->add_setting( $slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record |
|
139 | - array_merge( array( |
|
137 | + private function add_setting($slug, $args, $wp_customize) { |
|
138 | + $wp_customize->add_setting($slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record |
|
139 | + array_merge(array( |
|
140 | 140 | 'default' => null, //Default setting/value to save |
141 | 141 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
142 | 142 | 'capability' => 'edit_theme_options', //Optional. Special permissions for accessing this setting. |
143 | 143 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
144 | 144 | 'sanitize_callback' => 'lsx_sanitize_choices' |
145 | - ), $args ) |
|
145 | + ), $args) |
|
146 | 146 | ); |
147 | 147 | } |
148 | 148 | |
@@ -151,28 +151,28 @@ discard block |
||
151 | 151 | * |
152 | 152 | * @since 1.0.0 |
153 | 153 | */ |
154 | - private function add_control( $slug, $args, $wp_customize ) { |
|
154 | + private function add_control($slug, $args, $wp_customize) { |
|
155 | 155 | $default_args = array( |
156 | 156 | |
157 | 157 | ); |
158 | 158 | |
159 | - if( isset( $args['control'] ) && class_exists( $args['control'] )){ |
|
159 | + if (isset($args['control']) && class_exists($args['control'])) { |
|
160 | 160 | |
161 | 161 | $control_class = $args['control']; |
162 | - unset( $args['control'] ); |
|
162 | + unset($args['control']); |
|
163 | 163 | |
164 | - $control = new $control_class( $wp_customize, $slug, array_merge( $default_args, $args ) ); |
|
165 | - $wp_customize->add_control( $control ); |
|
164 | + $control = new $control_class($wp_customize, $slug, array_merge($default_args, $args)); |
|
165 | + $wp_customize->add_control($control); |
|
166 | 166 | |
167 | - }else{ |
|
167 | + } else { |
|
168 | 168 | |
169 | - if( isset( $args['control'] ) ){ |
|
170 | - unset( $args['control'] ); |
|
169 | + if (isset($args['control'])) { |
|
170 | + unset($args['control']); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | $wp_customize->add_control( |
174 | 174 | $slug, |
175 | - array_merge( $default_args, $args ) |
|
175 | + array_merge($default_args, $args) |
|
176 | 176 | ); |
177 | 177 | } |
178 | 178 | } |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | */ |
16 | 16 | |
17 | 17 | function lsx_amp_init() { |
18 | - add_post_type_support( 'jetpack-portfolio', AMP_QUERY_VAR ); |
|
19 | - add_post_type_support( 'pages', AMP_QUERY_VAR ); |
|
20 | - add_post_type_support( 'product', AMP_QUERY_VAR ); |
|
18 | + add_post_type_support('jetpack-portfolio', AMP_QUERY_VAR); |
|
19 | + add_post_type_support('pages', AMP_QUERY_VAR); |
|
20 | + add_post_type_support('product', AMP_QUERY_VAR); |
|
21 | 21 | } |
22 | -add_action( 'amp_init', 'lsx_amp_init' ); |
|
22 | +add_action('amp_init', 'lsx_amp_init'); |
|
23 | 23 | |
24 | 24 | |
25 | 25 | /** |
@@ -29,13 +29,13 @@ discard block |
||
29 | 29 | * @subpackage amp |
30 | 30 | * @category template |
31 | 31 | */ |
32 | -function lxs_amp_custom_template( $file, $type, $post ) { |
|
33 | - if ( 'single' === $type) { |
|
34 | - $file = get_template_directory() . '/mobile-templates/single-'.$post->post_type.'.php'; |
|
32 | +function lxs_amp_custom_template($file, $type, $post) { |
|
33 | + if ('single' === $type) { |
|
34 | + $file = get_template_directory() . '/mobile-templates/single-' . $post->post_type . '.php'; |
|
35 | 35 | } |
36 | 36 | return $file; |
37 | 37 | } |
38 | -add_filter( 'amp_post_template_file', 'lxs_amp_custom_template', 10, 3 ); |
|
38 | +add_filter('amp_post_template_file', 'lxs_amp_custom_template', 10, 3); |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * @package YoastSEO_AMP_Glue |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | /** |
55 | 55 | * Defines the YoastSEO AMP class. In a wrapper function so we can overwrite this from within Yoast SEO later on. |
56 | 56 | */ |
57 | -if ( ! class_exists( 'YoastSEO_AMP' ) ) { |
|
57 | +if ( ! class_exists('YoastSEO_AMP')) { |
|
58 | 58 | /** |
59 | 59 | * This class improves upon the AMP output by the default WordPress AMP plugin using Yoast SEO metadata. |
60 | 60 | */ |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | public function __construct() { |
74 | 74 | $this->front = WPSEO_Frontend::get_instance(); |
75 | 75 | $this->options = WPSEO_Options::get_all(); |
76 | - add_filter( 'amp_post_template_data', array( $this, 'fix_amp_post_data' ), 10, 2 ); |
|
77 | - add_filter( 'amp_post_template_metadata', array( $this, 'fix_amp_post_metadata' ), 10, 2 ); |
|
76 | + add_filter('amp_post_template_data', array($this, 'fix_amp_post_data'), 10, 2); |
|
77 | + add_filter('amp_post_template_metadata', array($this, 'fix_amp_post_metadata'), 10, 2); |
|
78 | 78 | } |
79 | 79 | /** |
80 | 80 | * Fix the basic AMP post data |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | * |
85 | 85 | * @return array |
86 | 86 | */ |
87 | - public function fix_amp_post_data( $data, $post ) { |
|
88 | - $data['canonical_url'] = $this->front->canonical( false ); |
|
87 | + public function fix_amp_post_data($data, $post) { |
|
88 | + $data['canonical_url'] = $this->front->canonical(false); |
|
89 | 89 | return $data; |
90 | 90 | } |
91 | 91 | /** |
@@ -96,14 +96,14 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @return array |
98 | 98 | */ |
99 | - public function fix_amp_post_metadata( $metadata, $post ) { |
|
100 | - $this->build_organization_object( $metadata ); |
|
101 | - $desc = $this->front->metadesc( false ); |
|
102 | - if ( $desc ) { |
|
99 | + public function fix_amp_post_metadata($metadata, $post) { |
|
100 | + $this->build_organization_object($metadata); |
|
101 | + $desc = $this->front->metadesc(false); |
|
102 | + if ($desc) { |
|
103 | 103 | $metadata['description'] = $desc; |
104 | 104 | } |
105 | - $og_img = $this->get_image_object( WPSEO_Meta::get_value( 'opengraph-image', $post->ID ) ); |
|
106 | - if ( is_array( $og_img ) ) { |
|
105 | + $og_img = $this->get_image_object(WPSEO_Meta::get_value('opengraph-image', $post->ID)); |
|
106 | + if (is_array($og_img)) { |
|
107 | 107 | $metadata['image'] = $og_img; |
108 | 108 | } |
109 | 109 | return $metadata; |
@@ -113,14 +113,14 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @param array $metadata |
115 | 115 | */ |
116 | - private function build_organization_object( &$metadata ) { |
|
116 | + private function build_organization_object(&$metadata) { |
|
117 | 117 | // While it's using the blog name, it's actually outputting the company name |
118 | - if ( ! empty( $this->options['company_name'] ) ) { |
|
118 | + if ( ! empty($this->options['company_name'])) { |
|
119 | 119 | $metadata['publisher']['name'] = $this->options['company_name']; |
120 | 120 | } |
121 | 121 | // The logo needs to be 600px wide max, 60px high max |
122 | - $logo = $this->get_image_object( $this->options['company_logo'], array( 600, 60 ) ); |
|
123 | - if ( is_array( $logo ) ) { |
|
122 | + $logo = $this->get_image_object($this->options['company_logo'], array(600, 60)); |
|
123 | + if (is_array($logo)) { |
|
124 | 124 | $metadata['publisher']['logo'] = $logo; |
125 | 125 | } |
126 | 126 | } |
@@ -133,13 +133,13 @@ discard block |
||
133 | 133 | * |
134 | 134 | * @return bool|array |
135 | 135 | */ |
136 | - private function get_image_object( $image_url, $size = 'full' ) { |
|
137 | - if ( empty( $image_url ) ) { |
|
136 | + private function get_image_object($image_url, $size = 'full') { |
|
137 | + if (empty($image_url)) { |
|
138 | 138 | return false; |
139 | 139 | } |
140 | - $image_id = attachment_url_to_postid( $image_url ); |
|
141 | - $image_src = wp_get_attachment_image_src( $image_id, $size ); |
|
142 | - if ( is_array( $image_src ) ) { |
|
140 | + $image_id = attachment_url_to_postid($image_url); |
|
141 | + $image_src = wp_get_attachment_image_src($image_id, $size); |
|
142 | + if (is_array($image_src)) { |
|
143 | 143 | return array( |
144 | 144 | '@type' => 'ImageObject', |
145 | 145 | 'url' => $image_src[0], |
@@ -155,11 +155,11 @@ discard block |
||
155 | 155 | * Initialize the Yoast SEO AMP Glue plugin |
156 | 156 | */ |
157 | 157 | function lsx_yoast_seo_amp_glue_init() { |
158 | - if ( class_exists( 'WPSEO_Frontend' ) ) { |
|
158 | + if (class_exists('WPSEO_Frontend')) { |
|
159 | 159 | new YoastSEO_AMP(); |
160 | 160 | } |
161 | 161 | } |
162 | -add_action( 'init', 'lsx_yoast_seo_amp_glue_init', 12 ); |
|
162 | +add_action('init', 'lsx_yoast_seo_amp_glue_init', 12); |
|
163 | 163 | |
164 | 164 | /** |
165 | 165 | * Load custom CSS |
@@ -169,4 +169,4 @@ discard block |
||
169 | 169 | <link href="<?php echo get_stylesheet_directory_uri(); ?>/css/amp.css" rel="stylesheet" type="text/css"> |
170 | 170 | <?php |
171 | 171 | } |
172 | -add_action( 'amp_post_template_head', 'lsx_add_amp_css'); |
|
173 | 172 | \ No newline at end of file |
173 | +add_action('amp_post_template_head', 'lsx_add_amp_css'); |
|
174 | 174 | \ No newline at end of file |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | /* |
10 | 10 | * Hooks |
11 | 11 | */ |
12 | -remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); |
|
13 | -remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); |
|
12 | +remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); |
|
13 | +remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); |
|
14 | 14 | |
15 | 15 | add_action('woocommerce_before_main_content', 'lsx_woocommerce_before_content', 10); |
16 | 16 | add_action('woocommerce_after_main_content', 'lsx_woocommerce_after_content', 10); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @subpackage woocommerce |
26 | 26 | * @category layout |
27 | 27 | */ |
28 | -function lsx_woocommerce_before_content(){ ?> |
|
28 | +function lsx_woocommerce_before_content() { ?> |
|
29 | 29 | <?php lsx_content_wrap_before(); ?> |
30 | 30 | |
31 | 31 | <div id="primary" class="content-area <?php echo lsx_main_class(); ?>"> |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @subpackage woocommerce |
44 | 44 | * @category layout |
45 | 45 | */ |
46 | -function lsx_woocommerce_after_content(){ ?> |
|
46 | +function lsx_woocommerce_after_content() { ?> |
|
47 | 47 | <?php lsx_content_bottom(); ?> |
48 | 48 | |
49 | 49 | </main><!-- #main --> |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | * @subpackage woocommerce |
67 | 67 | * @category styles |
68 | 68 | */ |
69 | -add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); |
|
69 | +add_filter('woocommerce_enqueue_styles', '__return_empty_array'); |
|
70 | 70 | |
71 | 71 | function lsx_woocommerce_styles() { |
72 | - wp_enqueue_style( 'woocommerce', get_template_directory_uri() . '/css/woocommerce.css' ); |
|
72 | + wp_enqueue_style('woocommerce', get_template_directory_uri() . '/css/woocommerce.css'); |
|
73 | 73 | } |
74 | -add_action( 'wp_enqueue_scripts', 'lsx_woocommerce_styles' ); |
|
75 | 74 | \ No newline at end of file |
75 | +add_action('wp_enqueue_scripts', 'lsx_woocommerce_styles'); |
|
76 | 76 | \ No newline at end of file |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | function lsx_events_styles() { |
21 | - wp_enqueue_style( 'events', get_template_directory_uri() . '/css/the-events-calendar.css' ); |
|
21 | + wp_enqueue_style('events', get_template_directory_uri() . '/css/the-events-calendar.css'); |
|
22 | 22 | } |
23 | -add_action( 'wp_enqueue_scripts', 'lsx_events_styles' ); |
|
23 | +add_action('wp_enqueue_scripts', 'lsx_events_styles'); |
|
24 | 24 | |
25 | 25 | |
26 | 26 | /** |
@@ -32,41 +32,41 @@ discard block |
||
32 | 32 | |
33 | 33 | function lsx_tribe_breadcrumbs($output) { |
34 | 34 | global $wp_query; |
35 | - if( (isset($wp_query->tribe_is_event) && true === $wp_query->tribe_is_event) || (isset($wp_query->query_vars['post_type']) && !is_array($wp_query->query_vars['post_type']) && 'tribe_venue' === $wp_query->query_vars['post_type'])){ |
|
36 | - if(function_exists('woocommerce_breadcrumb')){ |
|
35 | + if ((isset($wp_query->tribe_is_event) && true === $wp_query->tribe_is_event) || (isset($wp_query->query_vars['post_type']) && ! is_array($wp_query->query_vars['post_type']) && 'tribe_venue' === $wp_query->query_vars['post_type'])) { |
|
36 | + if (function_exists('woocommerce_breadcrumb')) { |
|
37 | 37 | $closing_div = '</nav>'; |
38 | 38 | |
39 | - if( is_single()) { |
|
40 | - $output = str_replace('Page','<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>',$output); |
|
41 | - if(isset($wp_query->query_vars['eventDisplay']) && 'all' === $wp_query->query_vars['eventDisplay']){ |
|
42 | - $output = str_replace($closing_div,get_the_title($wp_query->query_vars['post_parent']).$closing_div,$output); |
|
43 | - }else{ |
|
39 | + if (is_single()) { |
|
40 | + $output = str_replace('Page', '<a href="' . get_post_type_archive_link('tribe_events') . '">' . __('Events', 'lsx') . '</a>', $output); |
|
41 | + if (isset($wp_query->query_vars['eventDisplay']) && 'all' === $wp_query->query_vars['eventDisplay']) { |
|
42 | + $output = str_replace($closing_div, get_the_title($wp_query->query_vars['post_parent']) . $closing_div, $output); |
|
43 | + } else { |
|
44 | 44 | $single_event = get_queried_object(); |
45 | - $output = str_replace($closing_div,apply_filters('the_title',$single_event->post_title).$closing_div,$output); |
|
45 | + $output = str_replace($closing_div, apply_filters('the_title', $single_event->post_title) . $closing_div, $output); |
|
46 | 46 | } |
47 | - }elseif( is_tax()) { |
|
47 | + }elseif (is_tax()) { |
|
48 | 48 | $tax_event = get_queried_object(); |
49 | - $output = str_replace('Page','<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a>',$output); |
|
50 | - $output = str_replace($closing_div,' / '.apply_filters('the_title',$tax_event->name).$closing_div,$output); |
|
51 | - }else{ |
|
52 | - $output = str_replace('Page',__('Events','lsx'),$output); |
|
49 | + $output = str_replace('Page', '<a href="' . get_post_type_archive_link('tribe_events') . '">' . __('Events', 'lsx') . '</a>', $output); |
|
50 | + $output = str_replace($closing_div, ' / ' . apply_filters('the_title', $tax_event->name) . $closing_div, $output); |
|
51 | + } else { |
|
52 | + $output = str_replace('Page', __('Events', 'lsx'), $output); |
|
53 | 53 | } |
54 | - }elseif(function_exists('yoast_breadcrumb')){ |
|
54 | + }elseif (function_exists('yoast_breadcrumb')) { |
|
55 | 55 | $closing_div = '</div>'; |
56 | - $last_breadcrumb = '<span class="breadcrumb_last">'.__('Events','lsx').'</span>'; |
|
56 | + $last_breadcrumb = '<span class="breadcrumb_last">' . __('Events', 'lsx') . '</span>'; |
|
57 | 57 | |
58 | - if( is_single()) { |
|
58 | + if (is_single()) { |
|
59 | 59 | $single_event = get_queried_object(); |
60 | - $output = str_replace($closing_div,'<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a> / '.apply_filters('the_title',$single_event->post_title),$output); |
|
61 | - }elseif( is_tax()) { |
|
60 | + $output = str_replace($closing_div, '<a href="' . get_post_type_archive_link('tribe_events') . '">' . __('Events', 'lsx') . '</a> / ' . apply_filters('the_title', $single_event->post_title), $output); |
|
61 | + }elseif (is_tax()) { |
|
62 | 62 | $tax_event = get_queried_object(); |
63 | - $output = str_replace($last_breadcrumb,'<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.__('Events','lsx').'</a> / '.apply_filters('the_title',$tax_event->name),$output); |
|
63 | + $output = str_replace($last_breadcrumb, '<a href="' . get_post_type_archive_link('tribe_events') . '">' . __('Events', 'lsx') . '</a> / ' . apply_filters('the_title', $tax_event->name), $output); |
|
64 | 64 | |
65 | - }else{ |
|
66 | - $output = str_replace('Page',__('Events','lsx'),$output); |
|
65 | + } else { |
|
66 | + $output = str_replace('Page', __('Events', 'lsx'), $output); |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | } |
70 | 70 | return $output; |
71 | 71 | } |
72 | -add_filter( 'lsx_breadcrumbs', 'lsx_tribe_breadcrumbs',1,10 ); |
|
73 | 72 | \ No newline at end of file |
73 | +add_filter('lsx_breadcrumbs', 'lsx_tribe_breadcrumbs', 1, 10); |
|
74 | 74 | \ No newline at end of file |
@@ -1,66 +1,66 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | global $customizer_colour_names; |
5 | 5 | global $customizer_colour_choices; |
6 | 6 | |
7 | -$customizer_colour_names = apply_filters( 'lsx_customizer_colour_names', array( |
|
8 | - 'button_background_color' => esc_html__( 'BUTTON: Background', 'lsx' ), |
|
9 | - 'button_background_hover_color' => esc_html__( 'BUTTON: Background (hover)', 'lsx' ), |
|
10 | - 'button_text_color' => esc_html__( 'BUTTON: Text', 'lsx' ), |
|
11 | - 'button_text_color_hover' => esc_html__( 'BUTTON: Text (hover)', 'lsx' ), |
|
7 | +$customizer_colour_names = apply_filters('lsx_customizer_colour_names', array( |
|
8 | + 'button_background_color' => esc_html__('BUTTON: Background', 'lsx'), |
|
9 | + 'button_background_hover_color' => esc_html__('BUTTON: Background (hover)', 'lsx'), |
|
10 | + 'button_text_color' => esc_html__('BUTTON: Text', 'lsx'), |
|
11 | + 'button_text_color_hover' => esc_html__('BUTTON: Text (hover)', 'lsx'), |
|
12 | 12 | |
13 | - 'button_cta_background_color' => esc_html__( 'BUTTON CTA: Background', 'lsx' ), |
|
14 | - 'button_cta_background_hover_color' => esc_html__( 'BUTTON CTA: Background (hover)', 'lsx' ), |
|
15 | - 'button_cta_text_color' => esc_html__( 'BUTTON CTA: Text', 'lsx' ), |
|
16 | - 'button_cta_text_color_hover' => esc_html__( 'BUTTON CTA: Text (hover)', 'lsx' ), |
|
13 | + 'button_cta_background_color' => esc_html__('BUTTON CTA: Background', 'lsx'), |
|
14 | + 'button_cta_background_hover_color' => esc_html__('BUTTON CTA: Background (hover)', 'lsx'), |
|
15 | + 'button_cta_text_color' => esc_html__('BUTTON CTA: Text', 'lsx'), |
|
16 | + 'button_cta_text_color_hover' => esc_html__('BUTTON CTA: Text (hover)', 'lsx'), |
|
17 | 17 | |
18 | - 'top_menu_background_color' => esc_html__( 'TOP MENU: Background', 'lsx' ), |
|
19 | - 'top_menu_text_color' => esc_html__( 'TOP MENU: Text', 'lsx' ), |
|
20 | - 'top_menu_text_hover_color' => esc_html__( 'TOP MENU: Text (hover)', 'lsx' ), |
|
18 | + 'top_menu_background_color' => esc_html__('TOP MENU: Background', 'lsx'), |
|
19 | + 'top_menu_text_color' => esc_html__('TOP MENU: Text', 'lsx'), |
|
20 | + 'top_menu_text_hover_color' => esc_html__('TOP MENU: Text (hover)', 'lsx'), |
|
21 | 21 | |
22 | - 'header_background_color' => esc_html__( 'HEADER: Background', 'lsx' ), |
|
23 | - 'header_title_color' => esc_html__( 'HEADER: Title', 'lsx' ), |
|
24 | - 'header_title_hover_color' => esc_html__( 'HEADER: Title (hover)', 'lsx' ), |
|
25 | - 'header_description_color' => esc_html__( 'HEADER: Description', 'lsx' ), |
|
22 | + 'header_background_color' => esc_html__('HEADER: Background', 'lsx'), |
|
23 | + 'header_title_color' => esc_html__('HEADER: Title', 'lsx'), |
|
24 | + 'header_title_hover_color' => esc_html__('HEADER: Title (hover)', 'lsx'), |
|
25 | + 'header_description_color' => esc_html__('HEADER: Description', 'lsx'), |
|
26 | 26 | |
27 | - 'main_menu_background_hover1_color' => esc_html__( 'MENU: Background (L1 hover)', 'lsx' ), |
|
28 | - 'main_menu_background_hover2_color' => esc_html__( 'MENU: Background (L2 hover)', 'lsx' ), |
|
29 | - 'main_menu_text_color' => esc_html__( 'MENU: Text (L1)', 'lsx' ), |
|
30 | - 'main_menu_text_hover1_color' => esc_html__( 'MENU: Text (L1 hover)', 'lsx' ), |
|
31 | - 'main_menu_text_hover2_color' => esc_html__( 'MENU: Text (L2 hover)', 'lsx' ), |
|
27 | + 'main_menu_background_hover1_color' => esc_html__('MENU: Background (L1 hover)', 'lsx'), |
|
28 | + 'main_menu_background_hover2_color' => esc_html__('MENU: Background (L2 hover)', 'lsx'), |
|
29 | + 'main_menu_text_color' => esc_html__('MENU: Text (L1)', 'lsx'), |
|
30 | + 'main_menu_text_hover1_color' => esc_html__('MENU: Text (L1 hover)', 'lsx'), |
|
31 | + 'main_menu_text_hover2_color' => esc_html__('MENU: Text (L2 hover)', 'lsx'), |
|
32 | 32 | |
33 | - 'banner_background_color' => esc_html__( 'BANNER: Background', 'lsx' ), |
|
34 | - 'banner_text_color' => esc_html__( 'BANNER: Text', 'lsx' ), |
|
35 | - 'banner_text_image_color' => esc_html__( 'BANNER: Text (over image)', 'lsx' ), |
|
33 | + 'banner_background_color' => esc_html__('BANNER: Background', 'lsx'), |
|
34 | + 'banner_text_color' => esc_html__('BANNER: Text', 'lsx'), |
|
35 | + 'banner_text_image_color' => esc_html__('BANNER: Text (over image)', 'lsx'), |
|
36 | 36 | |
37 | - 'body_background_color' => esc_html__( 'BODY: Background', 'lsx' ), |
|
38 | - 'body_line_color' => esc_html__( 'BODY: Line', 'lsx' ), |
|
39 | - 'body_text_heading_color' => esc_html__( 'BODY: Text (heading)', 'lsx' ), |
|
40 | - 'body_text_color' => esc_html__( 'BODY: Text', 'lsx' ), |
|
41 | - 'body_link_color' => esc_html__( 'BODY: Link', 'lsx' ), |
|
42 | - 'body_link_hover_color' => esc_html__( 'BODY: Link (hover)', 'lsx' ), |
|
37 | + 'body_background_color' => esc_html__('BODY: Background', 'lsx'), |
|
38 | + 'body_line_color' => esc_html__('BODY: Line', 'lsx'), |
|
39 | + 'body_text_heading_color' => esc_html__('BODY: Text (heading)', 'lsx'), |
|
40 | + 'body_text_color' => esc_html__('BODY: Text', 'lsx'), |
|
41 | + 'body_link_color' => esc_html__('BODY: Link', 'lsx'), |
|
42 | + 'body_link_hover_color' => esc_html__('BODY: Link (hover)', 'lsx'), |
|
43 | 43 | |
44 | - 'footer_cta_background_color' => esc_html__( 'FOOTER CTA: Background', 'lsx' ), |
|
45 | - 'footer_cta_text_color' => esc_html__( 'FOOTER CTA: Text', 'lsx' ), |
|
46 | - 'footer_cta_link_color' => esc_html__( 'FOOTER CTA: Link', 'lsx' ), |
|
47 | - 'footer_cta_link_hover_color' => esc_html__( 'FOOTER CTA: Link (hover)', 'lsx' ), |
|
44 | + 'footer_cta_background_color' => esc_html__('FOOTER CTA: Background', 'lsx'), |
|
45 | + 'footer_cta_text_color' => esc_html__('FOOTER CTA: Text', 'lsx'), |
|
46 | + 'footer_cta_link_color' => esc_html__('FOOTER CTA: Link', 'lsx'), |
|
47 | + 'footer_cta_link_hover_color' => esc_html__('FOOTER CTA: Link (hover)', 'lsx'), |
|
48 | 48 | |
49 | - 'footer_widgets_background_color' => esc_html__( 'FOOTER WIDGETS: Background', 'lsx' ), |
|
50 | - 'footer_widgets_text_color' => esc_html__( 'FOOTER WIDGETS: Text', 'lsx' ), |
|
51 | - 'footer_widgets_link_color' => esc_html__( 'FOOTER WIDGETS: Link', 'lsx' ), |
|
52 | - 'footer_widgets_link_hover_color' => esc_html__( 'FOOTER WIDGETS: Link (hover)', 'lsx' ), |
|
49 | + 'footer_widgets_background_color' => esc_html__('FOOTER WIDGETS: Background', 'lsx'), |
|
50 | + 'footer_widgets_text_color' => esc_html__('FOOTER WIDGETS: Text', 'lsx'), |
|
51 | + 'footer_widgets_link_color' => esc_html__('FOOTER WIDGETS: Link', 'lsx'), |
|
52 | + 'footer_widgets_link_hover_color' => esc_html__('FOOTER WIDGETS: Link (hover)', 'lsx'), |
|
53 | 53 | |
54 | - 'footer_background_color' => esc_html__( 'FOOTER: Background', 'lsx' ), |
|
55 | - 'footer_text_color' => esc_html__( 'FOOTER: Text', 'lsx' ), |
|
56 | - 'footer_link_color' => esc_html__( 'FOOTER: Link', 'lsx' ), |
|
57 | - 'footer_link_hover_color' => esc_html__( 'FOOTER: Link (hover)', 'lsx' ) |
|
58 | -) ); |
|
54 | + 'footer_background_color' => esc_html__('FOOTER: Background', 'lsx'), |
|
55 | + 'footer_text_color' => esc_html__('FOOTER: Text', 'lsx'), |
|
56 | + 'footer_link_color' => esc_html__('FOOTER: Link', 'lsx'), |
|
57 | + 'footer_link_hover_color' => esc_html__('FOOTER: Link (hover)', 'lsx') |
|
58 | +)); |
|
59 | 59 | |
60 | -$customizer_colour_choices = apply_filters( 'lsx_customizer_colour_choices', array( |
|
60 | +$customizer_colour_choices = apply_filters('lsx_customizer_colour_choices', array( |
|
61 | 61 | 'default' => array( |
62 | - 'label' => __( 'Default', 'lsx' ), |
|
63 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_default', array( |
|
62 | + 'label' => __('Default', 'lsx'), |
|
63 | + 'colors' => apply_filters('lsx_customizer_colour_choices_default', array( |
|
64 | 64 | // Button |
65 | 65 | '#428bca', '#2a6496', '#ffffff', '#ffffff', |
66 | 66 | // Button CTA |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | '#333333', '#eeeeee', '#dddddd', '#cccccc', |
82 | 82 | // Footer |
83 | 83 | '#232222', '#ffffff', '#337ab7', '#969696' |
84 | - ) ) |
|
84 | + )) |
|
85 | 85 | ), |
86 | 86 | 'red' => array( |
87 | - 'label' => __( 'Red', 'lsx' ), |
|
88 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_red', array( |
|
87 | + 'label' => __('Red', 'lsx'), |
|
88 | + 'colors' => apply_filters('lsx_customizer_colour_choices_red', array( |
|
89 | 89 | // Button |
90 | 90 | '#b64d3f', '#87291c', '#ffffff', '#ffffff', |
91 | 91 | // Button CTA |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | '#333333', '#eeeeee', '#dddddd', '#cccccc', |
107 | 107 | // Footer |
108 | 108 | '#232222', '#ffffff', '#b64d3f', '#969696' |
109 | - ) ) |
|
109 | + )) |
|
110 | 110 | ), |
111 | 111 | 'orange' => array( |
112 | - 'label' => __( 'Orange', 'lsx' ), |
|
113 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_orange', array( |
|
112 | + 'label' => __('Orange', 'lsx'), |
|
113 | + 'colors' => apply_filters('lsx_customizer_colour_choices_orange', array( |
|
114 | 114 | // Button |
115 | 115 | '#fbaf3f', '#e49435', '#260e03', '#260e03', |
116 | 116 | // Button CTA |
@@ -131,11 +131,11 @@ discard block |
||
131 | 131 | '#333333', '#eeeeee', '#dddddd', '#cccccc', |
132 | 132 | // Footer |
133 | 133 | '#232222', '#ffffff', '#e4701e', '#969696' |
134 | - ) ) |
|
134 | + )) |
|
135 | 135 | ), |
136 | 136 | 'green' => array( |
137 | - 'label' => __( 'Green', 'lsx' ), |
|
138 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_green', array( |
|
137 | + 'label' => __('Green', 'lsx'), |
|
138 | + 'colors' => apply_filters('lsx_customizer_colour_choices_green', array( |
|
139 | 139 | // Button |
140 | 140 | '#596b46', '#3d4a30', '#ffffff', '#ffffff', |
141 | 141 | // Button CTA |
@@ -156,11 +156,11 @@ discard block |
||
156 | 156 | '#333333', '#eeeeee', '#dddddd', '#cccccc', |
157 | 157 | // Footer |
158 | 158 | '#232222', '#ffffff', '#596b46', '#969696' |
159 | - ) ) |
|
159 | + )) |
|
160 | 160 | ), |
161 | 161 | 'brown' => array( |
162 | - 'label' => __( 'Brown', 'lsx' ), |
|
163 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_brown', array( |
|
162 | + 'label' => __('Brown', 'lsx'), |
|
163 | + 'colors' => apply_filters('lsx_customizer_colour_choices_brown', array( |
|
164 | 164 | // Button |
165 | 165 | '#8c6a45', '#5b452e', '#ffffff', '#ffffff', |
166 | 166 | // Button CTA |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | '#333333', '#eeeeee', '#dddddd', '#cccccc', |
182 | 182 | // Footer |
183 | 183 | '#232222', '#ffffff', '#8c6a45', '#969696' |
184 | - ) ) |
|
184 | + )) |
|
185 | 185 | ) |
186 | -) ); |
|
186 | +)); |
|
187 | 187 | |
188 | 188 | ?> |
189 | 189 | \ No newline at end of file |