Completed
Pull Request — master (#235)
by Jacques
02:35
created
includes/classes/class-lsx-optimisation.php 2 patches
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,6 @@  discard block
 block discarded – undo
46 46
 	/**
47 47
 	 * Defers the JS loading till Last
48 48
 	 *
49
-	 * @param  string $url The url to check and defer.
50 49
 	 * @return string
51 50
 	 */
52 51
 	public function preload_css( $tag, $handle, $href, $media ) {
@@ -59,7 +58,6 @@  discard block
 block discarded – undo
59 58
 	/**
60 59
 	 * Defers the JS loading till Last
61 60
 	 *
62
-	 * @param  string $url The url to check and defer.
63 61
 	 * @return string
64 62
 	 */
65 63
 	public function defer_parsing_of_js( $tag, $handle, $href ) {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if ( ! defined('ABSPATH')) {
4 4
 	exit;
5 5
 }
6 6
 
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 	 * Constructor.
27 27
 	 */
28 28
 	public function __construct() {
29
-		add_filter( 'style_loader_tag', array( $this, 'preload_css' ), 100, 4 );
30
-		add_filter( 'script_loader_tag', array( $this, 'defer_parsing_of_js' ), 100, 3 );
31
-		add_action( 'init', array( $this, 'pum_remove_admin_bar_tools' ), 100 );
29
+		add_filter('style_loader_tag', array($this, 'preload_css'), 100, 4);
30
+		add_filter('script_loader_tag', array($this, 'defer_parsing_of_js'), 100, 3);
31
+		add_action('init', array($this, 'pum_remove_admin_bar_tools'), 100);
32 32
 	}
33 33
 	/**
34 34
 	 * Return an instance of this class.
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 */
39 39
 	public static function get_instance() {
40 40
 		// If the single instance hasn't been set, set it now.
41
-		if ( null === self::$instance ) {
41
+		if (null === self::$instance) {
42 42
 			self::$instance = new self;
43 43
 		}
44 44
 		return self::$instance;
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 	 * @param  string $url The url to check and defer.
51 51
 	 * @return string
52 52
 	 */
53
-	public function preload_css( $tag, $handle, $href, $media ) {
54
-		if ( 'lsx_fonts' === $handle || 'fontawesome' === $handle ) {
55
-			$tag = str_replace( 'href', ' preload href', $tag );
53
+	public function preload_css($tag, $handle, $href, $media) {
54
+		if ('lsx_fonts' === $handle || 'fontawesome' === $handle) {
55
+			$tag = str_replace('href', ' preload href', $tag);
56 56
 		}
57 57
 		return $tag;
58 58
 	}
@@ -63,18 +63,18 @@  discard block
 block discarded – undo
63 63
 	 * @param  string $url The url to check and defer.
64 64
 	 * @return string
65 65
 	 */
66
-	public function defer_parsing_of_js( $tag, $handle, $href ) {
67
-		$skip_defer = apply_filters( 'lsx_defer_parsing_of_js', false, $tag, $handle, $href );
68
-		if ( ! is_admin() && false !== stripos( $href, '.js' ) && false === stripos( $href, 'jquery.js' ) && false === $skip_defer ) {
69
-			$tag = str_replace( 'src=', ' defer src=', $tag );
66
+	public function defer_parsing_of_js($tag, $handle, $href) {
67
+		$skip_defer = apply_filters('lsx_defer_parsing_of_js', false, $tag, $handle, $href);
68
+		if ( ! is_admin() && false !== stripos($href, '.js') && false === stripos($href, 'jquery.js') && false === $skip_defer) {
69
+			$tag = str_replace('src=', ' defer src=', $tag);
70 70
 		}
71 71
 		return $tag;
72 72
 	}
73 73
 
74 74
 	public function pum_remove_admin_bar_tools() {
75
-		remove_action( 'admin_bar_menu', array( 'PUM_Modules_Admin_Bar', 'toolbar_links' ), 999 );
76
-		remove_action( 'wp_footer', array( 'PUM_Modules_Admin_Bar', 'admin_bar_styles' ), 999 );
77
-		remove_action( 'init', array( 'PUM_Modules_Admin_Bar', 'show_debug_bar' ) );
75
+		remove_action('admin_bar_menu', array('PUM_Modules_Admin_Bar', 'toolbar_links'), 999);
76
+		remove_action('wp_footer', array('PUM_Modules_Admin_Bar', 'admin_bar_styles'), 999);
77
+		remove_action('init', array('PUM_Modules_Admin_Bar', 'show_debug_bar'));
78 78
 	}
79 79
 }
80 80
 LSX_Optimisation::get_instance();
Please login to merge, or discard this patch.
includes/template-tags.php 1 patch
Spacing   +168 added lines, -168 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @subpackage template-tags
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_breadcrumbs' ) ) :
13
+if ( ! function_exists('lsx_breadcrumbs')) :
14 14
 
15 15
 	/**
16 16
 	 * Breadcrumbs.
@@ -19,44 +19,44 @@  discard block
 block discarded – undo
19 19
 	 * @subpackage template-tags
20 20
 	 */
21 21
 	function lsx_breadcrumbs() {
22
-		if ( ! function_exists( 'yoast_breadcrumb' ) && ! function_exists( 'woocommerce_breadcrumb' ) ) {
22
+		if ( ! function_exists('yoast_breadcrumb') && ! function_exists('woocommerce_breadcrumb')) {
23 23
 			return null;
24 24
 		}
25 25
 
26
-		$show_on_front = get_option( 'show_on_front' );
26
+		$show_on_front = get_option('show_on_front');
27 27
 
28
-		if ( ( 'posts' === $show_on_front && is_home() ) || ( 'page' === $show_on_front && is_front_page() ) ) {
28
+		if (('posts' === $show_on_front && is_home()) || ('page' === $show_on_front && is_front_page())) {
29 29
 			return;
30 30
 		}
31 31
 
32
-		if ( function_exists( 'woocommerce_breadcrumb' ) ) {
32
+		if (function_exists('woocommerce_breadcrumb')) {
33 33
 			ob_start();
34 34
 
35
-			woocommerce_breadcrumb( array(
35
+			woocommerce_breadcrumb(array(
36 36
 				'wrap_before' => '<div class="breadcrumbs-container breadcrumbs-woocommerce"><div class="container"><div class="row"><div class="col-xs-12">',
37 37
 				'wrap_after'  => '</div></div></div></div>',
38 38
 				'before'      => '<span>',
39 39
 				'after'       => '</span>',
40
-			) );
40
+			));
41 41
 
42 42
 			$output = ob_get_clean();
43
-		} elseif ( function_exists( 'yoast_breadcrumb' ) ) {
44
-			$output = yoast_breadcrumb( null, null, false );
43
+		} elseif (function_exists('yoast_breadcrumb')) {
44
+			$output = yoast_breadcrumb(null, null, false);
45 45
 			$output = '<div class="breadcrumbs-container breadcrumbs-yoast"><div class="container"><div class="row"><div class="col-xs-12">' . $output . '</div></div></div></div>';
46 46
 		}
47 47
 
48
-		$output = apply_filters( 'lsx_breadcrumbs', $output );
48
+		$output = apply_filters('lsx_breadcrumbs', $output);
49 49
 
50
-		echo wp_kses_post( $output );
50
+		echo wp_kses_post($output);
51 51
 	}
52 52
 
53 53
 endif;
54 54
 
55
-add_action( 'lsx_header_after', 'lsx_breadcrumbs', 1 );
55
+add_action('lsx_header_after', 'lsx_breadcrumbs', 1);
56 56
 //add_action( 'lsx_banner_inner_bottom', 'lsx_breadcrumbs', 100 );
57 57
 //add_action( 'lsx_global_header_inner_bottom', 'lsx_breadcrumbs', 100 );
58 58
 
59
-if ( ! function_exists( 'lsx_breadcrumbs_wpseo_seperator_filter' ) ) :
59
+if ( ! function_exists('lsx_breadcrumbs_wpseo_seperator_filter')) :
60 60
 
61 61
 	/**
62 62
 	 * Replaces the seperator.
@@ -64,16 +64,16 @@  discard block
 block discarded – undo
64 64
 	 * @package    lsx
65 65
 	 * @subpackage template-tags
66 66
 	 */
67
-	function lsx_breadcrumbs_wpseo_seperator_filter( $seperator ) {
67
+	function lsx_breadcrumbs_wpseo_seperator_filter($seperator) {
68 68
 		$seperator = '<i class="fa fa-angle-right" aria-hidden="true"></i>';
69 69
 		return $seperator;
70 70
 	}
71 71
 
72 72
 endif;
73 73
 
74
-add_filter( 'wpseo_breadcrumb_separator', 'lsx_breadcrumbs_wpseo_seperator_filter' );
74
+add_filter('wpseo_breadcrumb_separator', 'lsx_breadcrumbs_wpseo_seperator_filter');
75 75
 
76
-if ( ! function_exists( 'lsx_breadcrumbs_woocommerce_seperator_filter' ) ) :
76
+if ( ! function_exists('lsx_breadcrumbs_woocommerce_seperator_filter')) :
77 77
 
78 78
 	/**
79 79
 	 * Replaces the seperator.
@@ -81,16 +81,16 @@  discard block
 block discarded – undo
81 81
 	 * @package    lsx
82 82
 	 * @subpackage template-tags
83 83
 	 */
84
-	function lsx_breadcrumbs_woocommerce_seperator_filter( $defaults ) {
84
+	function lsx_breadcrumbs_woocommerce_seperator_filter($defaults) {
85 85
 		$defaults['delimiter'] = '<i class="fa fa-angle-right" aria-hidden="true"></i>';
86 86
 		return $defaults;
87 87
 	}
88 88
 
89 89
 endif;
90 90
 
91
-add_filter( 'woocommerce_breadcrumb_defaults', 'lsx_breadcrumbs_woocommerce_seperator_filter' );
91
+add_filter('woocommerce_breadcrumb_defaults', 'lsx_breadcrumbs_woocommerce_seperator_filter');
92 92
 
93
-if ( ! function_exists( 'lsx_site_title' ) ) :
93
+if ( ! function_exists('lsx_site_title')) :
94 94
 
95 95
 	/**
96 96
 	 * Displays logo when applicable.
@@ -101,15 +101,15 @@  discard block
 block discarded – undo
101 101
 	function lsx_site_title() {
102 102
 		?>
103 103
 			<div class="site-branding">
104
-				<h1 class="site-title"><a title="<?php bloginfo( 'name' ); ?>" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
105
-				<p class="site-description"><?php bloginfo( 'description' ); ?></p>
104
+				<h1 class="site-title"><a title="<?php bloginfo('name'); ?>" href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></h1>
105
+				<p class="site-description"><?php bloginfo('description'); ?></p>
106 106
 			</div>
107 107
 		<?php
108 108
 	}
109 109
 
110 110
 endif;
111 111
 
112
-if ( ! function_exists( 'lsx_post_meta_list_top' ) ) :
112
+if ( ! function_exists('lsx_post_meta_list_top')) :
113 113
 
114 114
 	/**
115 115
 	 * Add customisable post meta (post list - above title).
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
 endif;
132 132
 
133
-if ( ! function_exists( 'lsx_post_meta_single_top' ) ) :
133
+if ( ! function_exists('lsx_post_meta_single_top')) :
134 134
 
135 135
 	/**
136 136
 	 * Add customisable post meta (single post - above title).
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
 endif;
151 151
 
152 152
 //add_action( 'lsx_post_meta_top', 'lsx_post_meta_avatar' );
153
-add_action( 'lsx_post_meta_top', 'lsx_post_meta_author' );
154
-add_action( 'lsx_post_meta_top', 'lsx_post_meta_date' );
155
-add_action( 'lsx_post_meta_top', 'lsx_post_meta_category' );
153
+add_action('lsx_post_meta_top', 'lsx_post_meta_author');
154
+add_action('lsx_post_meta_top', 'lsx_post_meta_date');
155
+add_action('lsx_post_meta_top', 'lsx_post_meta_category');
156 156
 
157
-if ( ! function_exists( 'lsx_post_meta_single_bottom' ) ) :
157
+if ( ! function_exists('lsx_post_meta_single_bottom')) :
158 158
 
159 159
 	/**
160 160
 	 * Add customisable post meta (single post - below title).
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
 endif;
175 175
 
176
-if ( ! function_exists( 'lsx_post_meta_avatar' ) ) :
176
+if ( ! function_exists('lsx_post_meta_avatar')) :
177 177
 
178 178
 	/**
179 179
 	 * Add customisable post meta: author's avatar.
@@ -183,20 +183,20 @@  discard block
 block discarded – undo
183 183
 	 */
184 184
 	function lsx_post_meta_avatar() {
185 185
 		$author = get_the_author();
186
-		$author_id = get_the_author_meta( 'ID' );
187
-		$author_avatar = get_avatar( $author_id, 80 );
188
-		$author_url = get_author_posts_url( $author_id );
186
+		$author_id = get_the_author_meta('ID');
187
+		$author_avatar = get_avatar($author_id, 80);
188
+		$author_url = get_author_posts_url($author_id);
189 189
 
190 190
 		printf(
191 191
 			'<a href="%1$s" class="post-meta-avatar">%2$s</a>',
192
-			esc_url( $author_url ),
193
-			wp_kses_post( $author_avatar )
192
+			esc_url($author_url),
193
+			wp_kses_post($author_avatar)
194 194
 		);
195 195
 	}
196 196
 
197 197
 endif;
198 198
 
199
-if ( ! function_exists( 'lsx_post_meta_date' ) ) :
199
+if ( ! function_exists('lsx_post_meta_date')) :
200 200
 
201 201
 	/**
202 202
 	 * Add customisable post meta: post date.
@@ -207,23 +207,23 @@  discard block
 block discarded – undo
207 207
 	function lsx_post_meta_date() {
208 208
 		$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
209 209
 
210
-		$time_string = sprintf( $time_string,
211
-			esc_attr( get_the_date( 'c' ) ),
210
+		$time_string = sprintf($time_string,
211
+			esc_attr(get_the_date('c')),
212 212
 			get_the_date(),
213
-			esc_attr( get_the_modified_date( 'c' ) ),
213
+			esc_attr(get_the_modified_date('c')),
214 214
 			get_the_modified_date()
215 215
 		);
216 216
 
217 217
 		printf(
218 218
 			'<span class="post-meta-time updated"><a href="%1$s" rel="bookmark">%2$s</a></span>',
219
-			esc_url( get_permalink() ),
220
-			wp_kses_post( $time_string )
219
+			esc_url(get_permalink()),
220
+			wp_kses_post($time_string)
221 221
 		);
222 222
 	}
223 223
 
224 224
 endif;
225 225
 
226
-if ( ! function_exists( 'lsx_post_meta_author' ) ) :
226
+if ( ! function_exists('lsx_post_meta_author')) :
227 227
 
228 228
 	/**
229 229
 	 * Add customisable post meta: post author.
@@ -233,27 +233,27 @@  discard block
 block discarded – undo
233 233
 	 */
234 234
 	function lsx_post_meta_author() {
235 235
 		$author = get_the_author();
236
-		$author_url = get_author_posts_url( get_the_author_meta( 'ID' ) );
236
+		$author_url = get_author_posts_url(get_the_author_meta('ID'));
237 237
 
238
-		if ( empty( $author ) ) {
238
+		if (empty($author)) {
239 239
 			global $post;
240 240
 
241
-			$author = get_user_by( 'ID', $post->post_author );
241
+			$author = get_user_by('ID', $post->post_author);
242 242
 			$author = $author->display_name;
243
-			$author_url = get_author_posts_url( $post->post_author );
243
+			$author_url = get_author_posts_url($post->post_author);
244 244
 		}
245 245
 
246 246
 		printf(
247 247
 			'<span class="vcard post-meta-author"><span>%1$s</span> <span class="fn"><a href="%2$s">%3$s</a>, </span></span>',
248
-			esc_html__( 'By ', 'lsx' ),
249
-			esc_url( $author_url ),
250
-			esc_html( $author )
248
+			esc_html__('By ', 'lsx'),
249
+			esc_url($author_url),
250
+			esc_html($author)
251 251
 		);
252 252
 	}
253 253
 
254 254
 endif;
255 255
 
256
-if ( ! function_exists( 'lsx_post_meta_category' ) ) :
256
+if ( ! function_exists('lsx_post_meta_category')) :
257 257
 
258 258
 	/**
259 259
 	 * Add customisable post meta: post category(ies).
@@ -262,25 +262,25 @@  discard block
 block discarded – undo
262 262
 	 * @subpackage template-tags
263 263
 	 */
264 264
 	function lsx_post_meta_category() {
265
-		$post_categories = wp_get_post_categories( get_the_ID() );
265
+		$post_categories = wp_get_post_categories(get_the_ID());
266 266
 		$cats = array();
267 267
 
268
-		foreach ( $post_categories as $c ) {
269
-			$cat = get_category( $c );
268
+		foreach ($post_categories as $c) {
269
+			$cat = get_category($c);
270 270
 			/* Translators: %s: category name */
271
-			$cats[] = '<a href="' . esc_url( get_category_link( $cat->term_id ) ) . '" title="' . sprintf( esc_html__( 'View all posts in %s' , 'lsx' ), $cat->name ) . '">' . $cat->name . '</a>';
271
+			$cats[] = '<a href="' . esc_url(get_category_link($cat->term_id)) . '" title="' . sprintf(esc_html__('View all posts in %s', 'lsx'), $cat->name) . '">' . $cat->name . '</a>';
272 272
 		}
273 273
 
274
-		if ( ! empty( $cats ) ) {
274
+		if ( ! empty($cats)) {
275 275
 			?>
276
-			<span class="post-meta-categories"><span><?php esc_html_e( 'Posted in: ', 'lsx' ); ?></span> <?php echo wp_kses_post( implode( ', ', $cats ) ); ?></span>
276
+			<span class="post-meta-categories"><span><?php esc_html_e('Posted in: ', 'lsx'); ?></span> <?php echo wp_kses_post(implode(', ', $cats)); ?></span>
277 277
 			<?php
278 278
 		}
279 279
 	}
280 280
 
281 281
 endif;
282 282
 
283
-if ( ! function_exists( 'lsx_post_tags' ) ) :
283
+if ( ! function_exists('lsx_post_tags')) :
284 284
 
285 285
 	/**
286 286
 	 * Add customisable post meta: post tag(s).
@@ -289,10 +289,10 @@  discard block
 block discarded – undo
289 289
 	 * @subpackage template-tags
290 290
 	 */
291 291
 	function lsx_post_tags() {
292
-		if ( has_tag() ) :
292
+		if (has_tag()) :
293 293
 			?>
294 294
 			<div class="post-tags">
295
-				<span><?php echo esc_html__( 'Tags: ', 'lsx' ); ?></span><?php echo wp_kses_post( get_the_tag_list( '' ) ); ?>
295
+				<span><?php echo esc_html__('Tags: ', 'lsx'); ?></span><?php echo wp_kses_post(get_the_tag_list('')); ?>
296 296
 			</div>
297 297
 			<?php
298 298
 		endif;
@@ -300,9 +300,9 @@  discard block
 block discarded – undo
300 300
 
301 301
 endif;
302 302
 
303
-add_action( 'lsx_content_post_tags', 'lsx_post_tags', 10 );
303
+add_action('lsx_content_post_tags', 'lsx_post_tags', 10);
304 304
 
305
-if ( ! function_exists( 'lsx_sharing_output' ) ) :
305
+if ( ! function_exists('lsx_sharing_output')) :
306 306
 
307 307
 	/**
308 308
 	 * Display sharing buttons.
@@ -312,14 +312,14 @@  discard block
 block discarded – undo
312 312
 	 */
313 313
 	function lsx_sharing_output() {
314 314
 		global $lsx_sharing;
315
-		echo wp_kses_post( $lsx_sharing->sharing_buttons() );
315
+		echo wp_kses_post($lsx_sharing->sharing_buttons());
316 316
 	}
317 317
 
318 318
 endif;
319 319
 
320
-add_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 );
320
+add_action('lsx_content_sharing', 'lsx_sharing_output', 20);
321 321
 
322
-if ( ! function_exists( 'lsx_translate_format_to_fontawesome' ) ) :
322
+if ( ! function_exists('lsx_translate_format_to_fontawesome')) :
323 323
 
324 324
 	/**
325 325
 	 * Translate post format to Font Awesome class.
@@ -327,8 +327,8 @@  discard block
 block discarded – undo
327 327
 	 * @package    lsx
328 328
 	 * @subpackage template-tags
329 329
 	 */
330
-	function lsx_translate_format_to_fontawesome( $format ) {
331
-		switch ( $format ) {
330
+	function lsx_translate_format_to_fontawesome($format) {
331
+		switch ($format) {
332 332
 			case 'image':
333 333
 				$format = 'camera';
334 334
 				break;
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 
361 361
 endif;
362 362
 
363
-if ( ! function_exists( 'lsx_paging_nav' ) ) :
363
+if ( ! function_exists('lsx_paging_nav')) :
364 364
 
365 365
 	/**
366 366
 	 * Display navigation to next/previous set of posts when applicable.
@@ -371,37 +371,37 @@  discard block
 block discarded – undo
371 371
 	function lsx_paging_nav() {
372 372
 		global $wp_query;
373 373
 
374
-		if ( $wp_query->max_num_pages < 2 ) {
374
+		if ($wp_query->max_num_pages < 2) {
375 375
 			return;
376 376
 		}
377 377
 
378
-		if ( true === apply_filters( 'lsx_paging_nav_disable', false ) ) {
378
+		if (true === apply_filters('lsx_paging_nav_disable', false)) {
379 379
 			return true;
380
-		} elseif ( current_theme_supports( 'infinite-scroll' ) && class_exists( 'The_Neverending_Home_Page' ) ) {
380
+		} elseif (current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')) {
381 381
 			return true;
382 382
 		} else {
383 383
 			$html = '';
384 384
 			$html .= '<div class="lsx-pagination-wrapper">' . PHP_EOL;
385 385
 			$html .= '<div class="lsx-breaker"></div>' . PHP_EOL;
386 386
 			$html .= '<div class="lsx-pagination">' . PHP_EOL;
387
-			$html .= paginate_links( array(
388
-				'base'               => str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ),
387
+			$html .= paginate_links(array(
388
+				'base'               => str_replace(999999999, '%#%', esc_url(get_pagenum_link(999999999))),
389 389
 				'format'             => '?paged=%#%',
390 390
 				'total'              => $wp_query->max_num_pages,
391
-				'current'            => max( 1, intval( get_query_var( 'paged' ) ) ),
392
-				'prev_text'          => '<span class="meta-nav">&larr;</span> ' . esc_html__( 'Previous', 'lsx' ),
393
-				'next_text'          => esc_html__( 'Next', 'lsx' ) . ' <span class="meta-nav">&rarr;</span>',
394
-			) );
391
+				'current'            => max(1, intval(get_query_var('paged'))),
392
+				'prev_text'          => '<span class="meta-nav">&larr;</span> ' . esc_html__('Previous', 'lsx'),
393
+				'next_text'          => esc_html__('Next', 'lsx') . ' <span class="meta-nav">&rarr;</span>',
394
+			));
395 395
 			$html .= '</div>' . PHP_EOL;
396 396
 			$html .= '</div>' . PHP_EOL;
397 397
 
398
-			echo wp_kses_post( $html );
398
+			echo wp_kses_post($html);
399 399
 		}
400 400
 	}
401 401
 
402 402
 endif;
403 403
 
404
-if ( ! function_exists( 'lsx_post_nav' ) ) :
404
+if ( ! function_exists('lsx_post_nav')) :
405 405
 
406 406
 	/**
407 407
 	 * Display navigation to next/previous post when applicable.
@@ -410,24 +410,24 @@  discard block
 block discarded – undo
410 410
 	 * @subpackage template-tags
411 411
 	 */
412 412
 	function lsx_post_nav() {
413
-		$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
414
-		$next     = get_adjacent_post( false, '', false );
413
+		$previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true);
414
+		$next     = get_adjacent_post(false, '', false);
415 415
 
416
-		if ( ! $next && ! $previous ) {
416
+		if ( ! $next && ! $previous) {
417 417
 			return;
418 418
 		}
419 419
 
420 420
 		$default_size = 'sm';
421
-		$size         = apply_filters( 'lsx_bootstrap_column_size', $default_size );
421
+		$size         = apply_filters('lsx_bootstrap_column_size', $default_size);
422 422
 		?>
423 423
 		<nav class="navigation post-navigation" role="navigation">
424 424
 			<div class="lsx-breaker"></div>
425 425
 			<div class="nav-links pager row">
426
-				<div class="previous <?php echo 'col-' . esc_attr( $size ) . '-6'; ?>">
427
-					<?php previous_post_link( '%link', '<p class="nav-links-description">' . esc_html_x( 'Previous Post', 'Previous post link', 'lsx' ) . '</p><h3>%title</h3>' ); ?>
426
+				<div class="previous <?php echo 'col-' . esc_attr($size) . '-6'; ?>">
427
+					<?php previous_post_link('%link', '<p class="nav-links-description">' . esc_html_x('Previous Post', 'Previous post link', 'lsx') . '</p><h3>%title</h3>'); ?>
428 428
 				</div>
429
-				<div class="next <?php echo 'col-' . esc_attr( $size ) . '-6'; ?>">
430
-					<?php next_post_link( '%link', '<p class="nav-links-description">' . esc_html_x( 'Next Post', 'Next post link', 'lsx' ) . '</p><h3>%title</h3>' ); ?>
429
+				<div class="next <?php echo 'col-' . esc_attr($size) . '-6'; ?>">
430
+					<?php next_post_link('%link', '<p class="nav-links-description">' . esc_html_x('Next Post', 'Next post link', 'lsx') . '</p><h3>%title</h3>'); ?>
431 431
 				</div>
432 432
 			</div><!-- .nav-links -->
433 433
 		</nav><!-- .navigation -->
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 
437 437
 endif;
438 438
 
439
-if ( ! function_exists( 'lsx_site_identity' ) ) :
439
+if ( ! function_exists('lsx_site_identity')) :
440 440
 
441 441
 	/**
442 442
 	 * Outputs either the Site Title or the Site Logo.
@@ -445,10 +445,10 @@  discard block
 block discarded – undo
445 445
 	 * @subpackage template-tags
446 446
 	 */
447 447
 	function lsx_site_identity() {
448
-		if ( function_exists( 'has_custom_logo' ) && has_custom_logo() ) {
448
+		if (function_exists('has_custom_logo') && has_custom_logo()) {
449 449
 			the_custom_logo();
450 450
 		} else {
451
-			if ( get_theme_mod( 'site_logo_header_text', 1 ) ) {
451
+			if (get_theme_mod('site_logo_header_text', 1)) {
452 452
 				lsx_site_title();
453 453
 			}
454 454
 		}
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 
457 457
 endif;
458 458
 
459
-if ( ! function_exists( 'lsx_navbar_header' ) ) :
459
+if ( ! function_exists('lsx_navbar_header')) :
460 460
 	/**
461 461
 	 * Outputs the Nav Menu.
462 462
 	 *
@@ -467,17 +467,17 @@  discard block
 block discarded – undo
467 467
 		?>
468 468
 		<div class="navbar-header" itemscope itemtype="http://schema.org/WebPage">
469 469
 			<?php
470
-				if ( has_nav_menu( 'primary' ) ) :
470
+				if (has_nav_menu('primary')) :
471 471
 					?>
472 472
 					<div class="wrapper-toggle" data-toggle="collapse" data-target=".primary-navbar">
473 473
 						<button type="button" class="navbar-toggle">
474
-							<span class="sr-only"><?php esc_html_e( 'Toggle navigation', 'lsx' ); ?></span>
474
+							<span class="sr-only"><?php esc_html_e('Toggle navigation', 'lsx'); ?></span>
475 475
 							<span class="icon-bar"></span>
476 476
 							<span class="icon-bar"></span>
477 477
 							<span class="icon-bar"></span>
478 478
 							<span class="icon-bar"></span>
479 479
 						</button>
480
-						<span class="mobile-menu-title"><?php esc_html_e( 'Menu', 'lsx' ); ?></span>
480
+						<span class="mobile-menu-title"><?php esc_html_e('Menu', 'lsx'); ?></span>
481 481
 					</div>
482 482
 					<?php
483 483
 				endif;
@@ -490,9 +490,9 @@  discard block
 block discarded – undo
490 490
 
491 491
 endif;
492 492
 
493
-add_action( 'lsx_nav_before', 'lsx_navbar_header' );
493
+add_action('lsx_nav_before', 'lsx_navbar_header');
494 494
 
495
-if ( ! function_exists( 'lsx_nav_menu' ) ) :
495
+if ( ! function_exists('lsx_nav_menu')) :
496 496
 	/**
497 497
 	 * Outputs the Nav Menu.
498 498
 	 *
@@ -500,17 +500,17 @@  discard block
 block discarded – undo
500 500
 	 * @subpackage template-tags
501 501
 	 */
502 502
 	function lsx_nav_menu() {
503
-		if ( has_nav_menu( 'primary' ) ) :
503
+		if (has_nav_menu('primary')) :
504 504
 			?>
505 505
 			<nav class="primary-navbar collapse navbar-collapse">
506 506
 				<?php
507
-					wp_nav_menu( array(
507
+					wp_nav_menu(array(
508 508
 						'theme_location' => 'primary',
509 509
 						'depth'          => 3,
510 510
 						'container'      => false,
511 511
 						'menu_class'     => 'nav navbar-nav',
512 512
 						'walker'         => new LSX_Bootstrap_Navwalker(),
513
-					) );
513
+					));
514 514
 				?>
515 515
 			</nav>
516 516
 			<?php
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 	}
519 519
 endif;
520 520
 
521
-if ( ! function_exists( 'lsx_sitemap_loops' ) ) {
521
+if ( ! function_exists('lsx_sitemap_loops')) {
522 522
 	/**
523 523
 	 * Outputs the loops on the sitemap
524 524
 	 *
@@ -526,18 +526,18 @@  discard block
 block discarded – undo
526 526
 	 * @subpackage template-tags
527 527
 	 */
528 528
 	function lsx_sitemap_loops() {
529
-		$sitemap_loops  = array(
529
+		$sitemap_loops = array(
530 530
 			'page'     => array(
531 531
 				'type'  => 'post_type',
532
-				'label' => __( 'Pages', 'lsx' ),
532
+				'label' => __('Pages', 'lsx'),
533 533
 			),
534 534
 			'post'     => array(
535 535
 				'type'  => 'post_type',
536
-				'label' => __( 'Posts', 'lsx' ),
536
+				'label' => __('Posts', 'lsx'),
537 537
 			),
538 538
 			'category' => array(
539 539
 				'type'  => 'taxonomy',
540
-				'label' => __( 'Categories', 'lsx' ),
540
+				'label' => __('Categories', 'lsx'),
541 541
 			),
542 542
 		);
543 543
 		$post_type_args = array(
@@ -545,41 +545,41 @@  discard block
 block discarded – undo
545 545
 			'_builtin' => false,
546 546
 			'show_ui'  => true,
547 547
 		);
548
-		$post_types     = get_post_types( $post_type_args, 'objects' );
549
-		if ( ! empty( $post_types ) ) {
550
-			foreach ( $post_types as $post_type_key => $post_type_obj ) {
551
-				$sitemap_loops[ $post_type_key ] = array(
548
+		$post_types = get_post_types($post_type_args, 'objects');
549
+		if ( ! empty($post_types)) {
550
+			foreach ($post_types as $post_type_key => $post_type_obj) {
551
+				$sitemap_loops[$post_type_key] = array(
552 552
 					'type'  => 'post_type',
553 553
 					'label' => $post_type_obj->label,
554 554
 				);
555 555
 			}
556 556
 		}
557
-		$taxonomy_args  = array(
557
+		$taxonomy_args = array(
558 558
 			'public'   => true,
559 559
 			'_builtin' => false,
560 560
 			'show_ui'  => true,
561 561
 		);
562
-		$taxonomies     = get_taxonomies( $taxonomy_args, 'objects' );
563
-		if ( ! empty( $taxonomies ) ) {
564
-			foreach ( $taxonomies as $tax_key => $tax_obj ) {
565
-				$sitemap_loops[ $tax_key ] = array(
562
+		$taxonomies = get_taxonomies($taxonomy_args, 'objects');
563
+		if ( ! empty($taxonomies)) {
564
+			foreach ($taxonomies as $tax_key => $tax_obj) {
565
+				$sitemap_loops[$tax_key] = array(
566 566
 					'type'  => 'taxonomy',
567 567
 					'label' => $tax_obj->label,
568 568
 				);
569 569
 			}
570 570
 		}
571
-		$sitemap_loops = apply_filters( 'lsx_sitemap_loops_list', $sitemap_loops );
572
-		foreach ( $sitemap_loops as $sitemap_key => $sitemap_values ) {
573
-			if ( 'post_type' === $sitemap_values['type'] ) {
574
-				lsx_sitemap_custom_post_type( $sitemap_key, $sitemap_values['label'] );
571
+		$sitemap_loops = apply_filters('lsx_sitemap_loops_list', $sitemap_loops);
572
+		foreach ($sitemap_loops as $sitemap_key => $sitemap_values) {
573
+			if ('post_type' === $sitemap_values['type']) {
574
+				lsx_sitemap_custom_post_type($sitemap_key, $sitemap_values['label']);
575 575
 			} else {
576
-				lsx_sitemap_taxonomy( $sitemap_key, $sitemap_values['label'] );
576
+				lsx_sitemap_taxonomy($sitemap_key, $sitemap_values['label']);
577 577
 			}
578 578
 		}
579 579
 	}
580 580
 }
581 581
 
582
-if ( ! function_exists( 'lsx_sitemap_pages' ) ) :
582
+if ( ! function_exists('lsx_sitemap_pages')) :
583 583
 
584 584
 	/**
585 585
 	 * Outputs Pages for the Sitemap Template.
@@ -595,15 +595,15 @@  discard block
 block discarded – undo
595 595
 			'post_type'      => 'page',
596 596
 		);
597 597
 
598
-		$pages = new WP_Query( $page_args );
598
+		$pages = new WP_Query($page_args);
599 599
 
600
-		if ( $pages->have_posts() ) {
601
-			echo '<h2>' . esc_html__( 'Pages', 'lsx' ) . '</h2>';
600
+		if ($pages->have_posts()) {
601
+			echo '<h2>' . esc_html__('Pages', 'lsx') . '</h2>';
602 602
 			echo '<ul>';
603 603
 
604
-			while ( $pages->have_posts() ) {
604
+			while ($pages->have_posts()) {
605 605
 				$pages->the_post();
606
-				echo '<li class="page_item page-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>';
606
+				echo '<li class="page_item page-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>';
607 607
 			}
608 608
 
609 609
 			echo '</ul>';
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 
614 614
 endif;
615 615
 
616
-if ( ! function_exists( 'lsx_sitemap_custom_post_type' ) ) :
616
+if ( ! function_exists('lsx_sitemap_custom_post_type')) :
617 617
 
618 618
 	/**
619 619
 	 * Outputs a custom post type section.
@@ -621,18 +621,18 @@  discard block
 block discarded – undo
621 621
 	 * @package    lsx
622 622
 	 * @subpackage template-tags
623 623
 	 */
624
-	function lsx_sitemap_custom_post_type( $forced_type = '', $label = '' ) {
625
-		if ( '' !== $forced_type ) {
626
-			$post_types = array( $forced_type );
624
+	function lsx_sitemap_custom_post_type($forced_type = '', $label = '') {
625
+		if ('' !== $forced_type) {
626
+			$post_types = array($forced_type);
627 627
 		} else {
628 628
 			$args = array(
629 629
 				'public'   => true,
630 630
 				'_builtin' => false,
631 631
 			);
632
-			$post_types = get_post_types( $args, 'names' );
632
+			$post_types = get_post_types($args, 'names');
633 633
 		}
634 634
 
635
-		foreach ( $post_types as $post_type ) {
635
+		foreach ($post_types as $post_type) {
636 636
 			$post_type_args = array(
637 637
 				'post_type'      => 'page',
638 638
 				'posts_per_page' => 99,
@@ -640,24 +640,24 @@  discard block
 block discarded – undo
640 640
 				'post_type'      => $post_type,
641 641
 			);
642 642
 
643
-			$post_type_items  = new WP_Query( $post_type_args );
644
-			$post_type_object = get_post_type_object( $post_type );
643
+			$post_type_items  = new WP_Query($post_type_args);
644
+			$post_type_object = get_post_type_object($post_type);
645 645
 
646
-			if ( '' !== $label ) {
646
+			if ('' !== $label) {
647 647
 				$title = $label;
648
-			} elseif ( ! empty( $post_type_object ) ) {
648
+			} elseif ( ! empty($post_type_object)) {
649 649
 				$title = $post_type_object->labels->name;
650 650
 			} else {
651
-				$title = ucwords( $post_type );
651
+				$title = ucwords($post_type);
652 652
 			}
653 653
 
654
-			if ( $post_type_items->have_posts() ) {
655
-				echo '<h2>' . esc_html( $title ) . '</h2>';
654
+			if ($post_type_items->have_posts()) {
655
+				echo '<h2>' . esc_html($title) . '</h2>';
656 656
 				echo '<ul>';
657 657
 
658
-				while ( $post_type_items->have_posts() ) {
658
+				while ($post_type_items->have_posts()) {
659 659
 					$post_type_items->the_post();
660
-					echo '<li class="' . esc_attr( get_post_type() ) . '_item ' . esc_attr( get_post_type() ) . '-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>';
660
+					echo '<li class="' . esc_attr(get_post_type()) . '_item ' . esc_attr(get_post_type()) . '-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>';
661 661
 				}
662 662
 
663 663
 				echo '</ul>';
@@ -673,24 +673,24 @@  discard block
 block discarded – undo
673 673
  *
674 674
  * @return void
675 675
  */
676
-function lsx_sitemap_taxonomy( $taxonomy = '', $label = '' ) {
677
-	if ( '' !== $taxonomy ) {
678
-		$terms = get_terms( $taxonomy );
679
-		if ( ! empty( $terms ) ) {
676
+function lsx_sitemap_taxonomy($taxonomy = '', $label = '') {
677
+	if ('' !== $taxonomy) {
678
+		$terms = get_terms($taxonomy);
679
+		if ( ! empty($terms)) {
680 680
 
681
-			if ( '' !== $label ) {
681
+			if ('' !== $label) {
682 682
 				$title = $label;
683 683
 			} else {
684
-				$title = ucwords( $taxonomy );
684
+				$title = ucwords($taxonomy);
685 685
 			}
686 686
 
687 687
 			echo '<div class="sitemap-rows">';
688
-			echo '<h2>' . wp_kses_post( $title ) . '</h2>';
688
+			echo '<h2>' . wp_kses_post($title) . '</h2>';
689 689
 			echo '<ul>';
690
-			foreach ( $terms as $term ) {
690
+			foreach ($terms as $term) {
691 691
 				$name = $term->name;
692
-				$permalink = get_term_link( $term->term_id );
693
-				echo '<li><a href="' . esc_attr( $permalink ) . '">' . esc_attr( $name ) . '</a></li>';
692
+				$permalink = get_term_link($term->term_id);
693
+				echo '<li><a href="' . esc_attr($permalink) . '">' . esc_attr($name) . '</a></li>';
694 694
 			}
695 695
 			echo '</ul>';
696 696
 			echo '</div>';
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 	}
699 699
 }
700 700
 
701
-if ( ! function_exists( 'lsx_sitemap_taxonomy_clouds' ) ) :
701
+if ( ! function_exists('lsx_sitemap_taxonomy_clouds')) :
702 702
 
703 703
 	/**
704 704
 	 * Outputs the public taxonomies.
@@ -712,18 +712,18 @@  discard block
 block discarded – undo
712 712
 			'_builtin' => false,
713 713
 		);
714 714
 
715
-		$taxonomies = get_taxonomies( $taxonomy_args );
715
+		$taxonomies = get_taxonomies($taxonomy_args);
716 716
 
717
-		if ( ! empty( $taxonomies ) ) {
718
-			foreach ( $taxonomies as $taxonomy_id => $taxonomy ) {
719
-				$tag_cloud = wp_tag_cloud( array(
717
+		if ( ! empty($taxonomies)) {
718
+			foreach ($taxonomies as $taxonomy_id => $taxonomy) {
719
+				$tag_cloud = wp_tag_cloud(array(
720 720
 					'taxonomy' => $taxonomy_id,
721 721
 					'echo'     => false,
722
-				) );
722
+				));
723 723
 
724
-				if ( ! empty( $tag_cloud ) ) {
725
-					echo '<h2>' . esc_html( $taxonomy ) . '</h2>';
726
-					echo '<aside id="' . esc_attr( $taxonomy_id ) . '" class="widget widget_' . esc_attr( $taxonomy_id ) . '">' . esc_html( $tag_cloud ) . '</aside>';
724
+				if ( ! empty($tag_cloud)) {
725
+					echo '<h2>' . esc_html($taxonomy) . '</h2>';
726
+					echo '<aside id="' . esc_attr($taxonomy_id) . '" class="widget widget_' . esc_attr($taxonomy_id) . '">' . esc_html($tag_cloud) . '</aside>';
727 727
 				}
728 728
 			}
729 729
 		}
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 
732 732
 endif;
733 733
 
734
-if ( ! function_exists( 'lsx_add_top_menu' ) ) :
734
+if ( ! function_exists('lsx_add_top_menu')) :
735 735
 
736 736
 	/**
737 737
 	 * Adds our top menu to the theme.
@@ -740,28 +740,28 @@  discard block
 block discarded – undo
740 740
 	 * @subpackage template-tags
741 741
 	 */
742 742
 	function lsx_add_top_menu() {
743
-		if ( has_nav_menu( 'top-menu' ) || has_nav_menu( 'top-menu-left' ) ) :
743
+		if (has_nav_menu('top-menu') || has_nav_menu('top-menu-left')) :
744 744
 			?>
745 745
 			<div id="top-menu" class="<?php lsx_top_menu_classes(); ?>">
746 746
 				<div class="container">
747
-					<?php if ( has_nav_menu( 'top-menu' ) ) : ?>
747
+					<?php if (has_nav_menu('top-menu')) : ?>
748 748
 						<nav class="top-menu">
749 749
 							<?php
750
-								wp_nav_menu( array(
750
+								wp_nav_menu(array(
751 751
 									'theme_location' => 'top-menu',
752 752
 									'walker'         => new LSX_Bootstrap_Navwalker(),
753
-								) );
753
+								));
754 754
 							?>
755 755
 						</nav>
756 756
 					<?php endif; ?>
757 757
 
758
-					<?php if ( has_nav_menu( 'top-menu-left' ) ) : ?>
758
+					<?php if (has_nav_menu('top-menu-left')) : ?>
759 759
 						<nav class="top-menu pull-left">
760 760
 							<?php
761
-								wp_nav_menu( array(
761
+								wp_nav_menu(array(
762 762
 									'theme_location' => 'top-menu-left',
763 763
 									'walker'         => new LSX_Bootstrap_Navwalker(),
764
-								) );
764
+								));
765 765
 							?>
766 766
 						</nav>
767 767
 					<?php endif; ?>
@@ -773,9 +773,9 @@  discard block
 block discarded – undo
773 773
 
774 774
 endif;
775 775
 
776
-add_action( 'lsx_header_before', 'lsx_add_top_menu' );
776
+add_action('lsx_header_before', 'lsx_add_top_menu');
777 777
 
778
-if ( ! function_exists( 'lsx_get_my_url' ) ) :
778
+if ( ! function_exists('lsx_get_my_url')) :
779 779
 
780 780
 	/**
781 781
 	 * Return URL from a link in the content.
@@ -784,11 +784,11 @@  discard block
 block discarded – undo
784 784
 	 * @subpackage template-tags
785 785
 	 */
786 786
 	function lsx_get_my_url() {
787
-		if ( ! preg_match( '/^<a\s[^>]*?href=[\'"](.+?)[\'"]$/is', get_the_content(), $matches ) ) {
787
+		if ( ! preg_match('/^<a\s[^>]*?href=[\'"](.+?)[\'"]$/is', get_the_content(), $matches)) {
788 788
 			return false;
789 789
 		}
790 790
 
791
-		return esc_url_raw( $matches[1] );
791
+		return esc_url_raw($matches[1]);
792 792
 	}
793 793
 
794 794
 endif;
Please login to merge, or discard this patch.
includes/deprecated.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * @subpackage deprecated
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
Please login to merge, or discard this patch.
includes/scripts.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @subpackage scripts
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_scripts' ) ) :
13
+if ( ! function_exists('lsx_scripts')) :
14 14
 
15 15
 	/**
16 16
 	 * Enqueue scripts, fonts and styles.
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 
27 27
 endif;
28 28
 
29
-add_action( 'wp_enqueue_scripts', 'lsx_scripts', 5 );
29
+add_action('wp_enqueue_scripts', 'lsx_scripts', 5);
30 30
 
31
-if ( ! function_exists( 'lsx_admin_scripts' ) ) :
31
+if ( ! function_exists('lsx_admin_scripts')) :
32 32
 
33 33
 	/**
34 34
 	 * Enqueue scripts (admin).
@@ -37,14 +37,14 @@  discard block
 block discarded – undo
37 37
 	 * @subpackage scripts
38 38
 	 */
39 39
 	function lsx_admin_scripts() {
40
-		wp_enqueue_script( 'lsx-admin', get_template_directory_uri() . '/assets/js/admin/lsx-admin.js', array( 'jquery' ), LSX_VERSION, true );
40
+		wp_enqueue_script('lsx-admin', get_template_directory_uri() . '/assets/js/admin/lsx-admin.js', array('jquery'), LSX_VERSION, true);
41 41
 	}
42 42
 
43 43
 endif;
44 44
 
45
-add_action( 'admin_enqueue_scripts', 'lsx_admin_scripts' );
45
+add_action('admin_enqueue_scripts', 'lsx_admin_scripts');
46 46
 
47
-if ( ! function_exists( 'lsx_scripts_add_styles' ) ) :
47
+if ( ! function_exists('lsx_scripts_add_styles')) :
48 48
 
49 49
 	/**
50 50
 	 * Enqueue styles.
@@ -53,23 +53,23 @@  discard block
 block discarded – undo
53 53
 	 * @subpackage scripts
54 54
 	 */
55 55
 	function lsx_scripts_add_styles() {
56
-		wp_enqueue_style( 'lsx_fonts', get_template_directory_uri() . '/assets/css/lsx-fonts.css', array(), LSX_VERSION );
56
+		wp_enqueue_style('lsx_fonts', get_template_directory_uri() . '/assets/css/lsx-fonts.css', array(), LSX_VERSION);
57 57
 
58
-		wp_register_style( 'fontawesome', get_template_directory_uri() . '/assets/css/vendor/font-awesome.css', array(), LSX_VERSION );
59
-		wp_style_add_data( 'fontawesome', 'rtl', 'replace' );
58
+		wp_register_style('fontawesome', get_template_directory_uri() . '/assets/css/vendor/font-awesome.css', array(), LSX_VERSION);
59
+		wp_style_add_data('fontawesome', 'rtl', 'replace');
60 60
 
61
-		wp_register_style( 'bootstrap', get_template_directory_uri() . '/assets/css/vendor/bootstrap.css', array(), LSX_VERSION );
62
-		wp_style_add_data( 'bootstrap', 'rtl', 'replace' );
61
+		wp_register_style('bootstrap', get_template_directory_uri() . '/assets/css/vendor/bootstrap.css', array(), LSX_VERSION);
62
+		wp_style_add_data('bootstrap', 'rtl', 'replace');
63 63
 
64
-		wp_enqueue_style( 'lsx_main', get_template_directory_uri() . '/assets/css/lsx.css', array( 'lsx_fonts', 'fontawesome', 'bootstrap'/*, 'slick'*/ ), LSX_VERSION );
65
-		wp_enqueue_style( 'lsx_gutenberg', get_template_directory_uri() . '/assets/css/gutenberg.css', array( 'lsx_main' ), LSX_VERSION );
64
+		wp_enqueue_style('lsx_main', get_template_directory_uri() . '/assets/css/lsx.css', array('lsx_fonts', 'fontawesome', 'bootstrap'/*, 'slick'*/), LSX_VERSION);
65
+		wp_enqueue_style('lsx_gutenberg', get_template_directory_uri() . '/assets/css/gutenberg.css', array('lsx_main'), LSX_VERSION);
66 66
 
67
-		wp_style_add_data( 'lsx_main', 'rtl', 'replace' );
67
+		wp_style_add_data('lsx_main', 'rtl', 'replace');
68 68
 	}
69 69
 
70 70
 endif;
71 71
 
72
-if ( ! function_exists( 'lsx_scripts_add_fonts' ) ) :
72
+if ( ! function_exists('lsx_scripts_add_fonts')) :
73 73
 	/**
74 74
 	 * Enqueue fonts.
75 75
 	 *
@@ -77,14 +77,14 @@  discard block
 block discarded – undo
77 77
 	 * @subpackage scripts
78 78
 	 */
79 79
 	function lsx_scripts_add_fonts() {
80
-		$disable_fonts = get_theme_mod( 'lsx_disable_fonts', false );
81
-		if ( false !== $disable_fonts ) {
80
+		$disable_fonts = get_theme_mod('lsx_disable_fonts', false);
81
+		if (false !== $disable_fonts) {
82 82
 			return;
83 83
 		}
84 84
 	}
85 85
 endif;
86 86
 
87
-if ( ! function_exists( 'lsx_scripts_add_scripts' ) ) :
87
+if ( ! function_exists('lsx_scripts_add_scripts')) :
88 88
 
89 89
 	/**
90 90
 	 * Enqueue scripts.
@@ -93,38 +93,38 @@  discard block
 block discarded – undo
93 93
 	 * @subpackage scripts
94 94
 	 */
95 95
 	function lsx_scripts_add_scripts() {
96
-		if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
97
-			wp_enqueue_script( 'comment-reply' );
96
+		if (is_singular() && comments_open() && get_option('thread_comments')) {
97
+			wp_enqueue_script('comment-reply');
98 98
 		}
99 99
 
100
-		wp_enqueue_script( 'platform', get_template_directory_uri() . '/assets/js/vendor/platform.min.js', array(), LSX_VERSION, true );
101
-		wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/js/vendor/bootstrap.min.js', array( 'jquery' ), LSX_VERSION, true );
100
+		wp_enqueue_script('platform', get_template_directory_uri() . '/assets/js/vendor/platform.min.js', array(), LSX_VERSION, true);
101
+		wp_enqueue_script('bootstrap', get_template_directory_uri() . '/assets/js/vendor/bootstrap.min.js', array('jquery'), LSX_VERSION, true);
102 102
 
103
-		wp_enqueue_script( 'imagesLoaded', get_template_directory_uri() . '/assets/js/vendor/imagesloaded.pkgd.min.js', array( 'masonry' ), LSX_VERSION, true );
104
-		wp_enqueue_script( 'scrolltofixed', get_template_directory_uri() . '/assets/js/vendor/jquery-scrolltofixed-min.js', array( 'jquery' ), LSX_VERSION, true );
105
-		wp_enqueue_script( 'slick', get_template_directory_uri() . '/assets/js/vendor/slick.min.js', array( 'jquery' ), LSX_VERSION, true );
106
-		wp_enqueue_script( 'slick-lightbox', get_template_directory_uri() . '/assets/js/vendor/slick-lightbox.min.js', array( 'jquery', 'slick' ), LSX_VERSION, true );
107
-		wp_enqueue_script( 'picturefill', get_template_directory_uri() . '/assets/js/vendor/picturefill.min.js', array(), LSX_VERSION, true );
103
+		wp_enqueue_script('imagesLoaded', get_template_directory_uri() . '/assets/js/vendor/imagesloaded.pkgd.min.js', array('masonry'), LSX_VERSION, true);
104
+		wp_enqueue_script('scrolltofixed', get_template_directory_uri() . '/assets/js/vendor/jquery-scrolltofixed-min.js', array('jquery'), LSX_VERSION, true);
105
+		wp_enqueue_script('slick', get_template_directory_uri() . '/assets/js/vendor/slick.min.js', array('jquery'), LSX_VERSION, true);
106
+		wp_enqueue_script('slick-lightbox', get_template_directory_uri() . '/assets/js/vendor/slick-lightbox.min.js', array('jquery', 'slick'), LSX_VERSION, true);
107
+		wp_enqueue_script('picturefill', get_template_directory_uri() . '/assets/js/vendor/picturefill.min.js', array(), LSX_VERSION, true);
108 108
 
109
-		if ( defined( 'SCRIPT_DEBUG' ) ) {
109
+		if (defined('SCRIPT_DEBUG')) {
110 110
 			$prefix = 'src/';
111 111
 			$suffix = '';
112 112
 		} else {
113 113
 			$prefix = '';
114 114
 			$suffix = '.min';
115 115
 		}
116
-		wp_enqueue_script( 'lsx_script', get_template_directory_uri() . '/assets/js/' . $prefix . 'lsx' . $suffix . '.js', array( 'jquery', 'platform', 'bootstrap', 'masonry', 'imagesLoaded', 'scrolltofixed', 'slick', 'slick-lightbox', 'picturefill' ), LSX_VERSION, true );
116
+		wp_enqueue_script('lsx_script', get_template_directory_uri() . '/assets/js/' . $prefix . 'lsx' . $suffix . '.js', array('jquery', 'platform', 'bootstrap', 'masonry', 'imagesLoaded', 'scrolltofixed', 'slick', 'slick-lightbox', 'picturefill'), LSX_VERSION, true);
117 117
 
118 118
 		$param_array = array(
119
-			'columns' => apply_filters( 'lsx_archive_column_number', 3 ),
119
+			'columns' => apply_filters('lsx_archive_column_number', 3),
120 120
 		);
121 121
 
122
-		wp_localize_script( 'lsx_script', 'lsx_params', $param_array );
122
+		wp_localize_script('lsx_script', 'lsx_params', $param_array);
123 123
 	}
124 124
 
125 125
 endif;
126 126
 
127
-if ( ! function_exists( 'lsx_scripts_child_theme' ) ) :
127
+if ( ! function_exists('lsx_scripts_child_theme')) :
128 128
 
129 129
 	/**
130 130
 	 * Enqueue scripts and styles (for child theme).
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
 	 * @subpackage scripts
134 134
 	 */
135 135
 	function lsx_scripts_child_theme() {
136
-		if ( is_child_theme() && file_exists( get_stylesheet_directory() . '/assets/css/custom.css' ) ) {
137
-			wp_enqueue_style( 'child-css', get_stylesheet_directory_uri() . '/assets/css/custom.css', array( 'lsx_main' ), LSX_VERSION );
138
-			wp_style_add_data( 'child-css', 'rtl', 'replace' );
136
+		if (is_child_theme() && file_exists(get_stylesheet_directory() . '/assets/css/custom.css')) {
137
+			wp_enqueue_style('child-css', get_stylesheet_directory_uri() . '/assets/css/custom.css', array('lsx_main'), LSX_VERSION);
138
+			wp_style_add_data('child-css', 'rtl', 'replace');
139 139
 		}
140 140
 	}
141 141
 
142 142
 endif;
143 143
 
144
-add_action( 'wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999 );
144
+add_action('wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999);
Please login to merge, or discard this patch.
includes/customizer.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @subpackage customizer
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_customizer_core_controls' ) ) :
13
+if ( ! function_exists('lsx_customizer_core_controls')) :
14 14
 
15 15
 	/**
16 16
 	 * Returns an array of the core panel.
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
 	 *
21 21
 	 * @return $lsx_controls array()
22 22
 	 */
23
-	function lsx_customizer_core_controls( $lsx_controls ) {
23
+	function lsx_customizer_core_controls($lsx_controls) {
24 24
 		$lsx_controls['sections']['lsx-core'] = array(
25
-			'title'       => esc_html__( 'Core Settings', 'lsx' ),
26
-			'description' => esc_html__( 'Change the core settings.', 'lsx' ),
25
+			'title'       => esc_html__('Core Settings', 'lsx'),
26
+			'description' => esc_html__('Change the core settings.', 'lsx'),
27 27
 			'priority'    => 21,
28 28
 		);
29 29
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		);
35 35
 
36 36
 		$lsx_controls['fields']['lsx_preloader_content_status'] = array(
37
-			'label'   => esc_html__( 'Preloader Content', 'lsx' ),
37
+			'label'   => esc_html__('Preloader Content', 'lsx'),
38 38
 			'section' => 'lsx-core',
39 39
 			'type'    => 'checkbox',
40 40
 		);
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		);
47 47
 
48 48
 		$lsx_controls['fields']['lsx_disable_fonts'] = array(
49
-			'label'   => esc_html__( 'Disable Fonts', 'lsx' ),
49
+			'label'   => esc_html__('Disable Fonts', 'lsx'),
50 50
 			'section' => 'lsx-core',
51 51
 			'type'    => 'checkbox',
52 52
 		);
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
 
57 57
 endif;
58 58
 
59
-add_filter( 'lsx_customizer_controls', 'lsx_customizer_core_controls' );
59
+add_filter('lsx_customizer_controls', 'lsx_customizer_core_controls');
60 60
 
61
-if ( ! function_exists( 'lsx_customizer_layout_controls' ) ) :
61
+if ( ! function_exists('lsx_customizer_layout_controls')) :
62 62
 
63 63
 	/**
64 64
 	 * Returns an array of the layout panel.
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
 	 *
69 69
 	 * @return $lsx_controls array()
70 70
 	 */
71
-	function lsx_customizer_layout_controls( $lsx_controls ) {
71
+	function lsx_customizer_layout_controls($lsx_controls) {
72 72
 		$lsx_controls['sections']['lsx-layout'] = array(
73
-			'title'       => esc_html__( 'Layout', 'lsx' ),
74
-			'description' => esc_html__( 'Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx' ),
73
+			'title'       => esc_html__('Layout', 'lsx'),
74
+			'description' => esc_html__('Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx'),
75 75
 			'priority'    => 22,
76 76
 		);
77 77
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 		);
83 83
 
84 84
 		$lsx_controls['fields']['lsx_header_layout'] = array(
85
-			'label'   => esc_html__( 'Header', 'lsx' ),
85
+			'label'   => esc_html__('Header', 'lsx'),
86 86
 			'section' => 'lsx-layout',
87 87
 			'control' => 'LSX_Customize_Header_Layout_Control',
88 88
 			'choices' => array(
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 		);
100 100
 
101 101
 		$lsx_controls['fields']['lsx_layout'] = array(
102
-			'label'   => esc_html__( 'Body', 'lsx' ),
102
+			'label'   => esc_html__('Body', 'lsx'),
103 103
 			'section' => 'lsx-layout',
104 104
 			'control' => 'LSX_Customize_Layout_Control',
105 105
 			'choices' => array(
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		);
117 117
 
118 118
 		$lsx_controls['fields']['lsx_header_fixed'] = array(
119
-			'label'   => esc_html__( 'Fixed Header', 'lsx' ),
119
+			'label'   => esc_html__('Fixed Header', 'lsx'),
120 120
 			'section' => 'lsx-layout',
121 121
 			'type'    => 'checkbox',
122 122
 		);
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		);
129 129
 
130 130
 		$lsx_controls['fields']['lsx_header_search'] = array(
131
-			'label'   => esc_html__( 'Search Box in Header', 'lsx' ),
131
+			'label'   => esc_html__('Search Box in Header', 'lsx'),
132 132
 			'section' => 'lsx-layout',
133 133
 			'type'    => 'checkbox',
134 134
 		);
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
 		$lsx_controls['selective_refresh']['lsx_header_search'] = array(
137 137
 			'selector'        => '#lsx-header-search-css',
138 138
 			'render_callback' => function() {
139
-				$search_form = get_theme_mod( 'lsx_header_search' );
139
+				$search_form = get_theme_mod('lsx_header_search');
140 140
 
141
-				if ( false !== $search_form ) {
141
+				if (false !== $search_form) {
142 142
 					echo 'body #searchform { display: block; }';
143 143
 				} else {
144 144
 					echo 'body #searchform { display: none; }';
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
 
152 152
 endif;
153 153
 
154
-add_filter( 'lsx_customizer_controls', 'lsx_customizer_layout_controls' );
154
+add_filter('lsx_customizer_controls', 'lsx_customizer_layout_controls');
155 155
 
156
-if ( ! function_exists( 'lsx_get_customizer_controls' ) ) :
156
+if ( ! function_exists('lsx_get_customizer_controls')) :
157 157
 
158 158
 	/**
159 159
 	 * Returns an array of $controls for the customizer class to generate.
@@ -165,10 +165,10 @@  discard block
 block discarded – undo
165 165
 	 */
166 166
 	function lsx_get_customizer_controls() {
167 167
 		$lsx_controls = array();
168
-		$lsx_controls = apply_filters( 'lsx_customizer_controls', $lsx_controls );
168
+		$lsx_controls = apply_filters('lsx_customizer_controls', $lsx_controls);
169 169
 		return $lsx_controls;
170 170
 	}
171 171
 
172 172
 endif;
173 173
 
174
-$lsx_customizer = new LSX_Theme_Customizer( lsx_get_customizer_controls() );
174
+$lsx_customizer = new LSX_Theme_Customizer(lsx_get_customizer_controls());
Please login to merge, or discard this patch.
functions.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,25 +7,25 @@
 block discarded – undo
7 7
  * @package lsx
8 8
  */
9 9
 
10
-if ( ! defined( 'ABSPATH' ) ) {
10
+if ( ! defined('ABSPATH')) {
11 11
 	exit;
12 12
 }
13 13
 
14
-define( 'LSX_VERSION', '2.5.0' );
14
+define('LSX_VERSION', '2.5.0');
15 15
 
16
-if ( class_exists( 'WooCommerce' ) ) {
16
+if (class_exists('WooCommerce')) {
17 17
 	require get_template_directory() . '/includes/plugins/woocommerce.php';
18 18
 }
19 19
 
20
-if ( class_exists( 'Tribe__Events__Main' ) ) {
20
+if (class_exists('Tribe__Events__Main')) {
21 21
 	require get_template_directory() . '/includes/plugins/the-events-calendar.php';
22 22
 }
23 23
 
24
-if ( class_exists( 'Sensei_WC' ) ) {
24
+if (class_exists('Sensei_WC')) {
25 25
 	require get_template_directory() . '/includes/plugins/sensei.php';
26 26
 }
27 27
 
28
-if ( class_exists( 'bbPress' ) ) {
28
+if (class_exists('bbPress')) {
29 29
 	require get_template_directory() . '/includes/plugins/bbpress.php';
30 30
 }
31 31
 
Please login to merge, or discard this patch.
includes/classes/class-lsx-schema-graph-piece.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  *
10 10
  * @since 10.2
11 11
  */
12
-if ( interface_exists( 'WPSEO_Graph_Piece' ) ) {
12
+if (interface_exists('WPSEO_Graph_Piece')) {
13 13
 
14 14
 	class LSX_Schema_Graph_Piece implements WPSEO_Graph_Piece {
15 15
 		/**
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 		 *
54 54
 		 * @param \WPSEO_Schema_Context $context A value object with context variables.
55 55
 		 */
56
-		public function __construct( WPSEO_Schema_Context $context ) {
56
+		public function __construct(WPSEO_Schema_Context $context) {
57 57
 			$this->context      = $context;
58 58
 			$this->place_ids    = array();
59
-			$this->post         = get_post( $this->context->id );
60
-			$this->post_url     = get_permalink( $this->context->id );
59
+			$this->post         = get_post($this->context->id);
60
+			$this->post_url     = get_permalink($this->context->id);
61 61
 			$this->is_top_level = false;
62
-			if ( is_object( $this->post ) && isset( $this->post->post_parent ) && ( false === $this->post->post_parent || 0 === $this->post->post_parent || '' === $this->post->post_parent ) ) {
62
+			if (is_object($this->post) && isset($this->post->post_parent) && (false === $this->post->post_parent || 0 === $this->post->post_parent || '' === $this->post->post_parent)) {
63 63
 				$this->is_top_level = true;
64 64
 			}
65 65
 		}
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
 		 * @return bool
70 70
 		 */
71 71
 		public function is_needed() {
72
-			if ( ! is_singular() ) {
72
+			if ( ! is_singular()) {
73 73
 				return false;
74 74
 			}
75
-			if ( false === $this->context->site_represents ) {
75
+			if (false === $this->context->site_represents) {
76 76
 				return false;
77 77
 			}
78
-			return LSX_Schema_Utils::is_type( get_post_type(), $this->post_type );
78
+			return LSX_Schema_Utils::is_type(get_post_type(), $this->post_type);
79 79
 		}
80 80
 		/**
81 81
 		 * Returns Review data.
@@ -94,32 +94,32 @@  discard block
 block discarded – undo
94 94
 		 * @param  boolean  $include_aggregate
95 95
 		 * @return array    $data
96 96
 		 */
97
-		public function add_reviews( $data, $data_key = 'reviews', $include_aggregate = true ) {
98
-			$reviews       = get_post_meta( $this->context->id, 'review_to_' . $this->post_type, false );
97
+		public function add_reviews($data, $data_key = 'reviews', $include_aggregate = true) {
98
+			$reviews       = get_post_meta($this->context->id, 'review_to_' . $this->post_type, false);
99 99
 			$reviews_array = array();
100
-			if ( ! empty( $reviews ) ) {
100
+			if ( ! empty($reviews)) {
101 101
 				$aggregate_value = 1;
102 102
 				$review_count    = 0;
103
-				foreach ( $reviews as $review_id ) {
104
-					$rating      = get_post_meta( $review_id, 'rating', true );
105
-					$author      = get_post_meta( $review_id, 'reviewer_name', true );
106
-					$description = wp_strip_all_tags( get_the_excerpt( $review_id ) );
103
+				foreach ($reviews as $review_id) {
104
+					$rating      = get_post_meta($review_id, 'rating', true);
105
+					$author      = get_post_meta($review_id, 'reviewer_name', true);
106
+					$description = wp_strip_all_tags(get_the_excerpt($review_id));
107 107
 					$review_args = array(
108 108
 						'author'     => $author,
109 109
 						'reviewBody' => $description,
110 110
 					);
111 111
 					// Add in the review rating.
112
-					if ( false !== $rating && '' !== $rating && '0' !== $rating && 0 !== $rating ) {
112
+					if (false !== $rating && '' !== $rating && '0' !== $rating && 0 !== $rating) {
113 113
 						$review_args['reviewRating'] = array(
114 114
 							'@type'       => 'Rating',
115 115
 							'ratingValue' => $rating,
116 116
 						);
117 117
 					}
118
-					$reviews_array = LSX_Schema_Utils::add_review( $reviews_array, $review_id, $this->context, $review_args );
118
+					$reviews_array = LSX_Schema_Utils::add_review($reviews_array, $review_id, $this->context, $review_args);
119 119
 					$review_count++;
120 120
 				}
121
-				if ( ! empty( $reviews_array ) ) {
122
-					if ( true === $include_aggregate ) {
121
+				if ( ! empty($reviews_array)) {
122
+					if (true === $include_aggregate) {
123 123
 						$data['aggregateRating'] = array(
124 124
 							'@type'       => 'AggregateRating',
125 125
 							'ratingValue' => (string) $aggregate_value,
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 							'worstRating' => '1',
129 129
 						);
130 130
 					}
131
-					$data[ $data_key ] = $reviews_array;
131
+					$data[$data_key] = $reviews_array;
132 132
 				}
133 133
 			}
134 134
 			return $data;
@@ -140,30 +140,30 @@  discard block
 block discarded – undo
140 140
 		 * @param  string $data_key
141 141
 		 * @return array  $data
142 142
 		 */
143
-		public function add_articles( $data, $data_key = 'subjectOf' ) {
144
-			$posts       = get_post_meta( $this->context->id, 'post_to_' . $this->post_type, false );
143
+		public function add_articles($data, $data_key = 'subjectOf') {
144
+			$posts       = get_post_meta($this->context->id, 'post_to_' . $this->post_type, false);
145 145
 			$posts_array = array();
146
-			if ( ! empty( $posts ) ) {
147
-				foreach ( $posts as $post_id ) {
146
+			if ( ! empty($posts)) {
147
+				foreach ($posts as $post_id) {
148 148
 					$post_args = array(
149
-						'articleBody' => wp_strip_all_tags( get_the_excerpt( $post_id ) ),
150
-						'headline'    => get_the_title( $post_id ),
149
+						'articleBody' => wp_strip_all_tags(get_the_excerpt($post_id)),
150
+						'headline'    => get_the_title($post_id),
151 151
 					);
152
-					$section   = get_the_term_list( $post_id, 'category' );
153
-					if ( ! is_wp_error( $section ) && '' !== $section && false !== $section ) {
154
-						$post_args['articleSection'] = wp_strip_all_tags( $section );
152
+					$section = get_the_term_list($post_id, 'category');
153
+					if ( ! is_wp_error($section) && '' !== $section && false !== $section) {
154
+						$post_args['articleSection'] = wp_strip_all_tags($section);
155 155
 					}
156
-					if ( $this->context->site_represents_reference ) {
156
+					if ($this->context->site_represents_reference) {
157 157
 						$post_args['publisher'] = $this->context->site_represents_reference;
158 158
 					}
159
-					$image_url = get_the_post_thumbnail_url( $post_id, 'lsx-thumbnail-wide' );
160
-					if ( false !== $image_url ) {
159
+					$image_url = get_the_post_thumbnail_url($post_id, 'lsx-thumbnail-wide');
160
+					if (false !== $image_url) {
161 161
 						$post_args['image'] = $image_url;
162 162
 					}
163
-					$posts_array = LSX_Schema_Utils::add_article( $posts_array, $post_id, $this->context, $post_args );
163
+					$posts_array = LSX_Schema_Utils::add_article($posts_array, $post_id, $this->context, $post_args);
164 164
 				}
165
-				if ( ! empty( $posts_array ) ) {
166
-					$data[ $data_key ] = $posts_array;
165
+				if ( ! empty($posts_array)) {
166
+					$data[$data_key] = $posts_array;
167 167
 				}
168 168
 			}
169 169
 			return $data;
@@ -175,19 +175,19 @@  discard block
 block discarded – undo
175 175
 		 *
176 176
 		 * @return array $data
177 177
 		 */
178
-		public function add_connections( $data ) {
178
+		public function add_connections($data) {
179 179
 			$connections_array = array();
180
-			if ( $this->is_top_level ) {
181
-				$connections_array = $this->add_regions( $connections_array );
182
-				$connections_array = $this->add_accommodation( $connections_array );
183
-				if ( ! empty( $connections_array ) ) {
180
+			if ($this->is_top_level) {
181
+				$connections_array = $this->add_regions($connections_array);
182
+				$connections_array = $this->add_accommodation($connections_array);
183
+				if ( ! empty($connections_array)) {
184 184
 					$data['containsPlace'] = $connections_array;
185 185
 				}
186 186
 			} else {
187
-				$connections_array             = $this->add_countries( $connections_array );
187
+				$connections_array = $this->add_countries($connections_array);
188 188
 				$data['containedInPlace'] = $connections_array;
189 189
 				$connections_array          = array();
190
-				$connections_array          = $this->add_accommodation( $connections_array );
190
+				$connections_array          = $this->add_accommodation($connections_array);
191 191
 				$data['containsPlace'] = $connections_array;
192 192
 			}
193 193
 			return $data;
@@ -201,14 +201,14 @@  discard block
 block discarded – undo
201 201
 		 *
202 202
 		 * @return array $data Review data.
203 203
 		 */
204
-		public function add_taxonomy_terms( $data, $data_key, $taxonomy ) {
204
+		public function add_taxonomy_terms($data, $data_key, $taxonomy) {
205 205
 			/**
206 206
 			 * Filter: 'lsx_schema_' . $this->post_type . '_' . $data_key . '_taxonomy' - Allow changing the taxonomy used to assign keywords to a post type Review data.
207 207
 			 *
208 208
 			 * @api string $taxonomy The chosen taxonomy.
209 209
 			 */
210
-			$taxonomy = apply_filters( 'lsx_schema_' . $this->post_type . '_' . $data_key . '_taxonomy', $taxonomy );
211
-			return LSX_Schema_Utils::add_terms( $data, $this->context->id, $data_key, $taxonomy );
210
+			$taxonomy = apply_filters('lsx_schema_' . $this->post_type . '_' . $data_key . '_taxonomy', $taxonomy);
211
+			return LSX_Schema_Utils::add_terms($data, $this->context->id, $data_key, $taxonomy);
212 212
 		}
213 213
 		/**
214 214
 		 * Adds the custom field value for the supplied key
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
 		 *
221 221
 		 * @return array $data Review data.
222 222
 		 */
223
-		public function add_custom_field( $data, $data_key, $meta_key, $single = true ) {
224
-			$value = get_post_meta( $this->context->id, $meta_key, $single );
225
-			if ( '' !== $value && false !== $value ) {
226
-				$data[ $data_key ] = $value;
223
+		public function add_custom_field($data, $data_key, $meta_key, $single = true) {
224
+			$value = get_post_meta($this->context->id, $meta_key, $single);
225
+			if ('' !== $value && false !== $value) {
226
+				$data[$data_key] = $value;
227 227
 			}
228 228
 			return $data;
229 229
 		}
Please login to merge, or discard this patch.
includes/config.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @subpackage config
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_setup' ) ) :
13
+if ( ! function_exists('lsx_setup')) :
14 14
 
15 15
 	/**
16 16
 	 * Theme after_setup_theme action.
@@ -22,59 +22,59 @@  discard block
 block discarded – undo
22 22
 		global $content_width;
23 23
 		$content_width = 1140;
24 24
 
25
-		load_theme_textdomain( 'lsx', get_template_directory() . '/languages' );
25
+		load_theme_textdomain('lsx', get_template_directory() . '/languages');
26 26
 
27
-		add_image_size( 'lsx-thumbnail-carousel', 350, 230, true );
28
-		add_image_size( 'lsx-thumbnail-wide', 360, 168, true );
29
-		add_image_size( 'lsx-thumbnail-square', 350, 350, true );
30
-		add_image_size( 'lsx-thumbnail-single', 750, 350, true );
31
-		add_image_size( 'lsx-banner', 1920, 600, true );
27
+		add_image_size('lsx-thumbnail-carousel', 350, 230, true);
28
+		add_image_size('lsx-thumbnail-wide', 360, 168, true);
29
+		add_image_size('lsx-thumbnail-square', 350, 350, true);
30
+		add_image_size('lsx-thumbnail-single', 750, 350, true);
31
+		add_image_size('lsx-banner', 1920, 600, true);
32 32
 
33
-		register_nav_menus( array(
34
-			'primary'       => esc_html__( 'Primary Menu', 'lsx' ),
35
-			'top-menu'      => esc_html__( 'Top Menu (right)', 'lsx' ),
36
-			'top-menu-left' => esc_html__( 'Top Menu (left)', 'lsx' ),
37
-			'social'        => esc_html__( 'Social Menu', 'lsx' ),
38
-			'footer'        => esc_html__( 'Footer Menu', 'lsx' ),
39
-		) );
33
+		register_nav_menus(array(
34
+			'primary'       => esc_html__('Primary Menu', 'lsx'),
35
+			'top-menu'      => esc_html__('Top Menu (right)', 'lsx'),
36
+			'top-menu-left' => esc_html__('Top Menu (left)', 'lsx'),
37
+			'social'        => esc_html__('Social Menu', 'lsx'),
38
+			'footer'        => esc_html__('Footer Menu', 'lsx'),
39
+		));
40 40
 
41
-		add_theme_support( 'automatic-feed-links' );
42
-		add_theme_support( 'custom-background' );
41
+		add_theme_support('automatic-feed-links');
42
+		add_theme_support('custom-background');
43 43
 
44
-		add_theme_support( 'custom-logo', array(
44
+		add_theme_support('custom-logo', array(
45 45
 			'height'      => 50,
46 46
 			'width'       => 160,
47 47
 			'flex-width'  => true,
48 48
 			'flex-height' => true,
49
-		) );
49
+		));
50 50
 
51
-		add_theme_support( 'html5', array( 'caption' ) );
51
+		add_theme_support('html5', array('caption'));
52 52
 
53
-		add_theme_support( 'post-formats', array(
53
+		add_theme_support('post-formats', array(
54 54
 			'image',
55 55
 			'video',
56 56
 			'gallery',
57 57
 			'audio',
58 58
 			'quote',
59
-		) );
59
+		));
60 60
 
61
-		add_theme_support( 'post-thumbnails' );
62
-		add_theme_support( 'sensei' );
61
+		add_theme_support('post-thumbnails');
62
+		add_theme_support('sensei');
63 63
 
64
-		add_theme_support( 'site-logo', array(
64
+		add_theme_support('site-logo', array(
65 65
 			'header-text' => array(
66 66
 				'site-title',
67 67
 				'site-description',
68 68
 			),
69 69
 			'size'        => 'medium',
70
-		) );
70
+		));
71 71
 
72
-		add_theme_support( 'title-tag' );
72
+		add_theme_support('title-tag');
73 73
 
74 74
 		/* @TODO - Necessary to test it */
75 75
 		// add_theme_support( 'woocommerce' );
76 76
 
77
-		add_theme_support( 'starter-content', array(
77
+		add_theme_support('starter-content', array(
78 78
 			'widgets' => array(
79 79
 				'sidebar-home' => array(
80 80
 					'custom_widget_1' => array(
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 						array(
84 84
 							'title' => '',
85
-							'text'  => wp_kses_post( '<div class="row"><div class="col-sm-12 text-center"><h3>Build your perfect website <small>with the LSX theme</small></h3></div></div><div class="row"><div class="col-sm-4 text-center"><h4>Fast</h4><p>"Quick" isn\'t a word most people use when describing their website building experience.</p></div><div class="col-sm-4 text-center"><h4>Easy</h4><p>We\'ve built websites for countless clients, and we know what kind of back-end makes sense easily.</p></div><div class="col-sm-4 text-center"><h4>Comprehensive</h4><p>The LSX extensions come with features out the box that are essential.</p></div></div>' ),
85
+							'text'  => wp_kses_post('<div class="row"><div class="col-sm-12 text-center"><h3>Build your perfect website <small>with the LSX theme</small></h3></div></div><div class="row"><div class="col-sm-4 text-center"><h4>Fast</h4><p>"Quick" isn\'t a word most people use when describing their website building experience.</p></div><div class="col-sm-4 text-center"><h4>Easy</h4><p>We\'ve built websites for countless clients, and we know what kind of back-end makes sense easily.</p></div><div class="col-sm-4 text-center"><h4>Comprehensive</h4><p>The LSX extensions come with features out the box that are essential.</p></div></div>'),
86 86
 						),
87 87
 					),
88 88
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 						array(
93 93
 							'title' => '',
94
-							'text'  => wp_kses_post( '<div class="lsx-full-width-alt"><div class="row"><div class="col-xs-12"><h3>A big CTA title</h3><p class="text-center"><a class="btn cta-btn" href="http://www.lsdeb.biz/" target="_blank" rel="noreferrer noopener">Hire Us</a><p></div></div></div>' ),
94
+							'text'  => wp_kses_post('<div class="lsx-full-width-alt"><div class="row"><div class="col-xs-12"><h3>A big CTA title</h3><p class="text-center"><a class="btn cta-btn" href="http://www.lsdeb.biz/" target="_blank" rel="noreferrer noopener">Hire Us</a><p></div></div></div>'),
95 95
 						),
96 96
 					),
97 97
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
 						array(
102 102
 							'title' => '',
103
-							'text'  => wp_kses_post( '<div class="row"><div class="col-xs-12"><h3>Homepage Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.</p></div></div>' ),
103
+							'text'  => wp_kses_post('<div class="row"><div class="col-xs-12"><h3>Homepage Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.</p></div></div>'),
104 104
 						),
105 105
 					),
106 106
 				),
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
 						'text',
111 111
 
112 112
 						array(
113
-							'title' => esc_html__( 'Space for Footer Widgets', 'lsx' ),
114
-							'text'  => esc_html__( 'This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx' ),
113
+							'title' => esc_html__('Space for Footer Widgets', 'lsx'),
114
+							'text'  => esc_html__('This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx'),
115 115
 						),
116 116
 					),
117 117
 
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 						'text',
120 120
 
121 121
 						array(
122
-							'title' => esc_html__( 'Space for Footer Widgets', 'lsx' ),
123
-							'text'  => esc_html__( 'This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx' ),
122
+							'title' => esc_html__('Space for Footer Widgets', 'lsx'),
123
+							'text'  => esc_html__('This is here to showcase some footer widgets. You can decide what to add and what to hide. Nam nostrum evertitur ad, ut pri nibh veniam, urbanitas definitionem eum ex.', 'lsx'),
124 124
 						),
125 125
 					),
126 126
 
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
 						'text',
129 129
 
130 130
 						array(
131
-							'title' => esc_html__( 'Contact us:', 'lsx' ),
132
-							'text'  => wp_kses_post( '<a href="mailto:[email protected]><i class="fa fa-envelope fa-fw"></i> [email protected]</a><br><a href="tel:+27214489843"><i class="fa fa-phone fa-fw"></i> +27 21 448 9843</a><br><i class="fa fa-skype fa-fw"></i> /lightspeeddevelopment' ),
131
+							'title' => esc_html__('Contact us:', 'lsx'),
132
+							'text'  => wp_kses_post('<a href="mailto:[email protected]><i class="fa fa-envelope fa-fw"></i> [email protected]</a><br><a href="tel:+27214489843"><i class="fa fa-phone fa-fw"></i> +27 21 448 9843</a><br><i class="fa fa-skype fa-fw"></i> /lightspeeddevelopment'),
133 133
 						),
134 134
 					),
135 135
 				),
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
 						'text',
140 140
 
141 141
 						array(
142
-							'title' => esc_html__( 'A Footer Call to Action', 'lsx' ),
143
-							'text'  => esc_html__( 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.', 'lsx' ),
142
+							'title' => esc_html__('A Footer Call to Action', 'lsx'),
143
+							'text'  => esc_html__('Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.', 'lsx'),
144 144
 						),
145 145
 					),
146 146
 				),
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 				'home' => array(
151 151
 					'template' => 'page-templates/template-front-page.php',
152 152
 					'thumbnail' => '{{image-banner-example-01}}',
153
-					'post_title' => esc_html__( 'LSX is a free WordPress theme', 'lsx' ),
153
+					'post_title' => esc_html__('LSX is a free WordPress theme', 'lsx'),
154 154
 					'post_content' => '',
155 155
 				),
156 156
 
@@ -167,17 +167,17 @@  discard block
 block discarded – undo
167 167
 
168 168
 			'attachments' => array(
169 169
 				'image-banner-example-01' => array(
170
-					'post_title' => esc_html_x( 'Banner Example 01', 'Theme starter content', 'lsx' ),
170
+					'post_title' => esc_html_x('Banner Example 01', 'Theme starter content', 'lsx'),
171 171
 					'file' => 'assets/images/admin/banner-example-01.jpg',
172 172
 				),
173 173
 
174 174
 				'image-banner-example-02' => array(
175
-					'post_title' => esc_html_x( 'Banner Example 02', 'Theme starter content', 'lsx' ),
175
+					'post_title' => esc_html_x('Banner Example 02', 'Theme starter content', 'lsx'),
176 176
 					'file' => 'assets/images/admin/banner-example-02.jpg',
177 177
 				),
178 178
 
179 179
 				'image-banner-example-03' => array(
180
-					'post_title' => esc_html_x( 'Banner Example 03', 'Theme starter content', 'lsx' ),
180
+					'post_title' => esc_html_x('Banner Example 03', 'Theme starter content', 'lsx'),
181 181
 					'file' => 'assets/images/admin/banner-example-03.jpg',
182 182
 				),
183 183
 			),
@@ -186,12 +186,12 @@  discard block
 block discarded – undo
186 186
 				'show_on_front' => 'page',
187 187
 				'page_on_front' => '{{home}}',
188 188
 				'page_for_posts' => '{{blog}}',
189
-				'blogdescription' => esc_html__( 'LSX starter content example', 'lsx' ),
189
+				'blogdescription' => esc_html__('LSX starter content example', 'lsx'),
190 190
 			),
191 191
 
192 192
 			'nav_menus' => array(
193 193
 				'primary' => array(
194
-					'name' => esc_html__( 'Primary Menu', 'lsx' ),
194
+					'name' => esc_html__('Primary Menu', 'lsx'),
195 195
 
196 196
 					'items' => array(
197 197
 						'page_home',
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 				),
203 203
 
204 204
 				'top-menu' => array(
205
-					'name' => esc_html__( 'Top Menu', 'lsx' ),
205
+					'name' => esc_html__('Top Menu', 'lsx'),
206 206
 
207 207
 					'items' => array(
208 208
 						'custom_link_1' => array(
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 				),
231 231
 
232 232
 				'social' => array(
233
-					'name' => esc_html__( 'Social Menu', 'lsx' ),
233
+					'name' => esc_html__('Social Menu', 'lsx'),
234 234
 
235 235
 					'items' => array(
236 236
 						'link_facebook',
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 				),
246 246
 
247 247
 				'footer' => array(
248
-					'name' => esc_html__( 'Footer Menu', 'lsx' ),
248
+					'name' => esc_html__('Footer Menu', 'lsx'),
249 249
 
250 250
 					'items' => array(
251 251
 						'page_about',
@@ -259,14 +259,14 @@  discard block
 block discarded – undo
259 259
 				'lsx_header_search' => false,
260 260
 				'lsx_layout' => '1c',
261 261
 			),
262
-		) );
262
+		));
263 263
 	}
264 264
 
265 265
 endif;
266 266
 
267
-add_action( 'after_setup_theme', 'lsx_setup' );
267
+add_action('after_setup_theme', 'lsx_setup');
268 268
 
269
-if ( ! function_exists( 'lsx_init' ) ) :
269
+if ( ! function_exists('lsx_init')) :
270 270
 
271 271
 	/**
272 272
 	 * Theme init action.
@@ -275,20 +275,20 @@  discard block
 block discarded – undo
275 275
 	 * @subpackage config
276 276
 	 */
277 277
 	function lsx_init() {
278
-		add_post_type_support( 'page', 'excerpt' );
278
+		add_post_type_support('page', 'excerpt');
279 279
 
280
-		if ( class_exists( 'WooCommerce' ) ) {
281
-			remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
280
+		if (class_exists('WooCommerce')) {
281
+			remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20);
282 282
 		}
283 283
 
284
-		remove_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce',10 );
284
+		remove_action('comment_form', 'wp_comment_form_unfiltered_html_nonce', 10);
285 285
 	}
286 286
 
287 287
 endif;
288 288
 
289
-add_action( 'init', 'lsx_init', 100 );
289
+add_action('init', 'lsx_init', 100);
290 290
 
291
-if ( ! function_exists( 'lsx_process_content_width' ) ) :
291
+if ( ! function_exists('lsx_process_content_width')) :
292 292
 
293 293
 	/**
294 294
 	 * Overwrite the $content_width var, based on the layout of the page.
@@ -300,8 +300,8 @@  discard block
 block discarded – undo
300 300
 		global $content_width;
301 301
 
302 302
 		if (
303
-			is_page_template( 'page-templates/template-front-page.php' ) ||
304
-			is_page_template( 'page-templates/template-full-width.php' )
303
+			is_page_template('page-templates/template-front-page.php') ||
304
+			is_page_template('page-templates/template-full-width.php')
305 305
 		) {
306 306
 			$content_width = 1140;
307 307
 		}
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 
310 310
 endif;
311 311
 
312
-add_action( 'wp_head', 'lsx_process_content_width' );
312
+add_action('wp_head', 'lsx_process_content_width');
313 313
 
314
-if ( ! function_exists( 'lsx_file_get_contents' ) ) :
314
+if ( ! function_exists('lsx_file_get_contents')) :
315 315
 
316 316
 	/**
317 317
 	 * Get file contents.
@@ -319,19 +319,19 @@  discard block
 block discarded – undo
319 319
 	 * @package    lsx
320 320
 	 * @subpackage config
321 321
 	 */
322
-	function lsx_file_get_contents( $file ) {
323
-		if ( file_exists( $file ) ) {
322
+	function lsx_file_get_contents($file) {
323
+		if (file_exists($file)) {
324 324
 			global $wp_filesystem;
325 325
 
326
-			if ( empty( $wp_filesystem ) ) {
327
-				require_once( ABSPATH . 'wp-admin/includes/file.php' );
326
+			if (empty($wp_filesystem)) {
327
+				require_once(ABSPATH . 'wp-admin/includes/file.php');
328 328
 				WP_Filesystem();
329 329
 			}
330 330
 
331
-			if ( $wp_filesystem ) {
332
-				$contents = $wp_filesystem->get_contents( $file );
331
+			if ($wp_filesystem) {
332
+				$contents = $wp_filesystem->get_contents($file);
333 333
 
334
-				if ( ! empty( $contents ) ) {
334
+				if ( ! empty($contents)) {
335 335
 					return $contents;
336 336
 				}
337 337
 			}
Please login to merge, or discard this patch.