Passed
Push — master ( 83cb5d...82420f )
by Warwick
02:06
created
includes/scripts.php 1 patch
Spacing   +40 added lines, -40 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_register_style( 'fontawesome', get_template_directory_uri() . '/assets/css/vendor/font-awesome.css', array(), LSX_VERSION );
57
-		wp_style_add_data( 'fontawesome', 'rtl', 'replace' );
56
+		wp_register_style('fontawesome', get_template_directory_uri() . '/assets/css/vendor/font-awesome.css', array(), LSX_VERSION);
57
+		wp_style_add_data('fontawesome', 'rtl', 'replace');
58 58
 
59
-		wp_register_style( 'bootstrap', get_template_directory_uri() . '/assets/css/vendor/bootstrap.css', array(), LSX_VERSION );
60
-		wp_style_add_data( 'bootstrap', 'rtl', 'replace' );
59
+		wp_register_style('bootstrap', get_template_directory_uri() . '/assets/css/vendor/bootstrap.css', array(), LSX_VERSION);
60
+		wp_style_add_data('bootstrap', 'rtl', 'replace');
61 61
 
62
-		wp_enqueue_style( 'slick', get_template_directory_uri() . '/assets/css/vendor/slick.css', array(), LSX_VERSION, null );
63
-		wp_enqueue_style( 'slick-lightbox', get_template_directory_uri() . '/assets/css/vendor/slick-lightbox.css', array( 'slick' ), LSX_VERSION, null );
62
+		wp_enqueue_style('slick', get_template_directory_uri() . '/assets/css/vendor/slick.css', array(), LSX_VERSION, null);
63
+		wp_enqueue_style('slick-lightbox', get_template_directory_uri() . '/assets/css/vendor/slick-lightbox.css', array('slick'), LSX_VERSION, null);
64 64
 
65
-		wp_enqueue_style( 'lsx_main_style', get_template_directory_uri() . '/style.css', array(), LSX_VERSION );
66
-		wp_enqueue_style( 'lsx_main', get_template_directory_uri() . '/assets/css/lsx.css', array( 'lsx_main_style', 'fontawesome', 'bootstrap', 'slick', 'slick-lightbox' ), LSX_VERSION );
67
-		wp_style_add_data( 'lsx_main', 'rtl', 'replace' );
65
+		wp_enqueue_style('lsx_main_style', get_template_directory_uri() . '/style.css', array(), LSX_VERSION);
66
+		wp_enqueue_style('lsx_main', get_template_directory_uri() . '/assets/css/lsx.css', array('lsx_main_style', 'fontawesome', 'bootstrap', 'slick', 'slick-lightbox'), LSX_VERSION);
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
 	/**
75 75
 	 * Enqueue fonts.
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	function lsx_scripts_add_fonts() {
81 81
 
82
-		$disable_fonts = get_theme_mod( 'lsx_disable_fonts', false );
83
-		if ( false !== $disable_fonts ) {
82
+		$disable_fonts = get_theme_mod('lsx_disable_fonts', false);
83
+		if (false !== $disable_fonts) {
84 84
 			return;
85 85
 		}
86 86
 
@@ -161,14 +161,14 @@  discard block
 block discarded – undo
161 161
 			.single-testimonial .entry-content:before{font-family:\'Lora\',serif}
162 162
 		';
163 163
 
164
-		if ( ! empty( $font_styles ) ) {
165
-			wp_add_inline_style( 'lsx_main', $font_styles );
164
+		if ( ! empty($font_styles)) {
165
+			wp_add_inline_style('lsx_main', $font_styles);
166 166
 		}
167 167
 	}
168 168
 
169 169
 endif;
170 170
 
171
-if ( ! function_exists( 'lsx_scripts_add_scripts' ) ) :
171
+if ( ! function_exists('lsx_scripts_add_scripts')) :
172 172
 
173 173
 	/**
174 174
 	 * Enqueue scripts.
@@ -177,38 +177,38 @@  discard block
 block discarded – undo
177 177
 	 * @subpackage scripts
178 178
 	 */
