@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Constructor |
15 | - **/ |
|
15 | + **/ |
|
16 | 16 | public function __construct($title, $location, $cssDeclaration, $cssClass) |
17 | 17 | { |
18 | 18 | $this->title = $title; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * Getters |
26 | 26 | * taken from: http://stackoverflow.com/questions/4478661/getter-and-setter |
27 | - **/ |
|
27 | + **/ |
|
28 | 28 | public function __get($property) |
29 | 29 | { |
30 | 30 | if (property_exists($this, $property)) { |
@@ -1,5 +1,5 @@ |
||
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 Class |
5 | 5 | **/ |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | * $lsx_supports[] = 'body'; |
25 | 25 | */ |
26 | 26 | function lsx_body_top() { |
27 | - do_action( 'lsx_body_top' ); |
|
27 | + do_action('lsx_body_top'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | function lsx_body_bottom() { |
31 | - do_action( 'lsx_body_bottom' ); |
|
31 | + do_action('lsx_body_bottom'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | * $lsx_supports[] = 'head'; |
38 | 38 | */ |
39 | 39 | function lsx_head_top() { |
40 | - do_action( 'lsx_head_top' ); |
|
40 | + do_action('lsx_head_top'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | function lsx_head_bottom() { |
44 | - do_action( 'lsx_head_bottom' ); |
|
44 | + do_action('lsx_head_bottom'); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -50,27 +50,27 @@ discard block |
||
50 | 50 | * $lsx_supports[] = 'header'; |
51 | 51 | */ |
52 | 52 | function lsx_header_before() { |
53 | - do_action( 'lsx_header_before' ); |
|
53 | + do_action('lsx_header_before'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | function lsx_header_after() { |
57 | - do_action( 'lsx_header_after' ); |
|
57 | + do_action('lsx_header_after'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | function lsx_header_top() { |
61 | - do_action( 'lsx_header_top' ); |
|
61 | + do_action('lsx_header_top'); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | function lsx_header_bottom() { |
65 | - do_action( 'lsx_header_bottom' ); |
|
65 | + do_action('lsx_header_bottom'); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | function lsx_nav_before() { |
69 | - do_action( 'lsx_nav_before' ); |
|
69 | + do_action('lsx_nav_before'); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | function lsx_nav_after() { |
73 | - do_action( 'lsx_nav_after' ); |
|
73 | + do_action('lsx_nav_after'); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | |
82 | 82 | function lsx_banner_content() { |
83 | - do_action( 'lsx_banner_content' ); |
|
83 | + do_action('lsx_banner_content'); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -89,27 +89,27 @@ discard block |
||
89 | 89 | * $lsx_supports[] = 'content'; |
90 | 90 | */ |
91 | 91 | function lsx_content_wrap_before() { |
92 | - do_action( 'lsx_content_wrap_before' ); |
|
92 | + do_action('lsx_content_wrap_before'); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | function lsx_content_wrap_after() { |
96 | - do_action( 'lsx_content_wrap_after' ); |
|
96 | + do_action('lsx_content_wrap_after'); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | function lsx_content_before() { |
100 | - do_action( 'lsx_content_before' ); |
|
100 | + do_action('lsx_content_before'); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | function lsx_content_after() { |
104 | - do_action( 'lsx_content_after' ); |
|
104 | + do_action('lsx_content_after'); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | function lsx_content_top() { |
108 | - do_action( 'lsx_content_top' ); |
|
108 | + do_action('lsx_content_top'); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | function lsx_content_bottom() { |
112 | - do_action( 'lsx_content_bottom' ); |
|
112 | + do_action('lsx_content_bottom'); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -118,19 +118,19 @@ discard block |
||
118 | 118 | * $lsx_supports[] = 'entry'; |
119 | 119 | */ |
120 | 120 | function lsx_entry_before() { |
121 | - do_action( 'lsx_entry_before' ); |
|
121 | + do_action('lsx_entry_before'); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | function lsx_entry_after() { |
125 | - do_action( 'lsx_entry_after' ); |
|
125 | + do_action('lsx_entry_after'); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | function lsx_entry_top() { |
129 | - do_action( 'lsx_entry_top' ); |
|
129 | + do_action('lsx_entry_top'); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | function lsx_entry_bottom() { |
133 | - do_action( 'lsx_entry_bottom' ); |
|
133 | + do_action('lsx_entry_bottom'); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | * $lsx_supports[] = 'comments'; |
140 | 140 | */ |
141 | 141 | function lsx_comments_before() { |
142 | - do_action( 'lsx_comments_before' ); |
|
142 | + do_action('lsx_comments_before'); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | function lsx_comments_after() { |
146 | - do_action( 'lsx_comments_after' ); |
|
146 | + do_action('lsx_comments_after'); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -152,19 +152,19 @@ discard block |
||
152 | 152 | * $lsx_supports[] = 'sidebar'; |
153 | 153 | */ |
154 | 154 | function lsx_sidebars_before() { |
155 | - do_action( 'lsx_sidebars_before' ); |
|
155 | + do_action('lsx_sidebars_before'); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | function lsx_sidebars_after() { |
159 | - do_action( 'lsx_sidebars_after' ); |
|
159 | + do_action('lsx_sidebars_after'); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | function lsx_sidebar_top() { |
163 | - do_action( 'lsx_sidebar_top' ); |
|
163 | + do_action('lsx_sidebar_top'); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | function lsx_sidebar_bottom() { |
167 | - do_action( 'lsx_sidebar_bottom' ); |
|
167 | + do_action('lsx_sidebar_bottom'); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -173,17 +173,17 @@ discard block |
||
173 | 173 | * $lsx_supports[] = 'footer'; |
174 | 174 | */ |
175 | 175 | function lsx_footer_before() { |
176 | - do_action( 'lsx_footer_before' ); |
|
176 | + do_action('lsx_footer_before'); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | function lsx_footer_after() { |
180 | - do_action( 'lsx_footer_after' ); |
|
180 | + do_action('lsx_footer_after'); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | function lsx_footer_top() { |
184 | - do_action( 'lsx_footer_top' ); |
|
184 | + do_action('lsx_footer_top'); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | function lsx_footer_bottom() { |
188 | - do_action( 'lsx_footer_bottom' ); |
|
188 | + do_action('lsx_footer_bottom'); |
|
189 | 189 | } |
190 | 190 | \ No newline at end of file |
@@ -14,27 +14,27 @@ discard block |
||
14 | 14 | */ |
15 | 15 | class LSX_Walker_Comment extends Walker_Comment { |
16 | 16 | function start_lvl(&$output, $depth = 0, $args = array()) { |
17 | - $GLOBALS['comment_depth'] = $depth + 1; ?> |
|
17 | + $GLOBALS['comment_depth'] = $depth + 1; ?> |
|
18 | 18 | <ul <?php comment_class('media unstyled comment-' . get_comment_ID()); ?>> |
19 | 19 | <?php |
20 | 20 | } |
21 | 21 | |
22 | 22 | function end_lvl(&$output, $depth = 0, $args = array()) { |
23 | - $GLOBALS['comment_depth'] = $depth + 1; |
|
24 | - echo '</ul>'; |
|
23 | + $GLOBALS['comment_depth'] = $depth + 1; |
|
24 | + echo '</ul>'; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | function start_el(&$output, $comment, $depth = 0, $args = array(), $id = 0) { |
28 | - $depth++; |
|
29 | - $GLOBALS['comment_depth'] = $depth; |
|
30 | - $GLOBALS['comment'] = $comment; |
|
28 | + $depth++; |
|
29 | + $GLOBALS['comment_depth'] = $depth; |
|
30 | + $GLOBALS['comment'] = $comment; |
|
31 | 31 | |
32 | - if (!empty($args['callback'])) { |
|
33 | - call_user_func($args['callback'], $comment, $args, $depth); |
|
34 | - return; |
|
35 | - } |
|
32 | + if (!empty($args['callback'])) { |
|
33 | + call_user_func($args['callback'], $comment, $args, $depth); |
|
34 | + return; |
|
35 | + } |
|
36 | 36 | |
37 | - extract($args, EXTR_SKIP);?> |
|
37 | + extract($args, EXTR_SKIP);?> |
|
38 | 38 | |
39 | 39 | <li id="comment-<?php comment_ID(); ?>" <?php comment_class('media comment-' . get_comment_ID()); ?>> |
40 | 40 | <?php get_template_part('comment'); ?> |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | function end_el(&$output, $comment, $depth = 0, $args = array()) { |
45 | - if (!empty($args['end-callback'])) { |
|
46 | - call_user_func($args['end-callback'], $comment, $args, $depth); |
|
47 | - return; |
|
48 | - } |
|
49 | - echo "</div></li>\n"; |
|
45 | + if (!empty($args['end-callback'])) { |
|
46 | + call_user_func($args['end-callback'], $comment, $args, $depth); |
|
47 | + return; |
|
48 | + } |
|
49 | + echo "</div></li>\n"; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | } |
@@ -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 | * lsx Comment Walker |
@@ -29,12 +29,12 @@ discard block |
||
29 | 29 | $GLOBALS['comment_depth'] = $depth; |
30 | 30 | $GLOBALS['comment'] = $comment; |
31 | 31 | |
32 | - if (!empty($args['callback'])) { |
|
32 | + if ( ! empty($args['callback'])) { |
|
33 | 33 | call_user_func($args['callback'], $comment, $args, $depth); |
34 | 34 | return; |
35 | 35 | } |
36 | 36 | |
37 | - extract($args, EXTR_SKIP);?> |
|
37 | + extract($args, EXTR_SKIP); ?> |
|
38 | 38 | |
39 | 39 | <li id="comment-<?php comment_ID(); ?>" <?php comment_class('media comment-' . get_comment_ID()); ?>> |
40 | 40 | <?php get_template_part('comment'); ?> |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | function end_el(&$output, $comment, $depth = 0, $args = array()) { |
45 | - if (!empty($args['end-callback'])) { |
|
45 | + if ( ! empty($args['end-callback'])) { |
|
46 | 46 | call_user_func($args['end-callback'], $comment, $args, $depth); |
47 | 47 | return; |
48 | 48 | } |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | * @subpackage layout |
65 | 65 | */ |
66 | 66 | function lsx_comment_form_fields_filter($fields) { |
67 | - foreach($fields as &$field){ |
|
68 | - if(stristr('class=', $field)){ |
|
67 | + foreach ($fields as &$field) { |
|
68 | + if (stristr('class=', $field)) { |
|
69 | 69 | $field = str_replace('class="', 'class="form-control ', $field); |
70 | - }else{ |
|
70 | + } else { |
|
71 | 71 | $field = str_replace('<input', '<input class="form-control" ', $field); |
72 | 72 | } |
73 | 73 | } |
74 | 74 | return $fields; |
75 | 75 | } |
76 | -add_filter( 'comment_form_default_fields', 'lsx_comment_form_fields_filter'); |
|
76 | +add_filter('comment_form_default_fields', 'lsx_comment_form_fields_filter'); |
@@ -1,5 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * lsx Comment Walker |
@@ -67,7 +70,7 @@ discard block |
||
67 | 70 | foreach($fields as &$field){ |
68 | 71 | if(stristr('class=', $field)){ |
69 | 72 | $field = str_replace('class="', 'class="form-control ', $field); |
70 | - }else{ |
|
73 | + } else{ |
|
71 | 74 | $field = str_replace('<input', '<input class="form-control" ', $field); |
72 | 75 | } |
73 | 76 | } |
@@ -46,16 +46,16 @@ |
||
46 | 46 | |
47 | 47 | function lsx_sidebar_footer_params( $params ) { |
48 | 48 | |
49 | - $sidebar_id = $params[0]['id']; |
|
49 | + $sidebar_id = $params[0]['id']; |
|
50 | 50 | |
51 | - if ( $sidebar_id == 'sidebar-footer' ) { |
|
51 | + if ( $sidebar_id == 'sidebar-footer' ) { |
|
52 | 52 | |
53 | - $total_widgets = wp_get_sidebars_widgets(); |
|
54 | - $sidebar_widgets = count($total_widgets[$sidebar_id]); |
|
53 | + $total_widgets = wp_get_sidebars_widgets(); |
|
54 | + $sidebar_widgets = count($total_widgets[$sidebar_id]); |
|
55 | 55 | |
56 | - $params[0]['before_widget'] = str_replace('class="styler', 'class="col-sm-' . floor(12 / $sidebar_widgets), $params[0]['before_widget']); |
|
57 | - } |
|
56 | + $params[0]['before_widget'] = str_replace('class="styler', 'class="col-sm-' . floor(12 / $sidebar_widgets), $params[0]['before_widget']); |
|
57 | + } |
|
58 | 58 | |
59 | - return $params; |
|
59 | + return $params; |
|
60 | 60 | } |
61 | 61 | add_filter( 'dynamic_sidebar_params', 'lsx_sidebar_footer_params' ); |
62 | 62 | \ No newline at end of file |
@@ -1,54 +1,54 @@ 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 | * Register widgetized area and update sidebar with default widgets. |
6 | 6 | */ |
7 | 7 | function lsx_widget_area_init() { |
8 | 8 | |
9 | - register_sidebar( array( |
|
10 | - 'name' => __( 'Home', 'lsx' ), |
|
9 | + register_sidebar(array( |
|
10 | + 'name' => __('Home', 'lsx'), |
|
11 | 11 | 'id' => 'sidebar-home', |
12 | 12 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
13 | 13 | 'after_widget' => '</aside>', |
14 | 14 | 'before_title' => '<h3 class="widget-title">', |
15 | 15 | 'after_title' => '</h3>', |
16 | - ) ); |
|
16 | + )); |
|
17 | 17 | |
18 | - register_sidebar( array( |
|
19 | - 'name' => __( 'Sidebar', 'lsx' ), |
|
18 | + register_sidebar(array( |
|
19 | + 'name' => __('Sidebar', 'lsx'), |
|
20 | 20 | 'id' => 'sidebar-1', |
21 | 21 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
22 | 22 | 'after_widget' => '</aside>', |
23 | 23 | 'before_title' => '<h3 class="widget-title">', |
24 | 24 | 'after_title' => '</h3>', |
25 | - ) ); |
|
25 | + )); |
|
26 | 26 | |
27 | - register_sidebar( array( |
|
28 | - 'name' => __( 'Footer', 'lsx' ), |
|
27 | + register_sidebar(array( |
|
28 | + 'name' => __('Footer', 'lsx'), |
|
29 | 29 | 'id' => 'sidebar-footer', |
30 | 30 | 'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">', |
31 | 31 | 'after_widget' => '</aside></div>', |
32 | 32 | 'before_title' => '<h3 class="widget-title">', |
33 | 33 | 'after_title' => '</h3>', |
34 | - ) ); |
|
34 | + )); |
|
35 | 35 | |
36 | - register_sidebar( array( |
|
37 | - 'name' => __( 'Footer Call to Action', 'lsx' ), |
|
36 | + register_sidebar(array( |
|
37 | + 'name' => __('Footer Call to Action', 'lsx'), |
|
38 | 38 | 'id' => 'sidebar-footer-cta', |
39 | 39 | 'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">', |
40 | 40 | 'after_widget' => '</aside></div>', |
41 | 41 | 'before_title' => '<h3 class="widget-title">', |
42 | 42 | 'after_title' => '</h3>', |
43 | - ) ); |
|
43 | + )); |
|
44 | 44 | } |
45 | -add_action( 'widgets_init', 'lsx_widget_area_init' ); |
|
45 | +add_action('widgets_init', 'lsx_widget_area_init'); |
|
46 | 46 | |
47 | -function lsx_sidebar_footer_params( $params ) { |
|
47 | +function lsx_sidebar_footer_params($params) { |
|
48 | 48 | |
49 | 49 | $sidebar_id = $params[0]['id']; |
50 | 50 | |
51 | - if ( $sidebar_id == 'sidebar-footer' ) { |
|
51 | + if ($sidebar_id == 'sidebar-footer') { |
|
52 | 52 | |
53 | 53 | $total_widgets = wp_get_sidebars_widgets(); |
54 | 54 | $sidebar_widgets = count($total_widgets[$sidebar_id]); |
@@ -58,4 +58,4 @@ discard block |
||
58 | 58 | |
59 | 59 | return $params; |
60 | 60 | } |
61 | -add_filter( 'dynamic_sidebar_params', 'lsx_sidebar_footer_params' ); |
|
62 | 61 | \ No newline at end of file |
62 | +add_filter('dynamic_sidebar_params', 'lsx_sidebar_footer_params'); |
|
63 | 63 | \ No newline at end of file |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -14,6 +14,6 @@ |
||
14 | 14 | */ |
15 | 15 | |
16 | 16 | function lsx_wp_job_manager_styles() { |
17 | - wp_enqueue_style( 'wp_job_manager', get_template_directory_uri() . '/css/wp-job-manager.css' ); |
|
17 | + wp_enqueue_style( 'wp_job_manager', get_template_directory_uri() . '/css/wp-job-manager.css' ); |
|
18 | 18 | } |
19 | 19 | add_action( 'wp_enqueue_scripts', 'lsx_wp_job_manager_styles' ); |
20 | 20 | \ No newline at end of file |
@@ -14,6 +14,6 @@ |
||
14 | 14 | */ |
15 | 15 | |
16 | 16 | function lsx_wp_job_manager_styles() { |
17 | - wp_enqueue_style( 'wp_job_manager', get_template_directory_uri() . '/css/wp-job-manager.css' ); |
|
17 | + wp_enqueue_style('wp_job_manager', get_template_directory_uri() . '/css/wp-job-manager.css'); |
|
18 | 18 | } |
19 | -add_action( 'wp_enqueue_scripts', 'lsx_wp_job_manager_styles' ); |
|
20 | 19 | \ No newline at end of file |
20 | +add_action('wp_enqueue_scripts', 'lsx_wp_job_manager_styles'); |
|
21 | 21 | \ No newline at end of file |
@@ -1,12 +1,12 @@ 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 Header Swatch Control Class |
6 | 6 | * |
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
10 | 10 | return; |
11 | 11 | } |
12 | 12 | class LSX_Customize_Header_Layout_Control extends WP_Customize_Control { |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param string $id |
39 | 39 | * @param array $args |
40 | 40 | */ |
41 | - public function __construct( $manager, $id, $args = array() ) { |
|
42 | - parent::__construct( $manager, $id, $args ); |
|
43 | - if( !empty( $args['choices'] ) ){ |
|
41 | + public function __construct($manager, $id, $args = array()) { |
|
42 | + parent::__construct($manager, $id, $args); |
|
43 | + if ( ! empty($args['choices'])) { |
|
44 | 44 | $this->layouts = $args['choices']; |
45 | 45 | } |
46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function enqueue() { |
54 | 54 | // |
55 | - wp_enqueue_script( 'lsx-header-layout-control', get_template_directory_uri() .'/js/customizer-header-layout.js', array('jquery'), null, true ); |
|
55 | + wp_enqueue_script('lsx-header-layout-control', get_template_directory_uri() . '/js/customizer-header-layout.js', array('jquery'), null, true); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -62,26 +62,26 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function render_content() { |
64 | 64 | |
65 | - $post_id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); |
|
65 | + $post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id)); |
|
66 | 66 | $class = 'customize-control customize-control-' . $this->type; |
67 | 67 | $value = $this->value(); |
68 | 68 | |
69 | 69 | ?> |
70 | 70 | <label> |
71 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
72 | - <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
|
71 | + <?php if ( ! empty($this->label)) { ?> |
|
72 | + <span class="customize-control-title"><?php echo esc_html($this->label); ?></span> |
|
73 | 73 | <?php } |
74 | - if ( ! empty( $this->description ) ) { ?> |
|
74 | + if ( ! empty($this->description)) { ?> |
|
75 | 75 | <span class="description customize-control-description"><?php echo $this->description; ?></span> |
76 | 76 | <?php } ?> |
77 | 77 | <div class="header-layouts-selector"> |
78 | 78 | <?php |
79 | - foreach( $this->layouts as $layout ){ |
|
79 | + foreach ($this->layouts as $layout) { |
|
80 | 80 | $sel = 'border: 1px solid transparent;'; |
81 | - if( $value == $layout ){ |
|
81 | + if ($value == $layout) { |
|
82 | 82 | $sel = 'border: 1px solid rgb(43, 166, 203);'; |
83 | 83 | } |
84 | - echo '<img class="header-layout-button" style="padding:2px;'. $sel .'" src="' . get_template_directory_uri() .'/img/header-' . $layout . '.png" data-option="' . $layout . '">'; |
|
84 | + echo '<img class="header-layout-button" style="padding:2px;' . $sel . '" src="' . get_template_directory_uri() . '/img/header-' . $layout . '.png" data-option="' . $layout . '">'; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | ?> |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Constructor |
15 | - **/ |
|
15 | + **/ |
|
16 | 16 | public function __construct($fonts) |
17 | 17 | { |
18 | 18 | if(empty($fonts)) |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * getFontFamilyNameArray Function |
35 | 35 | * this function returns an array containing all of the font family names |
36 | - **/ |
|
36 | + **/ |
|
37 | 37 | function getFontFamilyNameArray() |
38 | 38 | { |
39 | 39 | $result; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * getTitle |
49 | 49 | * this function returns the font title |
50 | - **/ |
|
50 | + **/ |
|
51 | 51 | function getTitle($key) |
52 | 52 | { |
53 | 53 | return $this->fonts[$key]->__get("title"); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | /** |
57 | 57 | * getLocation |
58 | 58 | * this function returns the font location |
59 | - **/ |
|
59 | + **/ |
|
60 | 60 | function getLocation($key) |
61 | 61 | { |
62 | 62 | return $this->fonts[$key]->__get("location"); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | /** |
66 | 66 | * getCssDeclaration |
67 | 67 | * this function returns the font css declaration |
68 | - **/ |
|
68 | + **/ |
|
69 | 69 | function getCssDeclaration($key) |
70 | 70 | { |
71 | 71 | return $this->fonts[$key]->__get("cssDeclaration"); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * this function returns an array of css classes |
78 | 78 | * this function is used when displaying the fancy list of fonts in the theme customizer |
79 | 79 | * this function is used to send a JS file an array for the postMessage transport option in the theme customizer |
80 | - **/ |
|
80 | + **/ |
|
81 | 81 | function getCssClassArray() |
82 | 82 | { |
83 | 83 | $result; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | /** |
92 | 92 | * getTotalNumberOfFonts |
93 | 93 | * this function returns the total number of fonts |
94 | - **/ |
|
94 | + **/ |
|
95 | 95 | function getTotalNumberOfFonts() |
96 | 96 | { |
97 | 97 | return count($this->fonts); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | /** |
101 | 101 | * printThemeCustomizerCssLocations |
102 | 102 | * this function prints the links to the css files for the theme customizer |
103 | - **/ |
|
103 | + **/ |
|
104 | 104 | function printThemeCustomizerCssLocations() |
105 | 105 | { |
106 | 106 | foreach ($this->fonts as $key => $value) |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | /** |
117 | 117 | * printThemeCustomizerCssClasses |
118 | 118 | * this function prints the theme customizer css classes necessary to display all of the fonts |
119 | - **/ |
|
119 | + **/ |
|
120 | 120 | function printThemeCustomizerCssClasses() |
121 | 121 | { |
122 | 122 | ?> |
@@ -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,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -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,5 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Enqueue scripts and styles. |
@@ -29,7 +32,7 @@ discard block |
||
29 | 32 | wp_enqueue_script('imagesLoaded', get_template_directory_uri().'/js/vendor/imagesloaded.pkgd.min.js', array('jquery','masonry')); |
30 | 33 | if(defined('WP_DEBUG') && true === WP_DEBUG){ |
31 | 34 | wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.js', array('masonry'), null, false); |
32 | - }else{ |
|
35 | + } else{ |
|
33 | 36 | wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.min.js', array('masonry'), null, false); |
34 | 37 | } |
35 | 38 | |
@@ -107,9 +110,15 @@ discard block |
||
107 | 110 | */ |
108 | 111 | function lsx_scripts_defer_parsing( $url ) { |
109 | 112 | 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 | + if ( FALSE === strpos( $url, '.js' ) ) { |
|
114 | + return $url; |
|
115 | + } |
|
116 | + if ( strpos( $url, 'jquery.js' ) ) { |
|
117 | + return $url; |
|
118 | + } |
|
119 | + if ( strpos( $url, ' defer ' ) ) { |
|
120 | + return $url; |
|
121 | + } |
|
113 | 122 | return "$url' defer onload='"; |
114 | 123 | } |
115 | 124 |
@@ -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,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |