Completed
Push — master ( aaf3ff...ce0105 )
by Fernando
02:47
created
functions.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  *
5 5
  * @package lsx
6 6
  */
7
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
7
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
8 8
 
9 9
 define('LSX_VERSION', '1.8.0');
10 10
 
@@ -19,22 +19,22 @@  discard block
 block discarded – undo
19 19
 require get_template_directory() . '/inc/comment-walker.php';
20 20
 require get_template_directory() . '/inc/jetpack.php';
21 21
 require get_template_directory() . '/inc/lazyload.php';
22
-if(class_exists('BuddyPress')){
22
+if (class_exists('BuddyPress')) {
23 23
 	require get_template_directory() . '/inc/buddypress.php';
24 24
 }
25
-if(class_exists('WooCommerce')){
25
+if (class_exists('WooCommerce')) {
26 26
 	require get_template_directory() . '/inc/woocommerce.php';
27 27
 }
28
-if(class_exists('WP_Job_Manager')){
28
+if (class_exists('WP_Job_Manager')) {
29 29
 	require get_template_directory() . '/inc/wp-job-manager.php';
30 30
 }
31
-if(class_exists('Tribe__Events__Main')){
31
+if (class_exists('Tribe__Events__Main')) {
32 32
 	require get_template_directory() . '/inc/the-events-calendar.php';
33 33
 }
34 34
 require get_template_directory() . '/inc/template-tags.php';
35 35
 require get_template_directory() . '/inc/extras.php';
36 36
 require get_template_directory() . '/inc/wp-bootstrap-navwalker.php';
37
-if(class_exists('Sensei_WC')){
37
+if (class_exists('Sensei_WC')) {
38 38
 	require get_template_directory() . '/inc/sensei.php';
39 39
 }
40 40
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
  * @category	customizer
47 47
  * @return		$lsx_controls array()
48 48
  */
49
-function lsx_customizer_core_controls( $lsx_controls ) {
49
+function lsx_customizer_core_controls($lsx_controls) {
50 50
 	$lsx_controls['sections']['lsx-core'] = array(
51
-		'title'       =>  esc_html__( 'Core Settings', 'lsx' ),
52
-		'description' => __( 'Change the core settings.', 'lsx' ),
51
+		'title'       =>  esc_html__('Core Settings', 'lsx'),
52
+		'description' => __('Change the core settings.', 'lsx'),
53 53
 		'priority'    => 21
54 54
 	);
55 55
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	);
61 61
 
62 62
 	$lsx_controls['fields']['lsx_lazyload_status'] = array(
63
-		'label'         =>  __( 'Lazy Loading Images', 'lsx' ),
63
+		'label'         =>  __('Lazy Loading Images', 'lsx'),
64 64
 		'section'       =>  'lsx-core',
65 65
 		'type'          =>  'checkbox',
66 66
 	);
@@ -72,14 +72,14 @@  discard block
 block discarded – undo
72 72
 	);
73 73
 
74 74
 	$lsx_controls['fields']['lsx_preloader_content_status'] = array(
75
-		'label'         =>  __( 'Preloader Content', 'lsx' ),
75
+		'label'         =>  __('Preloader Content', 'lsx'),
76 76
 		'section'       =>  'lsx-core',
77 77
 		'type'          =>  'checkbox',
78 78
 	);
79 79
 
80 80
 	return $lsx_controls;
81 81
 }
82
-add_filter( 'lsx_customizer_controls', 'lsx_customizer_core_controls' );
82
+add_filter('lsx_customizer_controls', 'lsx_customizer_core_controls');
83 83
 
84 84
 /**
85 85
  * Returns an array of the layout panel.
@@ -90,56 +90,56 @@  discard block
 block discarded – undo
90 90
  * @return		$lsx_controls array()
91 91
  */
92 92
 function lsx_customizer_layout_controls($lsx_controls) {
93
-	$lsx_controls['settings']['lsx_header_layout']  = array(
93
+	$lsx_controls['settings']['lsx_header_layout'] = array(
94 94
 			'default'       =>  'inline', //Default setting/value to save
95 95
 			'type'        =>  'theme_mod', //Is this an 'option' or a 'theme_mod'?
96 96
 			'transport'     =>  'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
97 97
 	);
98 98
 	$lsx_controls['fields']['lsx_header_layout'] = array(
99
-			'label'         =>  __('Header','lsx'),
99
+			'label'         =>  __('Header', 'lsx'),
100 100
 			'section'       =>  'lsx-layout',
101 101
 			'control'   =>  'LSX_Customize_Header_Layout_Control',
102
-			'choices'		=>	array('central','expanded','inline')
102
+			'choices'		=>	array('central', 'expanded', 'inline')
103 103
 	);	
104 104
 	$lsx_controls['sections']['lsx-layout'] = array(
105
-			'title'       =>  esc_html__( 'Layout', 'lsx' ),
106
-			'description' => __( 'Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx' ),
105
+			'title'       =>  esc_html__('Layout', 'lsx'),
106
+			'description' => __('Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx'),
107 107
 			'priority' => 22
108 108
 	);
109
-	$lsx_controls['settings']['lsx_layout']  = array(
109
+	$lsx_controls['settings']['lsx_layout'] = array(
110 110
 			'default'       =>  '2cr', //Default setting/value to save
111 111
 			'type'        =>  'theme_mod', //Is this an 'option' or a 'theme_mod'?
112 112
 			'transport'     =>  'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
113 113
 	);
114
-	$lsx_controls['settings']['lsx_header_fixed']  = array(
114
+	$lsx_controls['settings']['lsx_header_fixed'] = array(
115 115
 			'default'       =>  false, //Default setting/value to save
116 116
 			'sanitize_callback' => 'lsx_sanitize_checkbox',
117 117
 			'transport'     =>  'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
118 118
 	);
119 119
 	$lsx_controls['fields']['lsx_header_fixed'] = array(
120
-			'label'         =>  __('Fixed Header','lsx'),
120
+			'label'         =>  __('Fixed Header', 'lsx'),
121 121
 			'section'       =>  'lsx-layout',
122 122
 			'type'       =>  'checkbox',
123 123
 	);
124
-	$lsx_controls['settings']['lsx_header_search']  = array(
124
+	$lsx_controls['settings']['lsx_header_search'] = array(
125 125
 			'default'       =>  false, //Default setting/value to save
126 126
 			'sanitize_callback' => 'lsx_sanitize_checkbox',
127 127
 			'transport'     =>  'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
128 128
 	);
129 129
 	$lsx_controls['fields']['lsx_header_search'] = array(
130
-			'label'         =>  __('Search Box in Header','lsx'),
130
+			'label'         =>  __('Search Box in Header', 'lsx'),
131 131
 			'section'       =>  'lsx-layout',
132 132
 			'type'       =>  'checkbox',
133 133
 	);	
134 134
 	$lsx_controls['fields']['lsx_layout'] = array(
135
-			'label'         =>  __('Body','lsx'),
135
+			'label'         =>  __('Body', 'lsx'),
136 136
 			'section'       =>  'lsx-layout',
137 137
 			'control'   =>  'LSX_Customize_Layout_Control',
138
-			'choices'		=>	array('1c','2cr','2cl')
138
+			'choices'		=>	array('1c', '2cr', '2cl')
139 139
 	);	
140 140
 	return $lsx_controls;
141 141
 }
142
-add_filter('lsx_customizer_controls','lsx_customizer_layout_controls');
142
+add_filter('lsx_customizer_controls', 'lsx_customizer_layout_controls');
143 143
 
144 144
 /**
145 145
  * Returns an array of the font controls.
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
  */
152 152
 function lsx_customizer_font_controls($lsx_controls) {
153 153
 	$lsx_controls['sections']['lsx-font'] = array(
154
-			'title'       =>  __( 'Font', 'lsx' ),
154
+			'title'       =>  __('Font', 'lsx'),
155 155
 			'description' => 'Change the fonts sitewide.',
156 156
 			'priority' => 41
157 157
 	);
158
-	$lsx_controls['settings']['lsx_font']  = array(
158
+	$lsx_controls['settings']['lsx_font'] = array(
159 159
 			'default'       =>  'raleway_open_sans', //Default setting/value to save
160 160
 			'type'        =>  'theme_mod', //Is this an 'option' or a 'theme_mod'?
161 161
 			'transport'     =>  'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
@@ -169,13 +169,13 @@  discard block
 block discarded – undo
169 169
 			'choices'   =>  array(
170 170
 					'raleway_open_sans' => array(
171 171
 							'header'  => array(
172
-									"title" => __( 'Raleway', 'lsx' ),
172
+									"title" => __('Raleway', 'lsx'),
173 173
 									"location" => "Raleway",
174 174
 									"cssDeclaration" => "'Raleway', sans-serif",
175 175
 									"cssClass" => "raleway",
176 176
 							),
177 177
 							'body'  => array(
178
-									"title" => __( 'Open Sans', 'lsx' ),
178
+									"title" => __('Open Sans', 'lsx'),
179 179
 									"location" => "Open+Sans",
180 180
 									"cssDeclaration" => "'Open Sans', sans-serif",
181 181
 									"cssClass" => "openSans"
@@ -183,13 +183,13 @@  discard block
 block discarded – undo
183 183
 					),
184 184
 					'noto_serif_noto_sans' => array(
185 185
 							'header'  => array(
186
-									"title" => __( 'Noto Serif', 'lsx' ),
186
+									"title" => __('Noto Serif', 'lsx'),
187 187
 									"location" => "Noto+Serif",
188 188
 									"cssDeclaration" => "'Noto Serif', serif",
189 189
 									"cssClass" => "notoSerif",
190 190
 							),
191 191
 							'body'  => array(
192
-									"title" => __( 'Noto Sans', 'lsx' ),
192
+									"title" => __('Noto Sans', 'lsx'),
193 193
 									"location" => "Noto+Sans",
194 194
 									"cssDeclaration" => "'Noto Sans', sans-serif",
195 195
 									"cssClass" => "notoSans",
@@ -197,13 +197,13 @@  discard block
 block discarded – undo
197 197
 					),
198 198
 					'noto_sans_noto_sans' => array(
199 199
 					'header'  => array(
200
-					"title" => __( 'Noto Sans', 'lsx' ),
200
+					"title" => __('Noto Sans', 'lsx'),
201 201
 					"location" => "Noto+Sans",
202 202
 					"cssDeclaration" => "'Noto Sans', sans-serif",
203 203
 					"cssClass" => "notoSans",
204 204
 					),
205 205
 					'body'  => array(
206
-					"title" => __( 'Noto Sans', 'lsx' ),
206
+					"title" => __('Noto Sans', 'lsx'),
207 207
 					"location" => "Noto+Sans",
208 208
 					"cssDeclaration" => "'Noto Sans', sans-serif",
209 209
 					"cssClass" => "notoSans",
@@ -211,13 +211,13 @@  discard block
 block discarded – undo
211 211
 					),
212 212
 					'alegreya_open_sans' => array(
213 213
 					'header'  => array(
214
-					"title" => __( 'Alegreya', 'lsx' ),
214
+					"title" => __('Alegreya', 'lsx'),
215 215
 					"location" => "Alegreya",
216 216
 					"cssDeclaration" => "'Alegreya', serif",
217 217
 					"cssClass" => "alegreya",
218 218
 					),
219 219
 					'body'  => array(
220
-					"title" => __( 'Open Sans', 'lsx' ),
220
+					"title" => __('Open Sans', 'lsx'),
221 221
 					"location" => "Open+Sans",
222 222
 					"cssDeclaration" => "'Open Sans', sans-serif",
223 223
 					"cssClass" => "openSans"
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	);	
229 229
 	return $lsx_controls;
230 230
 }
231
-add_filter('lsx_customizer_controls','lsx_customizer_font_controls');
231
+add_filter('lsx_customizer_controls', 'lsx_customizer_font_controls');
232 232
 
233 233
 /**
234 234
  * Returns an array of $controls for the customizer class to generate.
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
  * @category	customizer
239 239
  * @return		$lsx_controls array()
240 240
  */
241
-function lsx_get_customizer_controls(){
241
+function lsx_get_customizer_controls() {
242 242
 	$lsx_controls = array();
243 243
 	$lsx_controls = apply_filters('lsx_customizer_controls', $lsx_controls);
244 244
 	return $lsx_controls;
245 245
 }
246
-$lsx_customizer = new LSX_Theme_Customizer( lsx_get_customizer_controls() );
246
+$lsx_customizer = new LSX_Theme_Customizer(lsx_get_customizer_controls());
247 247
 
248
-add_image_size( 'lsx-thumbnail-wide', 350, 230, true );
249
-add_image_size( 'lsx-thumbnail-single', 750, 350, true );
250 248
\ No newline at end of file
249
+add_image_size('lsx-thumbnail-wide', 350, 230, true);
250
+add_image_size('lsx-thumbnail-single', 750, 350, true);
251 251
\ No newline at end of file
Please login to merge, or discard this patch.