179 179
 	function lsx_scripts_add_scripts() {
180
-		if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
181
-			wp_enqueue_script( 'comment-reply' );
180
+		if (is_singular() && comments_open() && get_option('thread_comments')) {
181
+			wp_enqueue_script('comment-reply');
182 182
 		}
183 183
 
184
-		wp_enqueue_script( 'platform', get_template_directory_uri() . '/assets/js/vendor/platform.min.js', array(), LSX_VERSION, true );
185
-		wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/js/vendor/bootstrap.min.js', array( 'jquery' ), LSX_VERSION, true );
184
+		wp_enqueue_script('platform', get_template_directory_uri() . '/assets/js/vendor/platform.min.js', array(), LSX_VERSION, true);
185
+		wp_enqueue_script('bootstrap', get_template_directory_uri() . '/assets/js/vendor/bootstrap.min.js', array('jquery'), LSX_VERSION, true);
186 186
 
187
-		wp_enqueue_script( 'imagesLoaded', get_template_directory_uri() . '/assets/js/vendor/imagesloaded.pkgd.min.js', array( 'masonry' ), LSX_VERSION, true );
188
-		wp_enqueue_script( 'scrolltofixed', get_template_directory_uri() . '/assets/js/vendor/jquery-scrolltofixed-min.js', array( 'jquery' ), LSX_VERSION, true );
189
-		wp_enqueue_script( 'slick', get_template_directory_uri() . '/assets/js/vendor/slick.min.js', array( 'jquery' ), LSX_VERSION, true );
190
-		wp_enqueue_script( 'slick-lightbox', get_template_directory_uri() . '/assets/js/vendor/slick-lightbox.min.js', array( 'jquery', 'slick' ), LSX_VERSION, true );
191
-		wp_enqueue_script( 'picturefill', get_template_directory_uri() . '/assets/js/vendor/picturefill.min.js', array(), LSX_VERSION, true );
187
+		wp_enqueue_script('imagesLoaded', get_template_directory_uri() . '/assets/js/vendor/imagesloaded.pkgd.min.js', array('masonry'), LSX_VERSION, true);
188
+		wp_enqueue_script('scrolltofixed', get_template_directory_uri() . '/assets/js/vendor/jquery-scrolltofixed-min.js', array('jquery'), LSX_VERSION, true);
189
+		wp_enqueue_script('slick', get_template_directory_uri() . '/assets/js/vendor/slick.min.js', array('jquery'), LSX_VERSION, true);
190
+		wp_enqueue_script('slick-lightbox', get_template_directory_uri() . '/assets/js/vendor/slick-lightbox.min.js', array('jquery', 'slick'), LSX_VERSION, true);
191
+		wp_enqueue_script('picturefill', get_template_directory_uri() . '/assets/js/vendor/picturefill.min.js', array(), LSX_VERSION, true);
192 192
 
193
-		if ( defined( 'SCRIPT_DEBUG' ) ) {
193
+		if (defined('SCRIPT_DEBUG')) {
194 194
 			$prefix = 'src/';
195 195
 			$suffix = '';
196 196
 		} else {
197 197
 			$prefix = '';
198 198
 			$suffix = '.min';
199 199
 		}
200
-		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 );
200
+		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);
201 201
 
202 202
 		$param_array = array(
203
-			'columns' => apply_filters( 'lsx_archive_column_number', 3 ),
203
+			'columns' => apply_filters('lsx_archive_column_number', 3),
204 204
 		);
205 205
 
206
-		wp_localize_script( 'lsx_script', 'lsx_params', $param_array );
206
+		wp_localize_script('lsx_script', 'lsx_params', $param_array);
207 207
 	}
208 208
 
209 209
 endif;
210 210
 
211
-if ( ! function_exists( 'lsx_scripts_child_theme' ) ) :
211
+if ( ! function_exists('lsx_scripts_child_theme')) :
212 212
 
213 213
 	/**
214 214
 	 * Enqueue scripts and styles (for child theme).
@@ -217,12 +217,12 @@  discard block
 block discarded – undo
217 217
 	 * @subpackage scripts
218 218
 	 */
