Completed
Push — master ( a32fd1...0789de )
by Fernando
03:35 queued 01:02
created
inc/woocommerce.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
 /*
10 10
  * Hooks
11 11
  */
12
-remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
13
-remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
12
+remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
13
+remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
14 14
 
15 15
 add_action('woocommerce_before_main_content', 'lsx_woocommerce_before_content', 10);
16 16
 add_action('woocommerce_after_main_content', 'lsx_woocommerce_after_content', 10);
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
  * @subpackage woocommerce
26 26
  * @category 	layout
27 27
  */
28
-function lsx_woocommerce_before_content(){ ?>
28
+function lsx_woocommerce_before_content() { ?>
29 29
 	<?php lsx_content_wrap_before(); ?>
30 30
 
31
-	<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
31
+	<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>">
32 32
 
33 33
 		<?php lsx_content_before(); ?>
34 34
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
  * @subpackage woocommerce
44 44
  * @category 	layout
45 45
  */
46
-function lsx_woocommerce_after_content(){ ?>
46
+function lsx_woocommerce_after_content() { ?>
47 47
 		<?php lsx_content_bottom(); ?>
48 48
 
49 49
 		</main><!-- #main -->
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
  * @subpackage woocommerce
67 67
  * @category 	styles
68 68
  */
69
-add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
69
+add_filter('woocommerce_enqueue_styles', '__return_empty_array');
70 70
 
71 71
 function lsx_woocommerce_styles() {
72
-    wp_enqueue_style( 'woocommerce-layout', get_template_directory_uri() . '/css/woocommerce-layout.css', array(), LSX_VERSION, 'all' );
73
-    wp_enqueue_style( 'woocommerce-smallscreen', get_template_directory_uri() . '/css/woocommerce-smallscreen.css', array( 'woocommerce-layout' ), LSX_VERSION, 'only screen and (max-width: 767px)' );
74
-    wp_enqueue_style( 'woocommerce-general', get_template_directory_uri() . '/css/woocommerce.css', array(), LSX_VERSION, 'all' );
72
+    wp_enqueue_style('woocommerce-layout', get_template_directory_uri() . '/css/woocommerce-layout.css', array(), LSX_VERSION, 'all');
73
+    wp_enqueue_style('woocommerce-smallscreen', get_template_directory_uri() . '/css/woocommerce-smallscreen.css', array('woocommerce-layout'), LSX_VERSION, 'only screen and (max-width: 767px)');
74
+    wp_enqueue_style('woocommerce-general', get_template_directory_uri() . '/css/woocommerce.css', array(), LSX_VERSION, 'all');
75 75
 }
76
-add_action( 'wp_enqueue_scripts', 'lsx_woocommerce_styles' );
77 76
\ No newline at end of file
77
+add_action('wp_enqueue_scripts', 'lsx_woocommerce_styles');
78 78
\ No newline at end of file
Please login to merge, or discard this patch.
inc/customizer-font.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,42 +1,42 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * LSX_Customize_Font_Control Class
6 6
 **/
7
-if( !class_exists( 'WP_Customize_Control' ) ){
7
+if ( ! class_exists('WP_Customize_Control')) {
8 8
 	return;
9 9
 }
10
-class LSX_Customize_Font_Control extends WP_Customize_Control{
10
+class LSX_Customize_Font_Control extends WP_Customize_Control {
11 11
 	public $fonts;
12 12
 
13 13
 	/**
14 14
 	 * Enqueue the styles and scripts
15 15
 	**/
16
-	public function enqueue(){
16
+	public function enqueue() {
17 17
 		// styles
18
-		wp_enqueue_style( 'lsx-font-picker-custom-control', get_template_directory_uri() .'/css/customizer-font.css', array(), LSX_VERSION );
18
+		wp_enqueue_style('lsx-font-picker-custom-control', get_template_directory_uri() . '/css/customizer-font.css', array(), LSX_VERSION);
19 19
 			
20 20
 		// scripts
21
-		wp_enqueue_script( 'lsx-font-picker-custom-control', get_template_directory_uri() .'/js/customizer-font.js', array(), LSX_VERSION );
21
+		wp_enqueue_script('lsx-font-picker-custom-control', get_template_directory_uri() . '/js/customizer-font.js', array(), LSX_VERSION);
22 22
 	}
23 23
 
24 24
 	/**
25 25
 	 * Render the content on the theme customizer page
26 26
 	**/
27
-	public function render_content(){
28
-		if ( empty( $this->choices ) ){
27
+	public function render_content() {
28
+		if (empty($this->choices)) {
29 29
 			// if there are no choices then don't print anything
30 30
 			return;
31 31
 		}
32 32
 		$fonts = array();
33
-		foreach( $this->choices as $slug=>$font ){
33
+		foreach ($this->choices as $slug=>$font) {
34 34
 			$fonts[] = $font['header'];
35 35
 			$fonts[] = $font['body'];
36 36
 			$this->choices[$slug] = $font;
37 37
 		}
38 38
 		
39
-		$this->fonts = new LSX_Google_Font_Collection( $fonts );
39
+		$this->fonts = new LSX_Google_Font_Collection($fonts);
40 40
 
41 41
 		$fonts = $this->fonts->get_font_family_name_array();
42 42
 		//print links to css files
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 		<div class="fontPickerCustomControl">
52 52
 			<select <?php $this->link(); ?>>
53 53
 				<?php
54
-				foreach ( $this->choices as $value => $conf ){
55
-					echo '<option value="' . esc_attr( $value ) . '">' . esc_html( $value ) . '</option>';
54
+				foreach ($this->choices as $value => $conf) {
55
+					echo '<option value="' . esc_attr($value) . '">' . esc_html($value) . '</option>';
56 56
 				}
57 57
 				?>
58 58
 			</select>
@@ -60,16 +60,16 @@  discard block
 block discarded – undo
60 60
 				<ul>
61 61
 					<?php
62 62
 					//$cssClassArray = $this->fonts->get_css_class_array();
63
-					foreach ($this->choices as $key => $font){
63
+					foreach ($this->choices as $key => $font) {
64 64
 						$class = null;
65
-						if( $key == $set_value ){
65
+						if ($key == $set_value) {
66 66
 							$class = ' selected';
67 67
 						}
68 68
 						
69 69
 						?>
70
-						<li class="font-choice <?php echo esc_attr( $class ); ?>">
71
-							<div class="<?php echo esc_attr( $font['header']['cssClass'] ); ?>"><?php echo esc_html( $font['header']['title'] ); ?></div>
72
-							<small class="<?php echo esc_attr( $font['body']['cssClass'] ); ?>"><?php echo esc_html( $font['body']['title'] ); ?></small>
70
+						<li class="font-choice <?php echo esc_attr($class); ?>">
71
+							<div class="<?php echo esc_attr($font['header']['cssClass']); ?>"><?php echo esc_html($font['header']['title']); ?></div>
72
+							<small class="<?php echo esc_attr($font['body']['cssClass']); ?>"><?php echo esc_html($font['body']['title']); ?></small>
73 73
 						</li>
74 74
 						<?php
75 75
 					}
Please login to merge, or discard this patch.
inc/customizer-header-fixed.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * Customizer Header Fixed Class
6 6
  *
7 7
  * @since 1.0.0
8 8
  */
9
-if( !class_exists( 'WP_Customize_Control' ) ){
9
+if ( ! class_exists('WP_Customize_Control')) {
10 10
 	return;
11 11
 }
12 12
 class LSX_Customize_Header_Fixed_Control extends WP_Customize_Control {
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 	 * @param string $id
39 39
 	 * @param array $args
40 40
 	 */
41
-	public function __construct( $manager, $id, $args = array() ) {
42
-		parent::__construct( $manager, $id, $args );
43
-		if( !empty( $args['choices'] ) ){
41
+	public function __construct($manager, $id, $args = array()) {
42
+		parent::__construct($manager, $id, $args);
43
+		if ( ! empty($args['choices'])) {
44 44
 			$this->layouts = $args['choices'];
45 45
 		}
46 46
 	}
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	public function enqueue() {
54 54
 		// 
55
-		wp_enqueue_script( 'lsx-header-fixed-control', get_template_directory_uri() .'/js/customizer-header-fixed.js', array('jquery'), LSX_VERSION, true );
55
+		wp_enqueue_script('lsx-header-fixed-control', get_template_directory_uri() . '/js/customizer-header-fixed.js', array('jquery'), LSX_VERSION, true);
56 56
 	}
57 57
 
58 58
 	/**
@@ -62,21 +62,21 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function render_content() {
64 64
 		
65
-		$post_id    = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) );
65
+		$post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id));
66 66
 		$class = 'customize-control customize-control-' . $this->type;
67 67
 		$value = $this->value();
68 68
 
69 69
 		?>
70 70
 		<label>
71
-			<?php if ( ! empty( $this->label ) ) { ?>
72
-				<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
71
+			<?php if ( ! empty($this->label)) { ?>
72
+				<span class="customize-control-title"><?php echo esc_html($this->label); ?></span>
73 73
 			<?php }
74
-			if ( ! empty( $this->description ) ) { ?>
75
-				<span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
74
+			if ( ! empty($this->description)) { ?>
75
+				<span class="description customize-control-description"><?php echo esc_html($this->description); ?></span>
76 76
 			<?php } ?>
77 77
 			<div class="header-fixed">
78 78
 				<label>
79
-					<input <?php $this->link(); ?> type="checkbox" id="<?php echo esc_attr( $post_id ); ?>" class="header-fixed <?php echo esc_attr( $class ); ?>" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> Uncheck for standard header
79
+					<input <?php $this->link(); ?> type="checkbox" id="<?php echo esc_attr($post_id); ?>" class="header-fixed <?php echo esc_attr($class); ?>" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> Uncheck for standard header
80 80
 				</label>
81 81
 			</div>
82 82
 		</label>
Please login to merge, or discard this patch.
inc/customizer-layout.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * Customize Swatch Control Class
6 6
  *
7 7
  * @since 1.0.0
8 8
  */
9
-if( !class_exists( 'WP_Customize_Control' ) ){
9
+if ( ! class_exists('WP_Customize_Control')) {
10 10
 	return;
11 11
 }
12 12
 class LSX_Customize_Layout_Control extends WP_Customize_Control {
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 	 * @param string $id
39 39
 	 * @param array $args
40 40
 	 */
41
-	public function __construct( $manager, $id, $args = array() ) {
42
-		parent::__construct( $manager, $id, $args );
43
-		if( !empty( $args['choices'] ) ){
41
+	public function __construct($manager, $id, $args = array()) {
42
+		parent::__construct($manager, $id, $args);
43
+		if ( ! empty($args['choices'])) {
44 44
 			$this->layouts = $args['choices'];
45 45
 		}
46 46
 	}
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	public function enqueue() {
54 54
 		// 
55
-		wp_enqueue_script( 'lsx-layout-control', get_template_directory_uri() .'/js/customizer-layout.js', array('jquery'), LSX_VERSION, true );
55
+		wp_enqueue_script('lsx-layout-control', get_template_directory_uri() . '/js/customizer-layout.js', array('jquery'), LSX_VERSION, true);
56 56
 	}
57 57
 
58 58
 	/**
@@ -62,30 +62,30 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function render_content() {
64 64
 		
65
-		$post_id    = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) );
65
+		$post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id));
66 66
 		$class = 'customize-control customize-control-' . $this->type;
67 67
 		$value = $this->value();
68 68
 
69 69
 		?>
70 70
 		<label>
71
-			<?php if ( ! empty( $this->label ) ) { ?>
72
-				<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
71
+			<?php if ( ! empty($this->label)) { ?>
72
+				<span class="customize-control-title"><?php echo esc_html($this->label); ?></span>
73 73
 			<?php }
74
-			if ( ! empty( $this->description ) ) { ?>
75
-				<span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
74
+			if ( ! empty($this->description)) { ?>
75
+				<span class="description customize-control-description"><?php echo esc_html($this->description); ?></span>
76 76
 			<?php } ?>
77 77
 			<div class="layouts-selector">
78 78
 			<?php
79
-			foreach( $this->layouts as $layout ){
79
+			foreach ($this->layouts as $layout) {
80 80
 				$sel = 'border: 1px solid transparent;';
81
-				if( $value == $layout ){
81
+				if ($value == $layout) {
82 82
 					$sel = 'border: 1px solid rgb(43, 166, 203);';
83 83
 				}
84
-				echo '<img class="layout-button" style="padding:2px;'. esc_attr( $sel ) .'" src="' . esc_attr( get_template_directory_uri() ) .'/img/' . esc_attr( $layout ) . '.png" data-option="' . esc_attr( $layout ) . '">';
84
+				echo '<img class="layout-button" style="padding:2px;' . esc_attr($sel) . '" src="' . esc_attr(get_template_directory_uri()) . '/img/' . esc_attr($layout) . '.png" data-option="' . esc_attr($layout) . '">';
85 85
 			}
86 86
 
87 87
 			?>
88
-			<input <?php $this->link(); ?> class="selected-layout <?php echo esc_attr( $class ); ?>" id="<?php echo esc_attr( $post_id ); ?>" type="hidden" value="<?php echo esc_attr( $value ); ?>" <?php $this->input_attrs(); ?>>
88
+			<input <?php $this->link(); ?> class="selected-layout <?php echo esc_attr($class); ?>" id="<?php echo esc_attr($post_id); ?>" type="hidden" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>>
89 89
 			</div>
90 90
 		</label>
91 91
 	<?php
Please login to merge, or discard this patch.
inc/scripts.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * Enqueue scripts and styles.
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
 	
15 15
 	wp_enqueue_style('lsx_main', get_template_directory_uri() . '/css/app.css', array(), LSX_VERSION);
16 16
 	
17
-	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
18
-		wp_enqueue_script( 'comment-reply' );
17
+	if (is_singular() && comments_open() && get_option('thread_comments')) {
18
+		wp_enqueue_script('comment-reply');
19 19
 	}
20 20
 
21 21
 	wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/vendor/bootstrap.min.js', array('jquery'), LSX_VERSION, false);
@@ -26,38 +26,38 @@  discard block
 block discarded – undo
26 26
 	wp_enqueue_script('picturefill', get_template_directory_uri() . '/js/vendor/picturefill.min.js', array(), LSX_VERSION, false);
27 27
 
28 28
 	wp_enqueue_script('masonry');
29
-	wp_enqueue_script('imagesLoaded', get_template_directory_uri().'/js/vendor/imagesloaded.pkgd.min.js', array('jquery','masonry'), LSX_VERSION);	
30
-	if(defined('WP_DEBUG') && true === WP_DEBUG){
29
+	wp_enqueue_script('imagesLoaded', get_template_directory_uri() . '/js/vendor/imagesloaded.pkgd.min.js', array('jquery', 'masonry'), LSX_VERSION);	
30
+	if (defined('WP_DEBUG') && true === WP_DEBUG) {
31 31
 		wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.js', array('masonry'), LSX_VERSION, false);
32
-	}else{
32
+	} else {
33 33
 		wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.min.js', array('masonry'), LSX_VERSION, false);
34 34
 	}
35 35
 	
36 36
 	//Set some parameters that we can use in the JS
37 37
 	$is_portfolio = false;
38
-	if(is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag') || is_page_template('page-templates/template-portfolio.php')){
38
+	if (is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag') || is_page_template('page-templates/template-portfolio.php')) {
39 39
 		$is_portfolio = true;
40 40
 	}
41 41
 	$param_array = array(
42 42
 			'is_portfolio' => $is_portfolio
43 43
 	);
44 44
 	//Set the columns for the archives
45
-	$param_array['columns'] = apply_filters('lsx_archive_column_number',3);
46
-	wp_localize_script( 'lsx_script', 'lsx_params', $param_array );
45
+	$param_array['columns'] = apply_filters('lsx_archive_column_number', 3);
46
+	wp_localize_script('lsx_script', 'lsx_params', $param_array);
47 47
 
48 48
 
49
-	wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), LSX_VERSION );
49
+	wp_enqueue_style('fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), LSX_VERSION);
50 50
 	
51 51
 	
52
-	if(is_child_theme() && file_exists(get_stylesheet_directory() . '/custom.css')) {
53
-		wp_enqueue_style( 'child-css', get_stylesheet_directory_uri() . '/custom.css', array(), LSX_VERSION );
52
+	if (is_child_theme() && file_exists(get_stylesheet_directory() . '/custom.css')) {
53
+		wp_enqueue_style('child-css', get_stylesheet_directory_uri() . '/custom.css', array(), LSX_VERSION);
54 54
 	}
55 55
 
56 56
 	wp_enqueue_style('medium-break', get_template_directory_uri() . '/css/medium-nav-break.css', array(), LSX_VERSION);
57 57
 	
58 58
 	
59
-	$font = get_theme_mod('lsx_font','raleway_open_sans');
60
-	switch($font){
59
+	$font = get_theme_mod('lsx_font', 'raleway_open_sans');
60
+	switch ($font) {
61 61
 		case 'raleway_open_sans':
62 62
 			$header_font_location = 'Raleway';
63 63
 			$body_font_location = 'Open+Sans';
@@ -86,18 +86,18 @@  discard block
 block discarded – undo
86 86
 	}
87 87
 	
88 88
 	$http_var = 'http';
89
-	if(is_ssl()){ $http_var .= 's'; }
89
+	if (is_ssl()) { $http_var .= 's'; }
90 90
 	
91 91
 	//Call the Google Fonts and then Enque them.
92
-	wp_register_style('lsx-header-font', $http_var.'://fonts.googleapis.com/css?family='.$header_font_location);
93
-	wp_register_style('lsx-body-font', $http_var.'://fonts.googleapis.com/css?family='.$body_font_location);
94
-	wp_enqueue_style( 'lsx-header-font' );
95
-	wp_enqueue_style( 'lsx-body-font' );
92
+	wp_register_style('lsx-header-font', $http_var . '://fonts.googleapis.com/css?family=' . $header_font_location);
93
+	wp_register_style('lsx-body-font', $http_var . '://fonts.googleapis.com/css?family=' . $body_font_location);
94
+	wp_enqueue_style('lsx-header-font');
95
+	wp_enqueue_style('lsx-body-font');
96 96
 	
97
-	wp_enqueue_style('lsx_font_scheme', esc_url( get_template_directory_uri() . '/css/'.$font.'.css' ), array(), LSX_VERSION);
97
+	wp_enqueue_style('lsx_font_scheme', esc_url(get_template_directory_uri() . '/css/' . $font . '.css'), array(), LSX_VERSION);
98 98
 	
99 99
 }
100
-add_action( 'wp_enqueue_scripts', 'lsx_scripts' );
100
+add_action('wp_enqueue_scripts', 'lsx_scripts');
101 101
 
102 102
 /**
103 103
  * Defer JavaScript
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
  * @package 	lsx
106 106
  * @subpackage	scripts
107 107
  */
108
-function lsx_scripts_defer_parsing( $url ) {
109
-	if ( ! ( is_admin() ) ) {
110
-		if ( FALSE === strpos( $url, '.js' ) ) return $url;
111
-		if ( strpos( $url, 'jquery.js' ) ) return $url;
112
-		if ( strpos( $url, ' defer ' ) ) return $url;
108
+function lsx_scripts_defer_parsing($url) {
109
+	if ( ! (is_admin())) {
110
+		if (FALSE === strpos($url, '.js')) return $url;
111
+		if (strpos($url, 'jquery.js')) return $url;
112
+		if (strpos($url, ' defer ')) return $url;
113 113
 		return "$url' defer onload='";
114 114
 	}
115 115
 
116 116
 	return $url;
117 117
 }
118
-add_filter( 'clean_url', 'lsx_scripts_defer_parsing', 11, 1 );
118
+add_filter('clean_url', 'lsx_scripts_defer_parsing', 11, 1);
Please login to merge, or discard this patch.
inc/lazyload.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return;
2
+if ( ! defined('ABSPATH')) return;
3 3
 
4 4
 /*
5 5
  * LSX Lazy Load Images Class
@@ -25,143 +25,143 @@  discard block
 block discarded – undo
25 25
 	protected static $noscripts   = array();
26 26
 
27 27
 	static function init() {
28
-		if ( is_admin() )
28
+		if (is_admin())
29 29
 			return;
30 30
 
31
-		if ( get_theme_mod( 'lsx_lazyload_status', '1' ) === false ) {
31
+		if (get_theme_mod('lsx_lazyload_status', '1') === false) {
32 32
 			self::$enabled = false;
33 33
 			return;
34 34
 		}
35 35
 
36
-		if ( ! apply_filters( 'lsx_lazyload_is_enabled', true ) ) {
36
+		if ( ! apply_filters('lsx_lazyload_is_enabled', true)) {
37 37
 			self::$enabled = false;
38 38
 			return;
39 39
 		}
40 40
 
41
-		add_action( 'wp_enqueue_scripts', array( __CLASS__, 'add_scripts' ) );
42
-		add_action( 'wp_head', array( __CLASS__, 'setup_filters' ), 9999 );
43
-		add_filter( 'wp_kses_allowed_html', array( __CLASS__, 'kses_allowed_html' ), 10, 2 );
44
-		add_filter( 'kses_allowed_protocols', array( __CLASS__, 'kses_allowed_protocols' ) );
41
+		add_action('wp_enqueue_scripts', array(__CLASS__, 'add_scripts'));
42
+		add_action('wp_head', array(__CLASS__, 'setup_filters'), 9999);
43
+		add_filter('wp_kses_allowed_html', array(__CLASS__, 'kses_allowed_html'), 10, 2);
44
+		add_filter('kses_allowed_protocols', array(__CLASS__, 'kses_allowed_protocols'));
45 45
 	}
46 46
 
47 47
 	static function setup_filters() {
48 48
 		// WordPress
49
-		add_filter( 'the_content', array( __CLASS__, 'filter_images' ), 200 );
50
-		add_filter( 'widget_text', array( __CLASS__, 'filter_images' ), 200 );
51
-		add_filter( 'post_thumbnail_html', array( __CLASS__, 'filter_images' ), 200 );
52
-		add_filter( 'get_avatar', array( __CLASS__, 'filter_images' ), 200 );
49
+		add_filter('the_content', array(__CLASS__, 'filter_images'), 200);
50
+		add_filter('widget_text', array(__CLASS__, 'filter_images'), 200);
51
+		add_filter('post_thumbnail_html', array(__CLASS__, 'filter_images'), 200);
52
+		add_filter('get_avatar', array(__CLASS__, 'filter_images'), 200);
53 53
 		
54 54
 		// LSX
55
-		add_filter( 'lsx_lazyload_filter_images', array( __CLASS__, 'filter_images' ), 200 );
55
+		add_filter('lsx_lazyload_filter_images', array(__CLASS__, 'filter_images'), 200);
56 56
 
57 57
 		// Envira Gallery
58
-		add_filter( 'envira_gallery_output_image', array( __CLASS__, 'filter_images' ), 200 );
58
+		add_filter('envira_gallery_output_image', array(__CLASS__, 'filter_images'), 200);
59 59
 	}
60 60
 
61 61
 	static function add_scripts() {
62
-		wp_enqueue_script( 'lazysizes', get_template_directory_uri() .'/js/vendor/lazysizes.min.js', array( 'jquery' ), LSX_VERSION, true );
62
+		wp_enqueue_script('lazysizes', get_template_directory_uri() . '/js/vendor/lazysizes.min.js', array('jquery'), LSX_VERSION, true);
63 63
 		// Plugin that enables use lazysizes in brackground images
64 64
 		//wp_enqueue_script( 'lazysizes', get_template_directory_uri() .'/js/vendor/ls.unveilhooks.min.js', array( 'jquery', 'lazysizes' ), LSX_VERSION, true );
65 65
 	}
66 66
 
67
-	static function filter_images( $content ) {
68
-		if ( ! self::is_enabled() ) {
67
+	static function filter_images($content) {
68
+		if ( ! self::is_enabled()) {
69 69
 			return $content;
70 70
 		}
71 71
 
72
-		$http_user_agent = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) );
73
-		$http_user_agent = ! empty( $http_user_agent ) ? $http_user_agent : '';
72
+		$http_user_agent = sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT']));
73
+		$http_user_agent = ! empty($http_user_agent) ? $http_user_agent : '';
74 74
 
75
-		if ( is_feed()
75
+		if (is_feed()
76 76
 			|| is_preview()
77
-			|| intval( get_query_var( 'print' ) ) == 1
78
-			|| intval( get_query_var( 'printpage' ) ) == 1
79
-			|| strpos( $http_user_agent, 'Opera Mini' ) !== false
77
+			|| intval(get_query_var('print')) == 1
78
+			|| intval(get_query_var('printpage')) == 1
79
+			|| strpos($http_user_agent, 'Opera Mini') !== false
80 80
 		) {
81 81
 			return $content;
82 82
 		}
83 83
 
84 84
 		$skip_images_regex = '/class=".*(lazyload|disable-lazyload).*"/';
85
-		$placeholder_image = apply_filters( 'lsx_lazyload_placeholder_image', 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' );
85
+		$placeholder_image = apply_filters('lsx_lazyload_placeholder_image', 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==');
86 86
 
87 87
 		$matches = array();
88 88
 		$search = array();
89 89
 		$replace = array();
90 90
 		
91
-		$content = preg_replace_callback( '~<noscript.+?</noscript>~s', 'self::noscripts_remove', $content );
92
-		preg_match_all( '/<img[^>]*>/', $content, $matches );
91
+		$content = preg_replace_callback('~<noscript.+?</noscript>~s', 'self::noscripts_remove', $content);
92
+		preg_match_all('/<img[^>]*>/', $content, $matches);
93 93
 
94
-		foreach ( $matches[0] as $img_html ) {
95
-			if ( ! ( preg_match( $skip_images_regex, $img_html ) ) ) {
94
+		foreach ($matches[0] as $img_html) {
95
+			if ( ! (preg_match($skip_images_regex, $img_html))) {
96 96
 				$add_class = false;
97 97
 
98
-				if ( ! preg_match( '/src=[\'"]([^\'"]+)[\'"]/', $img_html ) && preg_match( '/srcset=[\'"]([^\'"]+)[\'"]/', $img_html ) ) {
99
-					$replace_html = preg_replace( '/<img(.*?)srcset=/i', '<img$1srcset="' . $placeholder_image . '" data-srcset=', $img_html );
98
+				if ( ! preg_match('/src=[\'"]([^\'"]+)[\'"]/', $img_html) && preg_match('/srcset=[\'"]([^\'"]+)[\'"]/', $img_html)) {
99
+					$replace_html = preg_replace('/<img(.*?)srcset=/i', '<img$1srcset="' . $placeholder_image . '" data-srcset=', $img_html);
100 100
 
101
-					if ( preg_match( '/sizes=[\'"]([^\'"]+)[\'"]/', $img_html ) ) {
102
-						$replace_html = preg_replace( '/sizes=/i', 'data-sizes=', $replace_html );
101
+					if (preg_match('/sizes=[\'"]([^\'"]+)[\'"]/', $img_html)) {
102
+						$replace_html = preg_replace('/sizes=/i', 'data-sizes=', $replace_html);
103 103
 					} else {
104
-						$replace_html = preg_replace( '/data-srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html );
104
+						$replace_html = preg_replace('/data-srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html);
105 105
 					}
106 106
 
107 107
 					$add_class = true;
108
-				} elseif ( preg_match( '/src=[\'"]([^\'"]+)[\'"]/', $img_html ) ) {
109
-					$replace_html = preg_replace( '/<img(.*?)src=/i', '<img$1src="' . $placeholder_image . '" data-src=', $img_html );
108
+				} elseif (preg_match('/src=[\'"]([^\'"]+)[\'"]/', $img_html)) {
109
+					$replace_html = preg_replace('/<img(.*?)src=/i', '<img$1src="' . $placeholder_image . '" data-src=', $img_html);
110 110
 
111
-					if ( preg_match( '/srcset=[\'"]([^\'"]+)[\'"]/', $img_html ) ) {
112
-						if ( preg_match( '/sizes=[\'"]([^\'"]+)[\'"]/', $img_html ) ) {
113
-							$replace_html = preg_replace( '/srcset=/i', 'data-srcset=', $replace_html );
114
-							$replace_html = preg_replace( '/sizes=/i', 'data-sizes=', $replace_html );
111
+					if (preg_match('/srcset=[\'"]([^\'"]+)[\'"]/', $img_html)) {
112
+						if (preg_match('/sizes=[\'"]([^\'"]+)[\'"]/', $img_html)) {
113
+							$replace_html = preg_replace('/srcset=/i', 'data-srcset=', $replace_html);
114
+							$replace_html = preg_replace('/sizes=/i', 'data-sizes=', $replace_html);
115 115
 						} else {
116
-							$replace_html = preg_replace( '/srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html );
116
+							$replace_html = preg_replace('/srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html);
117 117
 						}
118 118
 					}
119 119
 
120 120
 					$add_class = true;
121 121
 				}
122 122
 
123
-				if ( $add_class ) {
124
-					$replace_html = self::add_class( $replace_html, 'lazyload' );
123
+				if ($add_class) {
124
+					$replace_html = self::add_class($replace_html, 'lazyload');
125 125
 					$replace_html .= '<noscript>' . $img_html . '</noscript>';
126 126
 					
127
-					array_push( $search, $img_html );
128
-					array_push( $replace, $replace_html );
127
+					array_push($search, $img_html);
128
+					array_push($replace, $replace_html);
129 129
 				}
130 130
 			}
131 131
 		}
132 132
 
133
-		$content = str_replace( $search, $replace, $content );
134
-		$content = preg_replace_callback( '~' . chr(20) . '([0-9]+)' . chr(20) . '~', 'self::noscripts_restore', $content );
133
+		$content = str_replace($search, $replace, $content);
134
+		$content = preg_replace_callback('~' . chr(20) . '([0-9]+)' . chr(20) . '~', 'self::noscripts_restore', $content);
135 135
 		return $content;
136 136
 	}
137 137
 
138
-	static function noscripts_remove( $match ) {
138
+	static function noscripts_remove($match) {
139 139
 		self::$noscript_id++;
140 140
 		self::$noscripts[self::$noscript_id] = $match[0];
141 141
 		return chr(20) . self::$noscript_id . chr(20);
142 142
 	}
143 143
 
144
-	static function noscripts_restore( $match ) {
144
+	static function noscripts_restore($match) {
145 145
 		return self::$noscripts[(int) $match[1]];
146 146
 	}
147 147
 
148
-	static function add_class( $html_string = '', $new_class ) {
148
+	static function add_class($html_string = '', $new_class) {
149 149
 		$pattern = '/class=[\'"]([^\'"]*)[\'"]/';
150 150
 
151
-		if ( preg_match( $pattern, $html_string, $matches ) ) {
152
-			$defined_classes = explode( ' ', $matches[1] );
151
+		if (preg_match($pattern, $html_string, $matches)) {
152
+			$defined_classes = explode(' ', $matches[1]);
153 153
 
154
-			if ( ! in_array( $new_class, $defined_classes ) ) {
154
+			if ( ! in_array($new_class, $defined_classes)) {
155 155
 				$defined_classes[] = $new_class;
156 156
 
157 157
 				$html_string = str_replace(
158 158
 					$matches[0],
159
-					sprintf( 'class="%s"', implode( ' ', $defined_classes ) ),
159
+					sprintf('class="%s"', implode(' ', $defined_classes)),
160 160
 					$html_string
161 161
 				);
162 162
 			}
163 163
 		} else {
164
-			$html_string = preg_replace( '/(\<.+\s)/', sprintf( '$1class="%s" ', $new_class ), $html_string );
164
+			$html_string = preg_replace('/(\<.+\s)/', sprintf('$1class="%s" ', $new_class), $html_string);
165 165
 		}
166 166
 
167 167
 		return $html_string;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		return self::$enabled;
172 172
 	}
173 173
 
174
-	static function kses_allowed_html( $allowedtags, $context ) {
174
+	static function kses_allowed_html($allowedtags, $context) {
175 175
 		$allowedtags['noscript'] = array();
176 176
 		
177 177
 		$allowedtags['img']['data-src'] = true;
@@ -181,10 +181,10 @@  discard block
 block discarded – undo
181 181
 		return $allowedtags;
182 182
 	}
183 183
 
184
-	static function kses_allowed_protocols( $allowedprotocols ) {
184
+	static function kses_allowed_protocols($allowedprotocols) {
185 185
 		$allowedprotocols[] = 'data';
186 186
 		return $allowedprotocols;
187 187
 	}
188 188
 }
189 189
 
190
-add_action( 'init', array( 'LSX_LazyLoadImages', 'init' ) );
190
+add_action('init', array('LSX_LazyLoadImages', 'init'));
Please login to merge, or discard this patch.
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.
inc/template-tags.php 1 patch
Spacing   +161 added lines, -161 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * Yoast Breadcrumbs on Twitter Bootstrap
@@ -10,21 +10,21 @@  discard block
 block discarded – undo
10 10
  * @param string $sep Your custom separator
11 11
  */
12 12
 function lsx_breadcrumbs() {
13
-  if (!function_exists('yoast_breadcrumb') && !function_exists('woocommerce_breadcrumb')) {
13
+  if ( ! function_exists('yoast_breadcrumb') && ! function_exists('woocommerce_breadcrumb')) {
14 14
     return null;
15 15
   }
16 16
   
17 17
   $show_on_front = get_option('show_on_front');
18
-  if ( ('posts' == $show_on_front && is_home()) || ('page' == $show_on_front && is_front_page()) ) {
18
+  if (('posts' == $show_on_front && is_home()) || ('page' == $show_on_front && is_front_page())) {
19 19
   	return;
20 20
   }
21 21
 
22
-  if(function_exists('woocommerce_breadcrumb')){
22
+  if (function_exists('woocommerce_breadcrumb')) {
23 23
   		ob_start();
24 24
   		woocommerce_breadcrumb();
25 25
   		$output = ob_get_clean();
26 26
   		$output = str_replace('woocommerce-breadcrumb', 'woocommerce-breadcrumb breadcrumbs-container', $output);
27
-  }elseif(function_exists('yoast_breadcrumb')){
27
+  }elseif (function_exists('yoast_breadcrumb')) {
28 28
 	  	// Default Yoast Breadcrumbs Separator
29 29
 	  	$old_sep = '\&raquo\;';
30 30
 	  	
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 	  	$output = '<div class="breadcrumbs-container">' . $output . '</div>';
43 43
   }
44 44
   
45
-  $output = apply_filters('lsx_breadcrumbs',$output);
45
+  $output = apply_filters('lsx_breadcrumbs', $output);
46 46
 
47
-  echo wp_kses_post( $output );
47
+  echo wp_kses_post($output);
48 48
 }
49
-add_action( 'lsx_content_top', 'lsx_breadcrumbs', 100 );
49
+add_action('lsx_content_top', 'lsx_breadcrumbs', 100);
50 50
 
51 51
 /**
52 52
  * Replaces the seperator with a blank space.
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 function lsx_breadcrumbs_seperator_filter($seperator) {
56 56
 	return '';
57 57
 }
58
-add_filter( 'wpseo_breadcrumb_separator', 'lsx_breadcrumbs_seperator_filter' );
58
+add_filter('wpseo_breadcrumb_separator', 'lsx_breadcrumbs_seperator_filter');
59 59
 
60 60
 /**
61 61
  * Custom template tags for this theme.
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
  *
64 64
  * @package lsx
65 65
  */
66
-if ( ! function_exists( 'lsx_site_title' ) ) :
66
+if ( ! function_exists('lsx_site_title')) :
67 67
 	/**
68 68
 	 * Displays logo when applicable
69 69
 	 *
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 	function lsx_site_title() {
73 73
 		?>
74 74
 			<div class="site-branding">
75
-				<h1 class="site-title"><a title="<?php bloginfo( 'name' ); ?>" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
76
-				<p class="site-description"><?php bloginfo( 'description' ); ?></p>
75
+				<h1 class="site-title"><a title="<?php bloginfo('name'); ?>" href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></h1>
76
+				<p class="site-description"><?php bloginfo('description'); ?></p>
77 77
 			</div>		
78 78
 		<?php 
79 79
 	}
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
 /**
83 83
  * Add customisable post meta.
84 84
  */
85
-if ( ! function_exists( 'lsx_post_meta' ) ) {
85
+if ( ! function_exists('lsx_post_meta')) {
86 86
 	function lsx_post_meta() {
87
-		if ( ( is_page() && ! ( is_home() || is_front_page() ) ) && ! is_page_template( 'page-templates/template-blog.php' ) ) {
87
+		if ((is_page() && ! (is_home() || is_front_page())) && ! is_page_template('page-templates/template-blog.php')) {
88 88
 			return;
89 89
 		}
90 90
 		?>
@@ -99,83 +99,83 @@  discard block
 block discarded – undo
99 99
 /**
100 100
  * Add customisable post meta: post date
101 101
  */
102
-if ( ! function_exists( 'lsx_post_meta_date' ) ) {
102
+if ( ! function_exists('lsx_post_meta_date')) {
103 103
 	function lsx_post_meta_date() {
104 104
 		$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
105 105
 				
106
-		$time_string = sprintf( $time_string,
107
-			esc_attr( get_the_date( 'c' ) ),
106
+		$time_string = sprintf($time_string,
107
+			esc_attr(get_the_date('c')),
108 108
 			get_the_date(),
109
-			esc_attr( get_the_modified_date( 'c' ) ),
109
+			esc_attr(get_the_modified_date('c')),
110 110
 			get_the_modified_date()
111 111
 		);
112 112
 
113
-		printf( '<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>',
114
-			esc_html_x( 'Posted on:', 'Used before publish date.', 'lsx' ),
115
-			esc_url( get_permalink() ),
116
-			wp_kses_post( $time_string )
113
+		printf('<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>',
114
+			esc_html_x('Posted on:', 'Used before publish date.', 'lsx'),
115
+			esc_url(get_permalink()),
116
+			wp_kses_post($time_string)
117 117
 		);
118 118
 	}
119 119
 }
120
-add_action( 'lsx_content_post_meta', 'lsx_post_meta_date', 10 );
120
+add_action('lsx_content_post_meta', 'lsx_post_meta_date', 10);
121 121
 
122 122
 /**
123 123
  * Add customisable post meta: post author
124 124
  */
125
-if ( ! function_exists( 'lsx_post_meta_author' ) ) {
125
+if ( ! function_exists('lsx_post_meta_author')) {
126 126
 	function lsx_post_meta_author() {
127
-		printf( '<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>',
128
-			esc_html_x( 'Posted by:', 'Used before post author name.', 'lsx' ),
129
-			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
127
+		printf('<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>',
128
+			esc_html_x('Posted by:', 'Used before post author name.', 'lsx'),
129
+			esc_url(get_author_posts_url(get_the_author_meta('ID'))),
130 130
 			get_the_author()
131 131
 		);
132 132
 	}
133 133
 }
134
-add_action( 'lsx_content_post_meta', 'lsx_post_meta_author', 20 );
134
+add_action('lsx_content_post_meta', 'lsx_post_meta_author', 20);
135 135
 
136 136
 /**
137 137
  * Add customisable post meta: post category(ies)
138 138
  */
139
-if ( ! function_exists( 'lsx_post_meta_category' ) ) {
139
+if ( ! function_exists('lsx_post_meta_category')) {
140 140
 	function lsx_post_meta_category() {
141
-		$post_categories = wp_get_post_categories( get_the_ID() );
141
+		$post_categories = wp_get_post_categories(get_the_ID());
142 142
 		$cats = array();
143 143
 
144
-		foreach( $post_categories as $c ) {
145
-			$cat = get_category( $c );
146
-			$cats[] = '<a href="' . get_category_link( $cat->term_id ) . '" title="' . sprintf( esc_html__( 'View all posts in %s' , 'lsx' ), $cat->name ) . '" ' . '>' . $cat->name . '</a>';
144
+		foreach ($post_categories as $c) {
145
+			$cat = get_category($c);
146
+			$cats[] = '<a href="' . get_category_link($cat->term_id) . '" title="' . sprintf(esc_html__('View all posts in %s', 'lsx'), $cat->name) . '" ' . '>' . $cat->name . '</a>';
147 147
 		}
148 148
 
149
-		if ( ! empty( $cats ) ) {
149
+		if ( ! empty($cats)) {
150 150
 			?>
151
-			<span class="post-meta-categories"><span><?php esc_html_e( 'Posted in:', 'lsx' ); ?></span> <?php echo wp_kses_post( implode( ', ', $cats ) ); ?></span>
151
+			<span class="post-meta-categories"><span><?php esc_html_e('Posted in:', 'lsx'); ?></span> <?php echo wp_kses_post(implode(', ', $cats)); ?></span>
152 152
 			<?php
153 153
 		}
154 154
 	}
155 155
 }
156
-add_action( 'lsx_content_post_meta', 'lsx_post_meta_category', 30 );
156
+add_action('lsx_content_post_meta', 'lsx_post_meta_category', 30);
157 157
 
158 158
 /**
159 159
  * Add customisable post meta: post tag(s)
160 160
  */
161
-if ( ! function_exists( 'lsx_post_tags' ) ) {
161
+if ( ! function_exists('lsx_post_tags')) {
162 162
 	function lsx_post_tags() {
163
-		if ( has_tag() ) :
163
+		if (has_tag()) :
164 164
 			?>
165 165
 			<div class="post-tags">
166
-				<span><?php esc_html_e( 'Tagged as:', 'lsx' ); ?></span> <?php echo wp_kses_post( get_the_tag_list( '' ) ); ?>
166
+				<span><?php esc_html_e('Tagged as:', 'lsx'); ?></span> <?php echo wp_kses_post(get_the_tag_list('')); ?>
167 167
 			</div>
168 168
 			<?php
169 169
 		endif;
170 170
 	}
171 171
 }
172
-add_action( 'lsx_content_post_tags', 'lsx_post_tags', 10 );
172
+add_action('lsx_content_post_tags', 'lsx_post_tags', 10);
173 173
 
174 174
 /**
175 175
  * Add customisable post info: related posts
176 176
  */
177 177
 function lsx_related_posts() {
178
-	if ( is_singular( 'post' ) && class_exists( 'Jetpack_RelatedPosts' ) ) {
178
+	if (is_singular('post') && class_exists('Jetpack_RelatedPosts')) {
179 179
 		?>
180 180
 			<div class="row row-related-posts">
181 181
 				<div class="col-md-12">
@@ -185,15 +185,15 @@  discard block
 block discarded – undo
185 185
 		<?php
186 186
 	}
187 187
 }
188
-add_action( 'lsx_entry_bottom', 'lsx_related_posts', 10 );
188
+add_action('lsx_entry_bottom', 'lsx_related_posts', 10);
189 189
 
190 190
 /**
191 191
  * Translate post format to Font Awesome class
192 192
  */
193 193
 
194
-if ( ! function_exists( 'lsx_translate_format_to_fontawesome' ) ) {
195
-	function lsx_translate_format_to_fontawesome( $format ) {
196
-		switch ( $format ) {
194
+if ( ! function_exists('lsx_translate_format_to_fontawesome')) {
195
+	function lsx_translate_format_to_fontawesome($format) {
196
+		switch ($format) {
197 197
 			case 'image':
198 198
 				$format = 'camera';
199 199
 				break;
@@ -238,45 +238,45 @@  discard block
 block discarded – undo
238 238
  * to be added/modified where necessary.
239 239
  */
240 240
 
241
-if ( ! function_exists( 'lsx_portfolio_meta' ) ) {
241
+if ( ! function_exists('lsx_portfolio_meta')) {
242 242
 	function lsx_portfolio_meta() {
243 243
 		?>
244 244
 		<div id="portfolio-meta" class="portfolio-meta info-box-sticky info-box sticky-wrapper">
245 245
 			<?php 
246
-				$client = get_post_meta(get_the_ID(),'lsx-client',true);
247
-				if(false != $client){ ?>
246
+				$client = get_post_meta(get_the_ID(), 'lsx-client', true);
247
+				if (false != $client) { ?>
248 248
 					<div class="portfolio-client">
249
-						<span><span class="fa fa-user"></span><?php esc_html_e( 'Client','lsx' ); ?></span>
250
-						<span><?php echo esc_html( $client ); ?></span>
249
+						<span><span class="fa fa-user"></span><?php esc_html_e('Client', 'lsx'); ?></span>
250
+						<span><?php echo esc_html($client); ?></span>
251 251
 					</div>				
252 252
 			<?php }	?>
253 253
 
254 254
 			<?php 
255
-				$portfolio_type = get_the_term_list( get_the_ID(), 'jetpack-portfolio-type', '', ', ', '' );
255
+				$portfolio_type = get_the_term_list(get_the_ID(), 'jetpack-portfolio-type', '', ', ', '');
256 256
 				
257
-				if($portfolio_type){
257
+				if ($portfolio_type) {
258 258
 					?>
259 259
 					<div class="portfolio-industry">
260
-						<span><span class="fa fa-folder-open"></span><?php esc_html_e( 'Industry', 'lsx' ); ?></span>
261
-						<?php echo wp_kses_post( $portfolio_type ); ?>
260
+						<span><span class="fa fa-folder-open"></span><?php esc_html_e('Industry', 'lsx'); ?></span>
261
+						<?php echo wp_kses_post($portfolio_type); ?>
262 262
 					</div>			
263 263
 			<?php } ?>
264 264
 
265 265
 			<?php 
266
-				$services = get_the_term_list( get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '' );
267
-				if(false != $services){ ?>
266
+				$services = get_the_term_list(get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '');
267
+				if (false != $services) { ?>
268 268
 					<div class="portfolio-services">
269
-						<span><span class="fa fa-cog"></span><?php esc_html_e( 'Services', 'lsx' ); ?></span>
270
-						<?php echo wp_kses_post( $services ); ?>
269
+						<span><span class="fa fa-cog"></span><?php esc_html_e('Services', 'lsx'); ?></span>
270
+						<?php echo wp_kses_post($services); ?>
271 271
 					</div>				
272 272
 			<?php }	?>
273 273
 
274 274
 			<?php 
275
-				$website = esc_url( get_post_meta(get_the_ID(),'lsx-website',true) );
276
-				if(false != $website){ ?>
275
+				$website = esc_url(get_post_meta(get_the_ID(), 'lsx-website', true));
276
+				if (false != $website) { ?>
277 277
 					<div class="portfolio-website">
278
-						<span><span class="fa fa-link"></span><?php esc_html_e( 'Website', 'lsx' ); ?></span>
279
-						<a target="_blank" href="<?php echo esc_url( $website ); ?>"><?php echo esc_html( $website ) ?></a>
278
+						<span><span class="fa fa-link"></span><?php esc_html_e('Website', 'lsx'); ?></span>
279
+						<a target="_blank" href="<?php echo esc_url($website); ?>"><?php echo esc_html($website) ?></a>
280 280
 					</div>				
281 281
 			<?php }	?>
282 282
 
@@ -290,29 +290,29 @@  discard block
 block discarded – undo
290 290
  *
291 291
  */
292 292
 
293
-if ( ! function_exists( 'lsx_portfolio_gallery' ) ) {
293
+if ( ! function_exists('lsx_portfolio_gallery')) {
294 294
 	function lsx_portfolio_gallery() {
295 295
 
296
-		$media = get_attached_media( 'image' );
296
+		$media = get_attached_media('image');
297 297
 		$media_array = array();
298 298
 		$post_thumbnail_id = get_post_thumbnail_id(get_the_ID());
299 299
 		
300
-		if(!empty($media)){
301
-			foreach($media as $media_item){
302
-				if($post_thumbnail_id != $media_item->ID) {
300
+		if ( ! empty($media)) {
301
+			foreach ($media as $media_item) {
302
+				if ($post_thumbnail_id != $media_item->ID) {
303 303
 					$media_array[] = $media_item->ID;
304 304
 				}
305 305
 			}
306 306
 				
307
-			if(!empty($media_array)){
308
-				echo wp_kses_post( gallery_shortcode( array( 'size' => 'full', 'ids' => implode( ',', $media_array ) ) ) );
307
+			if ( ! empty($media_array)) {
308
+				echo wp_kses_post(gallery_shortcode(array('size' => 'full', 'ids' => implode(',', $media_array))));
309 309
 			}
310 310
 		}
311 311
 		
312 312
 	}
313 313
 }
314 314
 
315
-if ( ! function_exists( 'lsx_paging_nav' ) ) :
315
+if ( ! function_exists('lsx_paging_nav')) :
316 316
 	/**
317 317
 	 * Display navigation to next/previous set of posts when applicable.
318 318
 	 *
@@ -320,33 +320,33 @@  discard block
 block discarded – undo
320 320
 	 */
321 321
 	function lsx_paging_nav() {
322 322
 		// Don't print empty markup if there's only one page.
323
-		if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
323
+		if ($GLOBALS['wp_query']->max_num_pages < 2) {
324 324
 			return;
325 325
 		}
326 326
 		
327
-		if(current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')){
327
+		if (current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')) {
328 328
 			return true;
329
-		}elseif(function_exists('wp_pagenavi')){
329
+		}elseif (function_exists('wp_pagenavi')) {
330 330
 			wp_pagenavi();
331
-		}else{
331
+		} else {
332 332
 			
333 333
 			$labels = array(
334
-				'next' 		=> '<span class="meta-nav">&larr;</span> '.esc_html__( 'Older posts', 'lsx' ),
335
-				'previous' 	=> esc_html__( 'Newer posts', 'lsx' ).' <span class="meta-nav">&rarr;</span>',
336
-				'title' 	=> esc_html__( 'Posts navigation', 'lsx' )
334
+				'next' 		=> '<span class="meta-nav">&larr;</span> ' . esc_html__('Older posts', 'lsx'),
335
+				'previous' 	=> esc_html__('Newer posts', 'lsx') . ' <span class="meta-nav">&rarr;</span>',
336
+				'title' 	=> esc_html__('Posts navigation', 'lsx')
337 337
 			);
338
-			$labels = apply_filters('lsx_post_navigation_labels',$labels);
338
+			$labels = apply_filters('lsx_post_navigation_labels', $labels);
339 339
 			?>
340 340
 			<nav class="navigation paging-navigation" role="navigation">
341 341
 				<div class="lsx-breaker"></div>
342
-				<h1 class="screen-reader-text"><?php echo esc_html( $labels['title'] ); ?></h1>
342
+				<h1 class="screen-reader-text"><?php echo esc_html($labels['title']); ?></h1>
343 343
 				<div class="nav-links">
344
-					<?php if ( get_next_posts_link() ) : ?>
345
-					<div class="nav-previous"><?php next_posts_link( $labels['next'] ); ?></div>
344
+					<?php if (get_next_posts_link()) : ?>
345
+					<div class="nav-previous"><?php next_posts_link($labels['next']); ?></div>
346 346
 					<?php endif; ?>
347 347
 		
348
-					<?php if ( get_previous_posts_link() ) : ?>
349
-					<div class="nav-next"><?php previous_posts_link( $labels['previous'] ); ?></div>
348
+					<?php if (get_previous_posts_link()) : ?>
349
+					<div class="nav-next"><?php previous_posts_link($labels['previous']); ?></div>
350 350
 					<?php endif; ?>
351 351
 					
352 352
 					<div class="clearfix"></div>
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 	}
358 358
 endif;
359 359
 
360
-if ( ! function_exists( 'lsx_post_nav' ) ) :
360
+if ( ! function_exists('lsx_post_nav')) :
361 361
 /**
362 362
  * Display navigation to next/previous post when applicable.
363 363
  *
@@ -365,10 +365,10 @@  discard block
 block discarded – undo
365 365
  */
366 366
 function lsx_post_nav() {
367 367
 	// Don't print empty markup if there's nowhere to navigate.
368
-	$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
369
-	$next     = get_adjacent_post( false, '', false );
368
+	$previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true);
369
+	$next     = get_adjacent_post(false, '', false);
370 370
 
371
-	if ( ! $next && ! $previous ) {
371
+	if ( ! $next && ! $previous) {
372 372
 		return;
373 373
 	}
374 374
 	?>
@@ -378,14 +378,14 @@  discard block
 block discarded – undo
378 378
 		<div class="nav-links pager row">
379 379
 
380 380
 			<?php
381
-				$previous_post = get_previous_post_link( '%link', '<div class="previous col-md-6"><p class="nav-links-description">'._x( 'Previous Post', 'Previous post link', 'lsx' ).'</p><h3>%title</h3></div>' );
382
-				$previous_post = str_replace('<a','<a',$previous_post);
383
-				echo wp_kses_post( $previous_post );
381
+				$previous_post = get_previous_post_link('%link', '<div class="previous col-md-6"><p class="nav-links-description">' . _x('Previous Post', 'Previous post link', 'lsx') . '</p><h3>%title</h3></div>');
382
+				$previous_post = str_replace('<a', '<a', $previous_post);
383
+				echo wp_kses_post($previous_post);
384 384
 			?>
385 385
 			<?php
386
-				$next_post = get_next_post_link( '%link', '<div class="next col-md-6"><p class="nav-links-description">'._x( 'Next Post', 'Next post link', 'lsx' ).'</p><h3>%title</h3></div>' );
387
-				$next_post = str_replace('<a','<a',$next_post);
388
-				echo wp_kses_post( $next_post );
386
+				$next_post = get_next_post_link('%link', '<div class="next col-md-6"><p class="nav-links-description">' . _x('Next Post', 'Next post link', 'lsx') . '</p><h3>%title</h3></div>');
387
+				$next_post = str_replace('<a', '<a', $next_post);
388
+				echo wp_kses_post($next_post);
389 389
 			?>
390 390
 
391 391
 		</div><!-- .nav-links -->
@@ -401,16 +401,16 @@  discard block
 block discarded – undo
401 401
  * @subpackage	template-tags
402 402
  * @category	header
403 403
  */
404
-if(!function_exists('lsx_site_identity')){
405
-	function lsx_site_identity(){
404
+if ( ! function_exists('lsx_site_identity')) {
405
+	function lsx_site_identity() {
406 406
 
407
-		if ( function_exists('has_custom_logo') && has_custom_logo() ) {
407
+		if (function_exists('has_custom_logo') && has_custom_logo()) {
408 408
 			the_custom_logo();
409
-		}elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) {
409
+		}elseif (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) {
410 410
 			jetpack_the_site_logo();
411
-		}else{
411
+		} else {
412 412
 			// shouldn't show both together.. its just strange
413
-			if(true == get_theme_mod('site_logo_header_text',1)){
413
+			if (true == get_theme_mod('site_logo_header_text', 1)) {
414 414
 				lsx_site_title();
415 415
 			}
416 416
 		}
@@ -425,17 +425,17 @@  discard block
 block discarded – undo
425 425
  * @subpackage	template-tags
426 426
  * @category	navigation
427 427
  */
428
-if(!function_exists('lsx_navbar_header')){
429
-	function lsx_navbar_header(){ ?>
428
+if ( ! function_exists('lsx_navbar_header')) {
429
+	function lsx_navbar_header() { ?>
430 430
 	   	<div class="navbar-header" itemscope itemtype="http://schema.org/WebPage">
431 431
 	   	
432 432
 	   		<?php 
433
-	   		$nav_menu = get_theme_mod('nav_menu_locations',false);
433
+	   		$nav_menu = get_theme_mod('nav_menu_locations', false);
434 434
 			//print_r(get_nav_menu_locations());
435 435
 
436
-	   		if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?>
436
+	   		if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?>
437 437
 		   		<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".primary-navbar">
438
-		        	<span class="sr-only"><?php esc_html_e( 'Toggle navigation', 'lsx' ); ?></span>
438
+		        	<span class="sr-only"><?php esc_html_e('Toggle navigation', 'lsx'); ?></span>
439 439
 		        	<span class="icon-bar"></span>
440 440
 		        	<span class="icon-bar"></span>
441 441
 		        	<span class="icon-bar"></span>
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 	<?php }
448 448
 }
449 449
 //the if statement is for backwards compatability with previous versions of the theme.
450
-add_action('lsx_nav_before','lsx_navbar_header');
450
+add_action('lsx_nav_before', 'lsx_navbar_header');
451 451
 
452 452
 /**
453 453
  * Outputs the Nav Menu
@@ -456,16 +456,16 @@  discard block
 block discarded – undo
456 456
  * @subpackage	template-tags
457 457
  * @category	navigation
458 458
  */
459
-if(!function_exists('lsx_nav_menu')){
460
-	function lsx_nav_menu(){
461
-		$nav_menu = get_theme_mod('nav_menu_locations',false);
459
+if ( ! function_exists('lsx_nav_menu')) {
460
+	function lsx_nav_menu() {
461
+		$nav_menu = get_theme_mod('nav_menu_locations', false);
462 462
 		
463 463
 		//print_r(get_nav_menu_locations());
464 464
 
465
-	    if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?>
465
+	    if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?>
466 466
 			<nav class="primary-navbar collapse navbar-collapse">
467 467
 		    	<?php
468
-				wp_nav_menu( array(
468
+				wp_nav_menu(array(
469 469
 					'theme_location' => 'primary',
470 470
 					'menu' => $nav_menu['primary'],
471 471
 					'depth' => 3,
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
  * @subpackage	template-tags
487 487
  * @category	sitemap
488 488
  */
489
-function lsx_sitemap_pages(){
489
+function lsx_sitemap_pages() {
490 490
 	$page_args = array(
491 491
 		'post_type'		=>	'page',
492 492
 		'posts_per_page'=>	99,
@@ -494,13 +494,13 @@  discard block
 block discarded – undo
494 494
 		'post_type'		=>	'page',
495 495
 	);
496 496
 	$pages = new WP_Query($page_args);
497
-	if($pages->have_posts()){
497
+	if ($pages->have_posts()) {
498 498
 
499
-		echo '<h2>' . esc_html__( 'Pages', 'lsx' ) . '</h2>';
499
+		echo '<h2>' . esc_html__('Pages', 'lsx') . '</h2>';
500 500
 
501 501
 		echo '<ul>';
502
-		while($pages->have_posts()){ $pages->the_post();
503
-			echo '<li class="page_item page-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>';
502
+		while ($pages->have_posts()) { $pages->the_post();
503
+			echo '<li class="page_item page-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>';
504 504
 		}
505 505
 		echo '</ul>';
506 506
 		
@@ -515,13 +515,13 @@  discard block
 block discarded – undo
515 515
  * @subpackage	template-tags
516 516
  * @category	sitemap
517 517
  */
518
-function lsx_sitemap_custom_post_type(){
518
+function lsx_sitemap_custom_post_type() {
519 519
 	$args = array(
520 520
 		'public'				=> true,
521 521
 		'_builtin' 				=> false
522 522
 	);
523
-	$post_types = get_post_types($args , 'names');
524
-	foreach($post_types as $post_type){	
523
+	$post_types = get_post_types($args, 'names');
524
+	foreach ($post_types as $post_type) {	
525 525
 
526 526
 		$post_type_args = array(
527 527
 			'post_type'		=>	'page',
@@ -532,19 +532,19 @@  discard block
 block discarded – undo
532 532
 		$post_type_items = new WP_Query($post_type_args);
533 533
 		
534 534
 		$post_type_object = get_post_type_object($post_type);
535
-		if(null != $post_type_object){
535
+		if (null != $post_type_object) {
536 536
 			$title = $post_type_object->labels->name;
537
-		}else{
537
+		} else {
538 538
 			$title = ucwords($post_type);
539 539
 		}
540 540
 		
541
-		if($post_type_items->have_posts()){
541
+		if ($post_type_items->have_posts()) {
542 542
 	
543
-			echo '<h2>' . esc_html( $title ) . '</h2>';
543
+			echo '<h2>' . esc_html($title) . '</h2>';
544 544
 	
545 545
 			echo '<ul>';
546
-			while($post_type_items->have_posts()){ $post_type_items->the_post();
547
-				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>';
546
+			while ($post_type_items->have_posts()) { $post_type_items->the_post();
547
+				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>';
548 548
 			}
549 549
 			echo '</ul>';
550 550
 	
@@ -560,20 +560,20 @@  discard block
 block discarded – undo
560 560
  * @subpackage	template-tags
561 561
  * @category	sitemap
562 562
  */
563
-function lsx_sitemap_taxonomy_clouds(){
563
+function lsx_sitemap_taxonomy_clouds() {
564 564
 
565
-		$taxonomy_args =  array(
565
+		$taxonomy_args = array(
566 566
 			'public'				=> true,
567 567
 			'_builtin' 				=> false
568 568
 		);
569 569
 		$taxonomies = get_taxonomies($taxonomy_args);
570
-		if(!empty($taxonomies)){
571
-			foreach($taxonomies as $taxonomy_id => $taxonomy) {
570
+		if ( ! empty($taxonomies)) {
571
+			foreach ($taxonomies as $taxonomy_id => $taxonomy) {
572 572
 
573
-				$tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id,'echo'=>false));
574
-				if(null != $tag_cloud){
575
-					echo '<h2>' . esc_html( $taxonomy ) . '</h2>';
576
-					echo '<aside id="' . esc_attr( $taxonomy_id ) . '" class="widget widget_' . esc_attr( $taxonomy_id ) . '">' . esc_html( $tag_cloud ) . '</aside>';
573
+				$tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id, 'echo'=>false));
574
+				if (null != $tag_cloud) {
575
+					echo '<h2>' . esc_html($taxonomy) . '</h2>';
576
+					echo '<aside id="' . esc_attr($taxonomy_id) . '" class="widget widget_' . esc_attr($taxonomy_id) . '">' . esc_html($tag_cloud) . '</aside>';
577 577
 		        }
578 578
 	        }
579 579
         } 
@@ -586,15 +586,15 @@  discard block
 block discarded – undo
586 586
  * @subpackage	hooks
587 587
  * @category	forms
588 588
  */
589
-add_action( 'lsx_footer_before', 'lsx_footer_subscription_cta', 10 );
589
+add_action('lsx_footer_before', 'lsx_footer_subscription_cta', 10);
590 590
 function lsx_footer_subscription_cta() {
591
-	if(!function_exists('lsx_is_form_enabled')){ return; }
591
+	if ( ! function_exists('lsx_is_form_enabled')) { return; }
592 592
 	$subscribe_form_id = lsx_is_form_enabled('subscribe');
593
-	if(false == $subscribe_form_id) { return; }
593
+	if (false == $subscribe_form_id) { return; }
594 594
 
595 595
 	//add Caldera Forms Fields Scripts
596
-	if( defined( 'CFCORE_VER' ) ){
597
-		wp_enqueue_script( 'cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER );
596
+	if (defined('CFCORE_VER')) {
597
+		wp_enqueue_script('cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER);
598 598
 	}
599 599
 
600 600
 	?>
@@ -602,8 +602,8 @@  discard block
 block discarded – undo
602 602
 		<div class="container">
603 603
 			<div class="row">
604 604
 				<div class="col-md-12">
605
-					<h2><?php esc_html_e( 'Subscribe to Our Newsletter', 'lsx' ); ?></h2>
606
-					<?php echo do_shortcode( '[caldera_form id="'.$subscribe_form_id.'"]' ); ?>
605
+					<h2><?php esc_html_e('Subscribe to Our Newsletter', 'lsx'); ?></h2>
606
+					<?php echo do_shortcode('[caldera_form id="' . $subscribe_form_id . '"]'); ?>
607 607
 				</div>
608 608
 			</div>
609 609
 		</div>
@@ -618,14 +618,14 @@  discard block
 block discarded – undo
618 618
  * @subpackage	hooks
619 619
  * @category	menu
620 620
  */
621
-add_action( 'lsx_header_top', 'lsx_add_top_menu' );
621
+add_action('lsx_header_top', 'lsx_add_top_menu');
622 622
 function lsx_add_top_menu() {
623 623
 	if (has_nav_menu('top-menu')) { ?>
624 624
 		<div id="top-menu" class="<?php lsx_top_menu_classes(); ?>">
625 625
 			<div class="container">
626 626
 				<nav class="top-menu">
627 627
 		    		<?php
628
-		    			wp_nav_menu( array(
628
+		    			wp_nav_menu(array(
629 629
 							'theme_location' => 'top-menu',
630 630
 							'walker' => new Lsx_Bootstrap_Navwalker())
631 631
 						);
@@ -643,24 +643,24 @@  discard block
 block discarded – undo
643 643
  * @subpackage	template-tag
644 644
  * @category 	forms
645 645
  */
646
-if ( class_exists('Caldera_Forms') && !function_exists( 'lsx_is_form_enabled' ) ) {
646
+if (class_exists('Caldera_Forms') && ! function_exists('lsx_is_form_enabled')) {
647 647
 	function lsx_is_form_enabled($slug = false) {
648
-		if(false == $slug){ return false; }
648
+		if (false == $slug) { return false; }
649 649
 	
650 650
 		$match = false;
651
-		$forms = get_option( '_caldera_forms' , false );
652
-		if(false !== $forms ) {
653
-			foreach($forms as $form_id=>$form_maybe){
654
-				if( trim(strtolower($slug)) == strtolower($form_maybe['name']) ){
651
+		$forms = get_option('_caldera_forms', false);
652
+		if (false !== $forms) {
653
+			foreach ($forms as $form_id=>$form_maybe) {
654
+				if (trim(strtolower($slug)) == strtolower($form_maybe['name'])) {
655 655
 					$match = $form_id;
656 656
 					break;
657 657
 				}
658 658
 			}
659 659
 		}
660
-		if( false === $match ){
661
-			$is_form = Caldera_Forms::get_form( strtolower( $slug ) );
662
-			if( !empty( $is_form ) ){
663
-				return strtolower( $slug );
660
+		if (false === $match) {
661
+			$is_form = Caldera_Forms::get_form(strtolower($slug));
662
+			if ( ! empty($is_form)) {
663
+				return strtolower($slug);
664 664
 			}
665 665
 		}
666 666
 	
@@ -676,10 +676,10 @@  discard block
 block discarded – undo
676 676
  * @category 	urls
677 677
  */
678 678
 function lsx_get_my_url() {
679
-	if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) )
679
+	if ( ! preg_match('/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches))
680 680
 		return false;
681 681
 
682
-	return esc_url_raw( $matches[1] );
682
+	return esc_url_raw($matches[1]);
683 683
 }
684 684
 
685 685
 /**
@@ -689,19 +689,19 @@  discard block
 block discarded – undo
689 689
  * @subpackage 	extras
690 690
  * @category 	urls
691 691
  */
692
-function lsx_get_template_part($slug,$part) {
692
+function lsx_get_template_part($slug, $part) {
693 693
 	$template = array();
694 694
 	$part = (string) $part;
695
-	if ( '' !== $part ){
695
+	if ('' !== $part) {
696 696
 		$template = "{$slug}-{$part}.php";
697
-	}else{
697
+	} else {
698 698
 		$template = "{$slug}.php";
699 699
 	}
700
-	$file_path = apply_filters('lsx_content_path',false,$slug,$part);
700
+	$file_path = apply_filters('lsx_content_path', false, $slug, $part);
701 701
 
702
-	if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) {
703
-		load_template( $file_path.$template, false );
704
-	}else{
705
-		get_template_part($slug,$part);
702
+	if (false !== $file_path && '' == locate_template(array($template)) && file_exists($file_path . $template)) {
703
+		load_template($file_path . $template, false);
704
+	} else {
705
+		get_template_part($slug, $part);
706 706
 	}
707 707
 }
708 708
\ No newline at end of file
Please login to merge, or discard this patch.