219 219
 	function lsx_scripts_child_theme() {
220
-		if ( is_child_theme() && file_exists( get_stylesheet_directory() . '/assets/css/custom.css' ) ) {
221
-			wp_enqueue_style( 'child-css', get_stylesheet_directory_uri() . '/assets/css/custom.css', array( 'lsx_main' ), LSX_VERSION );
222
-			wp_style_add_data( 'child-css', 'rtl', 'replace' );
220
+		if (is_child_theme() && file_exists(get_stylesheet_directory() . '/assets/css/custom.css')) {
221
+			wp_enqueue_style('child-css', get_stylesheet_directory_uri() . '/assets/css/custom.css', array('lsx_main'), LSX_VERSION);
222
+			wp_style_add_data('child-css', 'rtl', 'replace');
223 223
 		}
224 224
 	}
225 225
 
226 226
 endif;
227 227
 
228
-add_action( 'wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999 );
228
+add_action('wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999);
Please login to merge, or discard this patch.
includes/extras.php 1 patch
Spacing   +153 added lines, -153 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @subpackage extras
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
  * @package    lsx
17 17
  * @subpackage extras
18 18
  */
19
-add_filter( 'widget_text', 'shortcode_unautop' );
20
-add_filter( 'widget_text', 'do_shortcode' );
19
+add_filter('widget_text', 'shortcode_unautop');
20
+add_filter('widget_text', 'do_shortcode');
21 21
 
22
-if ( ! function_exists( 'lsx_kses_allowed_html' ) ) :
22
+if ( ! function_exists('lsx_kses_allowed_html')) :
23 23
 
24 24
 	/**
25 25
 	 * Enable extra attributes (srcset, sizes) in img tag.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @package    lsx
28 28
 	 * @subpackage extras
29 29
 	 */
30
-	function lsx_kses_allowed_html( $allowedtags, $context ) {
30
+	function lsx_kses_allowed_html($allowedtags, $context) {
31 31
 		$allowedtags['img']['srcset'] = true;
32 32
 		$allowedtags['img']['sizes']  = true;
33 33
 
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 
43 43
 endif;
44 44
 
45
-add_filter( 'wp_kses_allowed_html', 'lsx_kses_allowed_html', 10, 2 );
45
+add_filter('wp_kses_allowed_html', 'lsx_kses_allowed_html', 10, 2);
46 46
 
47
-if ( ! function_exists( 'lsx_body_class' ) ) :
47
+if ( ! function_exists('lsx_body_class')) :
48 48
 
49 49
 	/**
50 50
 	 * Add and remove body_class() classes.
@@ -52,44 +52,44 @@  discard block
 block discarded – undo
52 52
 	 * @package    lsx
53 53
 	 * @subpackage extras
54 54
 	 */
55
-	function lsx_body_class( $classes ) {
55
+	function lsx_body_class($classes) {
56 56
 		global $post;
57 57
 
58
-		$header_layout = get_theme_mod( 'lsx_header_layout', 'inline' );
58
+		$header_layout = get_theme_mod('lsx_header_layout', 'inline');
59 59
 		$classes[]     = 'header-' . $header_layout;
60 60
 
61
-		if ( isset( $post ) ) {
61
+		if (isset($post)) {
62 62
 			$classes[] = $post->post_name;
63 63
 		}
64 64
 
65
-		if ( ! class_exists( 'LSX_Banners' ) || ! empty( apply_filters( 'lsx_banner_plugin_disable', false ) ) ) {
66
-			$post_types = array( 'page', 'post' );
67
-			$post_types = apply_filters( 'lsx_allowed_post_type_banners', $post_types );
65
+		if ( ! class_exists('LSX_Banners') || ! empty(apply_filters('lsx_banner_plugin_disable', false))) {
66
+			$post_types = array('page', 'post');
67
+			$post_types = apply_filters('lsx_allowed_post_type_banners', $post_types);
68 68
 
69
-			if ( is_singular( $post_types ) && has_post_thumbnail() ) {
69
+			if (is_singular($post_types) && has_post_thumbnail()) {
70 70
 				$classes[] = 'page-has-banner';
71 71
 			}
72 72
 		}
73 73
 
74
-		if ( has_nav_menu( 'top-menu' ) || has_nav_menu( 'top-menu-left' ) ) {
74
+		if (has_nav_menu('top-menu') || has_nav_menu('top-menu-left')) {
75 75
 			$classes[] = 'has-top-menu';
76 76
 		}
77 77
 
78
-		$fixed_header = get_theme_mod( 'lsx_header_fixed', false );
78
+		$fixed_header = get_theme_mod('lsx_header_fixed', false);
79 79
 
80
-		if ( false !== $fixed_header ) {
80
+		if (false !== $fixed_header) {
81 81
 			$classes[] = 'top-menu-fixed';
82 82
 		}
83 83
 
84
-		$search_form  = get_theme_mod( 'lsx_header_search', false );
84
+		$search_form = get_theme_mod('lsx_header_search', false);
85 85
 
86
-		if ( false !== $search_form ) {
86
+		if (false !== $search_form) {
87 87
 			$classes[] = 'has-header-search';
88 88
 		}
89 89
 
90
-		$preloader_content  = get_theme_mod( 'lsx_preloader_content_status', false );
90
+		$preloader_content = get_theme_mod('lsx_preloader_content_status', false);
91 91
 
92
-		if ( false !== $preloader_content ) {
92
+		if (false !== $preloader_content) {
93 93
 			$classes[] = 'preloader-content-enable';
94 94
 		}
95 95
 
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 
99 99
 endif;
100 100
 
101
-add_filter( 'body_class', 'lsx_body_class' );
101
+add_filter('body_class', 'lsx_body_class');
102 102
 
103
-if ( ! function_exists( 'lsx_embed_wrap' ) ) :
103
+if ( ! function_exists('lsx_embed_wrap')) :
104 104
 
105 105
 	/**
106 106
 	 * Wrap embedded media as suggested by Readability.
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 	 * @link https://gist.github.com/965956
112 112
 	 * @link http://www.readability.com/publishers/guidelines#publisher
113 113
 	 */
114
-	function lsx_embed_wrap( $cache, $url, $attr = '', $post_id = '' ) {
115
-		if ( false !== strpos( $cache, '<iframe' ) ) {
114
+	function lsx_embed_wrap($cache, $url, $attr = '', $post_id = '') {
115
+		if (false !== strpos($cache, '<iframe')) {
116 116
 			return '<div class="entry-content-asset">' . $cache . '</div>';
117 117
 		}
118 118
 
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
 
122 122
 endif;
123 123
 
124
-add_filter( 'embed_oembed_html', 'lsx_embed_wrap', 10, 4 );
124
+add_filter('embed_oembed_html', 'lsx_embed_wrap', 10, 4);
125 125
 
126
-if ( ! function_exists( 'lsx_remove_self_closing_tags' ) ) :
126
+if ( ! function_exists('lsx_remove_self_closing_tags')) :
127 127
 
128 128
 	/**
129 129
 	 * Remove unnecessary self-closing tags.
@@ -131,17 +131,17 @@  discard block
 block discarded – undo
131 131
 	 * @package    lsx
132 132
 	 * @subpackage extras
133 133
 	 */
134
-	function lsx_remove_self_closing_tags( $input ) {
135
-		return str_replace( ' />', '>', $input );
134
+	function lsx_remove_self_closing_tags($input) {
135
+		return str_replace(' />', '>', $input);
136 136
 	}
137 137
 
138 138
 endif;
139 139
 
140
-add_filter( 'get_avatar',          'lsx_remove_self_closing_tags' ); // <img />
141
-add_filter( 'comment_id_fields',   'lsx_remove_self_closing_tags' ); // <input />
142
-add_filter( 'post_thumbnail_html', 'lsx_remove_self_closing_tags' ); // <img />
140
+add_filter('get_avatar', 'lsx_remove_self_closing_tags'); // <img />
141
+add_filter('comment_id_fields', 'lsx_remove_self_closing_tags'); // <input />
142
+add_filter('post_thumbnail_html', 'lsx_remove_self_closing_tags'); // <img />
143 143
 
144
-if ( ! function_exists( 'lsx_is_element_empty' ) ) :
144
+if ( ! function_exists('lsx_is_element_empty')) :
145 145
 
146 146
 	/**
147 147
 	 * Checks if a Nav $element is empty or not.
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
 	 * @package    lsx
150 150
 	 * @subpackage extras
151 151
 	 */
152
-	function lsx_is_element_empty( $element ) {
153
-		$element = trim( $element );
154
-		return empty( $element ) ? false : true;
152
+	function lsx_is_element_empty($element) {
153
+		$element = trim($element);
154
+		return empty($element) ? false : true;
155 155
 	}
156 156
 
157 157
 endif;
158 158
 
159
-if ( ! function_exists( 'lsx_get_thumbnail' ) ) :
159
+if ( ! function_exists('lsx_get_thumbnail')) :
160 160
 
161 161
 	/**
162 162
 	 * return the responsive images.
@@ -164,58 +164,58 @@  discard block
 block discarded – undo
164 164
 	 * @package    lsx
165 165
 	 * @subpackage extras
166 166
 	 */
167
-	function lsx_get_thumbnail( $size, $image_src = false ) {
168
-		if ( false === $image_src ) {
167
+	function lsx_get_thumbnail($size, $image_src = false) {
168
+		if (false === $image_src) {
169 169
 			$post_id           = get_the_ID();
170
-			$post_thumbnail_id = get_post_thumbnail_id( $post_id );
171
-		} elseif ( false !== $image_src ) {
172
-			if ( is_numeric( $image_src ) ) {
170
+			$post_thumbnail_id = get_post_thumbnail_id($post_id);
171
+		} elseif (false !== $image_src) {
172
+			if (is_numeric($image_src)) {
173 173
 				$post_thumbnail_id = $image_src;
174 174
 			} else {
175
-				$post_thumbnail_id = lsx_get_attachment_id_from_src( $image_src );
175
+				$post_thumbnail_id = lsx_get_attachment_id_from_src($image_src);
176 176
 			}
177 177
 		}
178 178
 
179
-		$size = apply_filters( 'lsx_thumbnail_size', $size );
179
+		$size = apply_filters('lsx_thumbnail_size', $size);
180 180
 		$img       = '';
181 181
 		$lazy_img  = '';
182 182
 		$image_url = '';
183 183
 
184
-		if ( 'lsx-thumbnail-single' === $size || 'lsx-thumbnail-wide' === $size || 'lsx-thumbnail-square' === $size || 'thumbnail' === $size ) {
184
+		if ('lsx-thumbnail-single' === $size || 'lsx-thumbnail-wide' === $size || 'lsx-thumbnail-square' === $size || 'thumbnail' === $size) {
185 185
 			$srcset = false;
186
-			$temp_img    = wp_get_attachment_image_src( $post_thumbnail_id, $size );
187
-			if ( ! empty( $temp_img ) ) {
188
-				$img    = $temp_img[0];
186
+			$temp_img = wp_get_attachment_image_src($post_thumbnail_id, $size);
187
+			if ( ! empty($temp_img)) {
188
+				$img = $temp_img[0];
189 189
 			}
190 190
 		} else {
191 191
 			$srcset = true;
192
-			$img = wp_get_attachment_image_srcset( $post_thumbnail_id, $size );
192
+			$img = wp_get_attachment_image_srcset($post_thumbnail_id, $size);
193 193
 
194
-			$temp_lazy = wp_get_attachment_image_src( $post_thumbnail_id, $size );
195
-			if ( ! empty( $temp_lazy ) ) {
194
+			$temp_lazy = wp_get_attachment_image_src($post_thumbnail_id, $size);
195
+			if ( ! empty($temp_lazy)) {
196 196
 				$lazy_img = $temp_lazy[0];
197 197
 			}
198 198
 
199
-			if ( empty( $img ) ) {
199
+			if (empty($img)) {
200 200
 				$srcset = false;
201
-				if ( ! empty( $lazy_img ) ) {
201
+				if ( ! empty($lazy_img)) {
202 202
 					$img = $lazy_img;
203 203
 				}
204 204
 			}
205 205
 		}
206 206
 
207
-		if ( '' !== $img ) {
207
+		if ('' !== $img) {
208 208
 			$image_url = $img;
209
-			$img = '<img alt="' . the_title_attribute( 'echo=0' ) . '" class="attachment-responsive wp-post-image lsx-responsive" ';
210
-			if ( $srcset ) {
211
-				$img .= 'srcset="' . esc_attr( $image_url ) . '" ';
209
+			$img = '<img alt="' . the_title_attribute('echo=0') . '" class="attachment-responsive wp-post-image lsx-responsive" ';
210
+			if ($srcset) {
211
+				$img .= 'srcset="' . esc_attr($image_url) . '" ';
212 212
 			} else {
213
-				$img .= 'src="' . esc_url( $image_url ) . '" ';
213
+				$img .= 'src="' . esc_url($image_url) . '" ';
214 214
 			}
215 215
 			$img .= '/>';
216 216
 
217
-			$img = apply_filters( 'lsx_lazyload_filter_images', $img );
218
-			$img = apply_filters( 'lsx_lazyload_slider_images', $img, $post_thumbnail_id, $size, $srcset, $image_url );
217
+			$img = apply_filters('lsx_lazyload_filter_images', $img);
218
+			$img = apply_filters('lsx_lazyload_slider_images', $img, $post_thumbnail_id, $size, $srcset, $image_url);
219 219
 		}
220 220
 
221 221
 		return $img;
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
 endif;
225 225
 
226
-if ( ! function_exists( 'lsx_thumbnail' ) ) :
226
+if ( ! function_exists('lsx_thumbnail')) :
227 227
 
228 228
 	/**
229 229
 	 * Output the Resonsive Images.
@@ -231,13 +231,13 @@  discard block
 block discarded – undo
231 231
 	 * @package    lsx
232 232
 	 * @subpackage extras
233 233
 	 */
234
-	function lsx_thumbnail( $size = 'thumbnail', $image_src = false ) {
235
-		echo wp_kses_post( lsx_get_thumbnail( $size, $image_src ) );
234
+	function lsx_thumbnail($size = 'thumbnail', $image_src = false) {
235
+		echo wp_kses_post(lsx_get_thumbnail($size, $image_src));
236 236
 	}
237 237
 
238 238
 endif;
239 239
 
240
-if ( ! function_exists( 'lsx_get_attachment_id_from_src' ) ) :
240
+if ( ! function_exists('lsx_get_attachment_id_from_src')) :
241 241
 
242 242
 	/**
243 243
 	 * Gets the attachments ID from the src.
@@ -245,13 +245,13 @@  discard block
 block discarded – undo
245 245
 	 * @package    lsx
246 246
 	 * @subpackage extras
247 247
 	 */
248
-	function lsx_get_attachment_id_from_src( $image_src ) {
249
-		$post_id = wp_cache_get( $image_src, 'lsx_get_attachment_id_from_src' );
248
+	function lsx_get_attachment_id_from_src($image_src) {
249
+		$post_id = wp_cache_get($image_src, 'lsx_get_attachment_id_from_src');
250 250
 
251
-		if ( false === $post_id ) {
251
+		if (false === $post_id) {
252 252
 			global $wpdb;
253
-			$post_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src ) );
254
-			wp_cache_set( $image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600 );
253
+			$post_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src));
254
+			wp_cache_set($image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600);
255 255
 		}
256 256
 
257 257
 		return $post_id;
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 
260 260
 endif;
261 261
 
262
-if ( ! function_exists( 'lsx_page_banner' ) ) :
262
+if ( ! function_exists('lsx_page_banner')) :
263 263
 
264 264
 	/**
265 265
 	 * Add Featured Image as Banner on Single Pages.
@@ -268,30 +268,30 @@  discard block
 block discarded – undo
268 268
 	 * @subpackage extras
269 269
 	 */
270 270
 	function lsx_page_banner() {
271
-		if ( true === apply_filters( 'lsx_page_banner_disable', false ) ) {
271
+		if (true === apply_filters('lsx_page_banner_disable', false)) {
272 272
 			return;
273 273
 		}
274 274
 
275
-		$post_types = array( 'page', 'post' );
276
-		$post_types = apply_filters( 'lsx_allowed_post_type_banners', $post_types );
275
+		$post_types = array('page', 'post');
276
+		$post_types = apply_filters('lsx_allowed_post_type_banners', $post_types);
277 277
 
278
-		if ( is_singular( $post_types ) && has_post_thumbnail() ) :
278
+		if (is_singular($post_types) && has_post_thumbnail()) :
279 279
 			$bg_image = '';
280 280
 
281
-			if ( has_post_thumbnail() ) {
282
-				$temp_bg_image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' );
283
-				if ( ! empty( $temp_bg_image ) ) {
281
+			if (has_post_thumbnail()) {
282
+				$temp_bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
283
+				if ( ! empty($temp_bg_image)) {
284 284
 					$bg_image = $temp_bg_image[0];
285 285
 				}
286 286
 			}
287 287
 
288
-			if ( '' !== $bg_image ) :
288
+			if ('' !== $bg_image) :
289 289
 				?>
290 290
 					<div class="page-banner-wrap">
291 291
 						<div class="page-banner">
292 292
 							<?php lsx_banner_inner_top(); ?>
293 293
 
294
-							<div class="page-banner-image" style="background-image:url(<?php echo esc_attr( $bg_image ); ?>);"></div>
294
+							<div class="page-banner-image" style="background-image:url(<?php echo esc_attr($bg_image); ?>);"></div>
295 295
 
296 296
 							<div class="container">
297 297
 								<header class="page-header">
@@ -310,11 +310,11 @@  discard block
 block discarded – undo
310 310
 
311 311
 endif;
312 312
 
313
-add_filter( 'lsx_banner_disable', 'lsx_disable_banner_for_blocks' );
314
-add_filter( 'lsx_global_header_disable', 'lsx_disable_banner_for_blocks' );
313
+add_filter('lsx_banner_disable', 'lsx_disable_banner_for_blocks');
314
+add_filter('lsx_global_header_disable', 'lsx_disable_banner_for_blocks');
315 315
 
316 316
 
317
-if ( ! function_exists( 'lsx_disable_banner_for_blocks' ) ) :
317
+if ( ! function_exists('lsx_disable_banner_for_blocks')) :
318 318
 
319 319
 	/**
320 320
 	 * Disable the Banner if the page is using Blocks
@@ -325,15 +325,15 @@  discard block
 block discarded – undo
325 325
 	 * @param  $disable boolean
326 326
 	 * @return boolean
327 327
 	 */
328
-	function lsx_disable_banner_for_blocks( $disable ) {
328
+	function lsx_disable_banner_for_blocks($disable) {
329 329
 		$queried_object = get_queried_object_id();
330
-		$show_on_front  = get_option( 'show_on_front' );
330
+		$show_on_front  = get_option('show_on_front');
331 331
 
332
-		if ( 'page' === $show_on_front && (int) get_option( 'page_for_posts' ) === $queried_object ) {
332
+		if ('page' === $show_on_front && (int) get_option('page_for_posts') === $queried_object) {
333 333
 			return $disable;
334 334
 		}
335 335
 
336
-		if ( function_exists( 'has_blocks' ) && has_blocks() && ( ! is_archive() ) ) {
336
+		if (function_exists('has_blocks') && has_blocks() && ( ! is_archive())) {
337 337
 			$disable = true;
338 338
 		}
339 339
 		return $disable;
@@ -341,9 +341,9 @@  discard block
 block discarded – undo
341 341
 
342 342
 endif;
343 343
 
344
-add_action( 'lsx_header_after', 'lsx_page_banner' );
344
+add_action('lsx_header_after', 'lsx_page_banner');
345 345
 
346
-if ( ! function_exists( 'lsx_form_submit_button' ) ) :
346
+if ( ! function_exists('lsx_form_submit_button')) :
347 347
 
348 348
 	/**
349 349
 	 * filter the Gravity Forms button type.
@@ -355,15 +355,15 @@  discard block
 block discarded – undo
355 355
 	 * @param  $form   Object
356 356
 	 * @return String
357 357
 	 */
358
-	function lsx_form_submit_button( $button, $form ) {
358
+	function lsx_form_submit_button($button, $form) {
359 359
 		return "<button class='btn btn-primary' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>";
360 360
 	}
361 361
 
362 362
 endif;
363 363
 
364
-add_filter( 'gform_submit_button', 'lsx_form_submit_button', 10, 2 );
364
+add_filter('gform_submit_button', 'lsx_form_submit_button', 10, 2);
365 365
 
366
-if ( ! function_exists( 'lsx_excerpt_more' ) ) :
366
+if ( ! function_exists('lsx_excerpt_more')) :
367 367
 
368 368
 	/**
369 369
 	 * Replaces the excerpt "more" text by a link.
@@ -371,15 +371,15 @@  discard block
 block discarded – undo
371 371
 	 * @package    lsx
372 372
 	 * @subpackage extras
373 373
 	 */
374
-	function lsx_excerpt_more( $more ) {
374
+	function lsx_excerpt_more($more) {
375 375
 		return '...';
376 376
 	}
377 377
 
378 378
 endif;
379 379
 
380
-add_filter( 'excerpt_more', 'lsx_excerpt_more' );
380
+add_filter('excerpt_more', 'lsx_excerpt_more');
381 381
 
382
-if ( ! function_exists( 'lsx_the_excerpt_filter' ) ) :
382
+if ( ! function_exists('lsx_the_excerpt_filter')) :
383 383
 
384 384
 	/**
385 385
 	 * Add a continue reading link to the excerpt.
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 	 * @package    lsx
388 388
 	 * @subpackage extras
389 389
 	 */
390
-	function lsx_the_excerpt_filter( $excerpt ) {
390
+	function lsx_the_excerpt_filter($excerpt) {
391 391
 
392 392
 		$post_formats = array(
393 393
 			'aside'   => 'aside',
@@ -400,23 +400,23 @@  discard block
 block discarded – undo
400 400
 			'audio'   => 'audio',
401 401
 		);
402 402
 
403
-		$show_full_content = has_post_format( apply_filters( 'lsx_the_excerpt_filter_post_types', $post_formats ) );
403
+		$show_full_content = has_post_format(apply_filters('lsx_the_excerpt_filter_post_types', $post_formats));
404 404
 
405
-		if ( ! $show_full_content ) {
406
-			if ( '' !== $excerpt && ! stristr( $excerpt, 'moretag' ) ) {
407
-				$pagination = wp_link_pages( array(
405
+		if ( ! $show_full_content) {
406
+			if ('' !== $excerpt && ! stristr($excerpt, 'moretag')) {
407
+				$pagination = wp_link_pages(array(
408 408
 					'before'      => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
409 409
 					'after'       => '</div></div>',
410 410
 					'link_before' => '<span>',
411 411
 					'link_after'  => '</span>',
412 412
 					'echo'        => 0,
413
-				) );
413
+				));
414 414
 
415
-				if ( ! empty( $pagination ) ) {
415
+				if ( ! empty($pagination)) {
416 416
 					$excerpt .= $pagination;
417 417
 				} else {
418
-					$excerpt_more = '<p><a class="moretag" href="' . esc_url( get_permalink() ) . '">' . esc_html__( 'Read More', 'lsx' ) . '</a></p>';
419
-					$excerpt .= apply_filters( 'excerpt_more_p', $excerpt_more );
418
+					$excerpt_more = '<p><a class="moretag" href="' . esc_url(get_permalink()) . '">' . esc_html__('Read More', 'lsx') . '</a></p>';
419
+					$excerpt .= apply_filters('excerpt_more_p', $excerpt_more);
420 420
 				}
421 421
 			}
422 422
 		}
@@ -426,9 +426,9 @@  discard block
 block discarded – undo
426 426
 
427 427
 endif;
428 428
 
429
-add_filter( 'the_excerpt', 'lsx_the_excerpt_filter' , 1 , 20 );
429
+add_filter('the_excerpt', 'lsx_the_excerpt_filter', 1, 20);
430 430
 
431
-if ( ! function_exists( 'lsx_full_width_widget_classes' ) ) :
431
+if ( ! function_exists('lsx_full_width_widget_classes')) :
432 432
 
433 433
 	/**
434 434
 	 * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget.
@@ -436,8 +436,8 @@  discard block
 block discarded – undo
436 436
 	 * @package    lsx
437 437
 	 * @subpackage extras
438 438
 	 */
439
-	function lsx_full_width_widget_classes( $params ) {
440
-		if ( is_admin() ) {
439
+	function lsx_full_width_widget_classes($params) {
440
+		if (is_admin()) {
441 441
 			return $params;
442 442
 		}
443 443
 
@@ -446,9 +446,9 @@  discard block
 block discarded – undo
446 446
 		$widget_id   = $params[0]['widget_id'];
447 447
 		$widget_name = $params[0]['widget_name'];
448 448
 
449
-		if ( 'Text' === $widget_name ) {
450
-			$wp_registered_widgets[ $widget_id ]['original_callback'] = $wp_registered_widgets[ $widget_id ]['callback'];
451
-			$wp_registered_widgets[ $widget_id ]['callback'] = 'lsx_full_width_widget_custom_callback';
449
+		if ('Text' === $widget_name) {
450
+			$wp_registered_widgets[$widget_id]['original_callback'] = $wp_registered_widgets[$widget_id]['callback'];
451
+			$wp_registered_widgets[$widget_id]['callback'] = 'lsx_full_width_widget_custom_callback';
452 452
 		}
453 453
 
454 454
 		return $params;
@@ -456,9 +456,9 @@  discard block
 block discarded – undo
456 456
 
457 457
 endif;
458 458
 
459
-add_filter( 'dynamic_sidebar_params', 'lsx_full_width_widget_classes' );
459
+add_filter('dynamic_sidebar_params', 'lsx_full_width_widget_classes');
460 460
 
461
-if ( ! function_exists( 'lsx_full_width_widget_custom_callback' ) ) :
461
+if ( ! function_exists('lsx_full_width_widget_custom_callback')) :
462 462
 
463 463
 	/**
464 464
 	 * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget.
@@ -472,25 +472,25 @@  discard block
 block discarded – undo
472 472
 		$original_callback_params = func_get_args();
473 473
 		$widget_id = $original_callback_params[0]['widget_id'];
474 474
 
475
-		$original_callback = $wp_registered_widgets[ $widget_id ]['original_callback'];
476
-		$wp_registered_widgets[ $widget_id ]['callback'] = $original_callback;
475
+		$original_callback = $wp_registered_widgets[$widget_id]['original_callback'];
476
+		$wp_registered_widgets[$widget_id]['callback'] = $original_callback;
477 477
 
478
-		$widget_id_base = $wp_registered_widgets[ $widget_id ]['callback'][0]->id_base;
478
+		$widget_id_base = $wp_registered_widgets[$widget_id]['callback'][0]->id_base;
479 479
 
480 480
 		$widget_classname = '';
481 481
 
482
-		if ( is_callable( $original_callback ) ) {
482
+		if (is_callable($original_callback)) {
483 483
 			ob_start();
484
-			call_user_func_array( $original_callback, $original_callback_params );
484
+			call_user_func_array($original_callback, $original_callback_params);
485 485
 			$widget_output = ob_get_clean();
486 486
 
487
-			echo wp_kses_post( apply_filters( 'lsx_widget_output', $widget_output, $widget_id_base, $widget_classname, $widget_id ) );
487
+			echo wp_kses_post(apply_filters('lsx_widget_output', $widget_output, $widget_id_base, $widget_classname, $widget_id));
488 488
 		}
489 489
 	}
490 490
 
491 491
 endif;
492 492
 
493
-if ( ! function_exists( 'lsx_full_width_widget_output' ) ) :
493
+if ( ! function_exists('lsx_full_width_widget_output')) :
494 494
 
495 495
 	/**
496 496
 	 * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget.
@@ -498,12 +498,12 @@  discard block
 block discarded – undo
498 498
 	 * @package    lsx
499 499
 	 * @subpackage extras
500 500
 	 */
501
-	function lsx_full_width_widget_output( $widget_output, $widget_id_base, $widget_id ) {
502
-		if ( 'text' === $widget_id_base ) {
503
-			if ( false !== strpos( $widget_output, '<div class="lsx-full-width-alt">' ) ) {
504
-				$widget_output = str_replace( 'class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width_alt"', $widget_output );
505
-			} elseif ( false !== strpos( $widget_output, '<div class="lsx-full-width">' ) ) {
506
-				$widget_output = str_replace( 'class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width"', $widget_output );
501
+	function lsx_full_width_widget_output($widget_output, $widget_id_base, $widget_id) {
502
+		if ('text' === $widget_id_base) {
503
+			if (false !== strpos($widget_output, '<div class="lsx-full-width-alt">')) {
504
+				$widget_output = str_replace('class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width_alt"', $widget_output);
505
+			} elseif (false !== strpos($widget_output, '<div class="lsx-full-width">')) {
506
+				$widget_output = str_replace('class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width"', $widget_output);
507 507
 			}
508 508
 		}
509 509
 
@@ -512,13 +512,13 @@  discard block
 block discarded – undo
512 512
 
513 513
 endif;
514 514
 
515
-add_filter( 'lsx_widget_output', 'lsx_full_width_widget_output', 10, 3 );
515
+add_filter('lsx_widget_output', 'lsx_full_width_widget_output', 10, 3);
516 516
 
517 517
 /**
518 518
  * Check if the content has a restricted post format that needs to show a full excerpt.
519 519
  */
520 520
 function lsx_post_format_force_content_on_list() {
521
-	$post_formats = apply_filters( 'lsx_post_format_force_content_on_list',
521
+	$post_formats = apply_filters('lsx_post_format_force_content_on_list',
522 522
 		array(
523 523
 				'video' => 'video',
524 524
 				'audio' => 'audio',
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 			)
528 528
 	);
529 529
 	$return = false;
530
-	if ( ! has_post_format( $post_formats ) ) {
530
+	if ( ! has_post_format($post_formats)) {
531 531
 		$return = true;
532 532
 	}
533 533
 	return $return;
@@ -536,67 +536,67 @@  discard block
 block discarded – undo
536 536
 /**
537 537
  * Remove the Hentry Class Every
538 538
  */
539
-function lsx_remove_hentry( $classes ) {
540
-	if ( 'post' !== get_post_type() ) {
541
-		$classes = array_diff( $classes, array( 'hentry' ) );
539
+function lsx_remove_hentry($classes) {
540
+	if ('post' !== get_post_type()) {
541
+		$classes = array_diff($classes, array('hentry'));
542 542
 	}
543 543
 	return $classes;
544 544
 }
545
-add_filter( 'post_class','lsx_remove_hentry' );
545
+add_filter('post_class', 'lsx_remove_hentry');
546 546
 
547 547
 /**
548 548
  * Strip Excerpts.
549 549
  *
550 550
  */
551
-function lsx_strip_excerpt( $content ) {
552
-	if ( is_search() || is_archive() || ( is_blog_installed() && ! is_single() && ! is_page() ) ) {
553
-		$content = strip_shortcodes( $content );
554
-		$content = str_replace( ']]>', ']]&gt;', $content );
555
-		$content = strip_tags( $content );
551
+function lsx_strip_excerpt($content) {
552
+	if (is_search() || is_archive() || (is_blog_installed() && ! is_single() && ! is_page())) {
553
+		$content = strip_shortcodes($content);
554
+		$content = str_replace(']]>', ']]&gt;', $content);
555
+		$content = strip_tags($content);
556 556
 	}
557 557
 	return $content;
558 558
 }
559
-add_filter( 'the_content', 'lsx_strip_excerpt' );
559
+add_filter('the_content', 'lsx_strip_excerpt');
560 560
 
561 561
 /**
562 562
  * Disable Gutenberg for LSX Custom Post Tpes.
563 563
  *
564 564
  */
565
-function lsx_disable_gutenberg_product_type( $is_enabled, $post_type ) {
566
-	if ( 'testimonial' === $post_type || 'team' === $post_type || 'project' === $post_type ) {
565
+function lsx_disable_gutenberg_product_type($is_enabled, $post_type) {
566
+	if ('testimonial' === $post_type || 'team' === $post_type || 'project' === $post_type) {
567 567
 		return false;
568 568
 	}
569 569
 
570 570
 	return $is_enabled;
571 571
 }
572
-add_filter( 'gutenberg_add_edit_link_for_post_type', 'lsx_disable_gutenberg_product_type', 10, 2 );
572
+add_filter('gutenberg_add_edit_link_for_post_type', 'lsx_disable_gutenberg_product_type', 10, 2);
573 573
 
574 574
 /**
575 575
  * Add the "Blog" link to the breadcrumbs
576 576
  * @param $crumbs
577 577
  * @return array
578 578
  */
579
-function lsx_breadcrumbs_blog_link( $crumbs ) {
579
+function lsx_breadcrumbs_blog_link($crumbs) {
580 580
 
581
-	$show_on_front = get_option( 'show_on_front' );
581
+	$show_on_front = get_option('show_on_front');
582 582
 
583
-	if ( 'page' === $show_on_front && ( is_category() || is_tag() ) ) {
583
+	if ('page' === $show_on_front && (is_category() || is_tag())) {
584 584
 
585
-		$blog_page = get_option( 'page_for_posts' );
586
-		if ( false !== $blog_page && '' !== $blog_page ) {
585
+		$blog_page = get_option('page_for_posts');
586
+		if (false !== $blog_page && '' !== $blog_page) {
587 587
 
588 588
 			$new_crumbs = array();
589 589
 			$new_crumbs[0] = $crumbs[0];
590 590
 
591
-			if ( function_exists( 'woocommerce_breadcrumb' ) ) {
591
+			if (function_exists('woocommerce_breadcrumb')) {
592 592
 				$new_crumbs[1] = array(
593
-					0	=> get_the_title( $blog_page ),
594
-					1	=> get_permalink( $blog_page ),
593
+					0	=> get_the_title($blog_page),
594
+					1	=> get_permalink($blog_page),
595 595
 				);
596 596
 			} else {
597 597
 				$new_crumbs[1] = array(
598
-					'text'	=> get_the_title( $blog_page ),
599
-					'url'	=> get_permalink( $blog_page ),
598
+					'text'	=> get_the_title($blog_page),
599
+					'url'	=> get_permalink($blog_page),
600 600
 				);
601 601
 			}
602 602
 			$new_crumbs[2] = $crumbs[1];
@@ -606,5 +606,5 @@  discard block
 block discarded – undo
606 606
 	}
607 607
 	return $crumbs;
608 608
 }
609
-add_filter( 'wpseo_breadcrumb_links', 'lsx_breadcrumbs_blog_link', 30, 1 );
610
-add_filter( 'woocommerce_get_breadcrumb', 'lsx_breadcrumbs_blog_link', 30, 1 );
609
+add_filter('wpseo_breadcrumb_links', 'lsx_breadcrumbs_blog_link', 30, 1);
610
+add_filter('woocommerce_get_breadcrumb', 'lsx_breadcrumbs_blog_link', 30, 1);
Please login to merge, or discard this patch.