Passed
Push — master ( 9fe369...1f44c4 )
by
unknown
54s queued 13s
created
includes/sensei/class-lsx-sensei-course.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @subpackage sensei
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit; // Exit if accessed directly.
11 11
 }
12 12
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * Constructor.
27 27
 	 */
28 28
 	public function __construct() {
29
-		add_action( 'init', array( $this, 'init' ) );
29
+		add_action('init', array($this, 'init'));
30 30
 	} // End __construct()
31 31
 
32 32
 	/**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @return self
36 36
 	 */
37 37
 	public static function instance() {
38
-		if ( ! self::$instance ) {
38
+		if ( ! self::$instance) {
39 39
 			self::$instance = new self();
40 40
 		}
41 41
 		return self::$instance;
@@ -49,32 +49,32 @@  discard block
 block discarded – undo
49 49
 		global $woothemes_sensei;
50 50
 
51 51
 		// Switching the course filters and the headers around.
52
-		remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 10, 0 );
53
-		remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_sorting' ) );
54
-		remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_filters' ) );
55
-		add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 11, 0 );
56
-		add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_sorting' ), 12 );
57
-		add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_filters' ), 12 );
52
+		remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 10, 0);
53
+		remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting'));
54
+		remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters'));
55
+		add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 11, 0);
56
+		add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting'), 12);
57
+		add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters'), 12);
58 58
 
59 59
 		// First add the thumbnail.
60
-		add_action( 'sensei_course_content_inside_before', array( $this, 'get_course_thumbnail' ), 1 );
60
+		add_action('sensei_course_content_inside_before', array($this, 'get_course_thumbnail'), 1);
61 61
 
62 62
 		// This is for our wrapper, we run it on 2, after the thumbnail we added.
63
-		add_action( 'sensei_course_content_inside_before', array( $this, 'course_body_div_open' ), 1 );
64
-		add_action( 'sensei_course_content_inside_after', array( $this, 'course_body_div_close' ), 50 );
63
+		add_action('sensei_course_content_inside_before', array($this, 'course_body_div_open'), 1);
64
+		add_action('sensei_course_content_inside_after', array($this, 'course_body_div_close'), 50);
65 65
 
66 66
 		// This is for our wrapper, we run it on 2, after the thumbnail we added.
67
-		add_action( 'sensei_course_content_inside_before', array( $this, 'course_body_div_results_open' ), 20 );
68
-		add_action( 'sensei_course_content_inside_after', array( $this, 'course_body_div_results_close' ), 49 );
67
+		add_action('sensei_course_content_inside_before', array($this, 'course_body_div_results_open'), 20);
68
+		add_action('sensei_course_content_inside_after', array($this, 'course_body_div_results_close'), 49);
69 69
 
70
-		add_action( 'sensei_single_course_content_inside_before', array( $this, 'display_course_amount' ), 20 );
70
+		add_action('sensei_single_course_content_inside_before', array($this, 'display_course_amount'), 20);
71 71
 
72 72
 		// removes the course image above the content.
73
-		remove_action( 'sensei_course_content_inside_before', array( $woothemes_sensei->course, 'course_image' ), 30, 1 );
73
+		remove_action('sensei_course_content_inside_before', array($woothemes_sensei->course, 'course_image'), 30, 1);
74 74
 		// add the course image to the left of the content.
75
-		add_action( 'lsx_sensei_course_content_inside_before', array( $woothemes_sensei->course, 'course_image' ), 30, 1 );
75
+		add_action('lsx_sensei_course_content_inside_before', array($woothemes_sensei->course, 'course_image'), 30, 1);
76 76
 
77
-		add_filter( 'attach_shortcode_hooks', 'lsx_attach_shortcode_hooks', 10, 1 );
77
+		add_filter('attach_shortcode_hooks', 'lsx_attach_shortcode_hooks', 10, 1);
78 78
 
79 79
 	}
80 80
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	public function get_course_thumbnail() {
87 87
 		?>
88 88
 		<div class="course-thumbnail">
89
-			<?php do_action( 'lsx_sensei_course_content_inside_before', get_the_ID() ); ?>
89
+			<?php do_action('lsx_sensei_course_content_inside_before', get_the_ID()); ?>
90 90
 		</div>
91 91
 		<?php
92 92
 	}
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	public function course_body_div_open() {
100 100
 		global $post, $current_user;
101
-		$is_user_taking_course    = Sensei_Utils::has_started_course( $post->ID, $current_user->ID );
101
+		$is_user_taking_course    = Sensei_Utils::has_started_course($post->ID, $current_user->ID);
102 102
 		$user_taking_course_class = '';
103
-		if ( ! empty( $is_user_taking_course ) ) {
103
+		if ( ! empty($is_user_taking_course)) {
104 104
 			$user_taking_course_class = 'currently-in-course';
105 105
 		}
106 106
 		?>
107
-		<div class="course-body <?php echo esc_html( $user_taking_course_class ); ?>">
107
+		<div class="course-body <?php echo esc_html($user_taking_course_class); ?>">
108 108
 		<?php
109 109
 	}
110 110
 
@@ -148,18 +148,18 @@  discard block
 block discarded – undo
148 148
 	 */
149 149
 	public function display_course_amount() {
150 150
 		global $post, $current_user;
151
-		$is_user_taking_course   = Sensei_Course::is_user_enrolled( $post->ID, $current_user->ID );
152
-		$is_user_starting_course = Sensei_Utils::has_started_course( $post->ID, $current_user->ID );
153
-		$wc_post_id              = absint( get_post_meta( $post->ID, '_course_woocommerce_product', true ) );
151
+		$is_user_taking_course   = Sensei_Course::is_user_enrolled($post->ID, $current_user->ID);
152
+		$is_user_starting_course = Sensei_Utils::has_started_course($post->ID, $current_user->ID);
153
+		$wc_post_id              = absint(get_post_meta($post->ID, '_course_woocommerce_product', true));
154 154
 		$course_purchasable      = '';
155
-		if ( class_exists( 'Sensei_WC' ) ) {
156
-			$course_purchasable = Sensei_WC::is_course_purchasable( $post->ID );
155
+		if (class_exists('Sensei_WC')) {
156
+			$course_purchasable = Sensei_WC::is_course_purchasable($post->ID);
157 157
 			$currency           = get_woocommerce_currency_symbol();
158
-			$product            = new WC_Product( $wc_post_id );
159
-			if ( ( ! empty( $product->get_price() ) ) && ( ( ! $is_user_taking_course ) || ( ! $is_user_starting_course ) ) ) {
160
-				echo '<span class="course-product-price price"><span>' . esc_html( $currency ) . ' </span>' . sprintf( '%0.2f', esc_html( $product->get_price() ) ) . '</span>';
161
-			} elseif ( ( '' === $product->get_price() || 0 == $product->get_price() ) && $course_purchasable && ( ( ! $is_user_taking_course ) || ( ! $is_user_starting_course ) ) ) {
162
-				echo '<span class="course-product-price price">' . wp_kses_post( 'Free!', 'lsx' ) . '</span>';
158
+			$product            = new WC_Product($wc_post_id);
159
+			if (( ! empty($product->get_price())) && (( ! $is_user_taking_course) || ( ! $is_user_starting_course))) {
160
+				echo '<span class="course-product-price price"><span>' . esc_html($currency) . ' </span>' . sprintf('%0.2f', esc_html($product->get_price())) . '</span>';
161
+			} elseif (('' === $product->get_price() || 0 == $product->get_price()) && $course_purchasable && (( ! $is_user_taking_course) || ( ! $is_user_starting_course))) {
162
+				echo '<span class="course-product-price price">' . wp_kses_post('Free!', 'lsx') . '</span>';
163 163
 			}
164 164
 		}
165 165
 	}
Please login to merge, or discard this patch.
includes/layout.php 1 patch
Spacing   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -6,25 +6,25 @@  discard block
 block discarded – undo
6 6
  * @subpackage layout
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_layout_selector' ) ) :
13
+if ( ! function_exists('lsx_layout_selector')) :
14 14
 	/**
15 15
 	 * Layout selector.
16 16
 	 *
17 17
 	 * @package    lsx
18 18
 	 * @subpackage layout
19 19
 	 */
20
-	function lsx_layout_selector( $class, $area = 'site' ) {
20
+	function lsx_layout_selector($class, $area = 'site') {
21 21
 		$return_class = '';
22
-		$layout       = get_theme_mod( 'lsx_layout', '1c' );
23
-		$layout       = apply_filters( 'lsx_layout', $layout );
22
+		$layout       = get_theme_mod('lsx_layout', '1c');
23
+		$layout       = apply_filters('lsx_layout', $layout);
24 24
 		$default_size = 'sm';
25
-		$size         = apply_filters( 'lsx_bootstrap_column_size', $default_size );
25
+		$size         = apply_filters('lsx_bootstrap_column_size', $default_size);
26 26
 
27
-		switch ( $layout ) {
27
+		switch ($layout) {
28 28
 			case '1c':
29 29
 				$main_class    = 'col-' . $size . '-12';
30 30
 				$sidebar_class = 'col-' . $size . '-12';
@@ -43,19 +43,19 @@  discard block
 block discarded – undo
43 43
 				break;
44 44
 		}
45 45
 
46
-		if ( 'main' === $class ) {
47
-			$return_class = apply_filters( 'lsx_layout_selector', $main_class, $class, $layout, $size );
46
+		if ('main' === $class) {
47
+			$return_class = apply_filters('lsx_layout_selector', $main_class, $class, $layout, $size);
48 48
 		}
49 49
 
50
-		if ( 'sidebar' === $class ) {
51
-			$return_class = apply_filters( 'lsx_layout_selector', $sidebar_class, $class, $layout, $size );
50
+		if ('sidebar' === $class) {
51
+			$return_class = apply_filters('lsx_layout_selector', $sidebar_class, $class, $layout, $size);
52 52
 		}
53 53
 
54 54
 		return $return_class;
55 55
 	}
56 56
 endif;
57 57
 
58
-if ( ! function_exists( 'lsx_main_class' ) ) :
58
+if ( ! function_exists('lsx_main_class')) :
59 59
 	/**
60 60
 	 * .main classes.
61 61
 	 *
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
 	 * @subpackage layout
64 64
 	 */
65 65
 	function lsx_main_class() {
66
-		return lsx_layout_selector( 'main' );
66
+		return lsx_layout_selector('main');
67 67
 	}
68 68
 endif;
69 69
 
70
-if ( ! function_exists( 'lsx_sidebar_class' ) ) :
70
+if ( ! function_exists('lsx_sidebar_class')) :
71 71
 	/**
72 72
 	 * .sidebar classes.
73 73
 	 *
@@ -75,47 +75,47 @@  discard block
 block discarded – undo
75 75
 	 * @subpackage layout
76 76
 	 */
77 77
 	function lsx_sidebar_class() {
78
-		return lsx_layout_selector( 'sidebar' );
78
+		return lsx_layout_selector('sidebar');
79 79
 	}
80 80
 endif;
81 81
 
82
-if ( ! function_exists( 'lsx_header_classes' ) ) :
82
+if ( ! function_exists('lsx_header_classes')) :
83 83
 	/**
84 84
 	 * Output the classes for the header.
85 85
 	 *
86 86
 	 * @package    lsx
87 87
 	 * @subpackage layout
88 88
 	 */
89
-	function lsx_header_classes( $additional = false ) {
89
+	function lsx_header_classes($additional = false) {
90 90
 		$classes = 'banner navbar navbar-default';
91 91
 
92
-		if ( false !== $additional ) {
92
+		if (false !== $additional) {
93 93
 			$classes .= ' ' . $additional;
94 94
 		}
95 95
 
96
-		echo esc_attr( $classes );
96
+		echo esc_attr($classes);
97 97
 	}
98 98
 endif;
99 99
 
100
-if ( ! function_exists( 'lsx_top_menu_classes' ) ) :
100
+if ( ! function_exists('lsx_top_menu_classes')) :
101 101
 	/**
102 102
 	 * Output the classes for the top-menu.
103 103
 	 *
104 104
 	 * @package    lsx
105 105
 	 * @subpackage layout
106 106
 	 */
107
-	function lsx_top_menu_classes( $additional = false ) {
107
+	function lsx_top_menu_classes($additional = false) {
108 108
 		$classes = 'top-menu-default';
109 109
 
110
-		if ( false !== $additional ) {
110
+		if (false !== $additional) {
111 111
 			$classes .= ' ' . $additional;
112 112
 		}
113 113
 
114
-		echo esc_attr( $classes );
114
+		echo esc_attr($classes);
115 115
 	}
116 116
 endif;
117 117
 
118
-if ( ! function_exists( 'lsx_post_wrapper_class' ) ) :
118
+if ( ! function_exists('lsx_post_wrapper_class')) :
119 119
 	/**
120 120
 	 * Output the classes for the top-menu.
121 121
 	 *
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
 	 * @subpackage layout
124 124
 	 */
125 125
 	function lsx_post_wrapper_class() {
126
-		return apply_filters( 'lsx_post_wrapper_class', '' );
126
+		return apply_filters('lsx_post_wrapper_class', '');
127 127
 	}
128 128
 endif;
129 129
 
130 130
 
131 131
 
132
-if ( ! function_exists( 'lsx_add_footer_sidebar_area' ) ) :
132
+if ( ! function_exists('lsx_add_footer_sidebar_area')) :
133 133
 	/**
134 134
 	 * Output the Footer CTA and/pr Footer Widgets.
135 135
 	 *
@@ -137,33 +137,33 @@  discard block
 block discarded – undo
137 137
 	 * @subpackage layout
138 138
 	 */
139 139
 	function lsx_add_footer_sidebar_area() {
140
-		if ( is_active_sidebar( 'sidebar-footer-cta' ) ) : ?>
140
+		if (is_active_sidebar('sidebar-footer-cta')) : ?>
141 141
 			<div id="footer-cta">
142 142
 				<div class="container">
143 143
 					<div class="lsx-full-width">
144 144
 						<div class="lsx-hero-unit">
145
-							<?php dynamic_sidebar( 'sidebar-footer-cta' ); ?>
145
+							<?php dynamic_sidebar('sidebar-footer-cta'); ?>
146 146
 						</div>
147 147
 					</div>
148 148
 				</div>
149 149
 			</div>
150 150
 		<?php endif; ?>
151 151
 
152
-		<?php if ( is_active_sidebar( 'sidebar-footer' ) ) : ?>
152
+		<?php if (is_active_sidebar('sidebar-footer')) : ?>
153 153
 			<div id="footer-widgets">
154 154
 				<div class="container">
155 155
 					<div class="row">
156
-						<?php dynamic_sidebar( 'sidebar-footer' ); ?>
156
+						<?php dynamic_sidebar('sidebar-footer'); ?>
157 157
 					</div>
158 158
 				</div>
159 159
 			</div>
160 160
 			<?php
161 161
 		endif;
162 162
 	}
163
-	add_action( 'lsx_footer_before', 'lsx_add_footer_sidebar_area' );
163
+	add_action('lsx_footer_before', 'lsx_add_footer_sidebar_area');
164 164
 endif;
165 165
 
166
-if ( ! function_exists( 'lsx_global_header' ) ) :
166
+if ( ! function_exists('lsx_global_header')) :
167 167
 	/**
168 168
 	 * Displays the global header.
169 169
 	 *
@@ -171,27 +171,27 @@  discard block
 block discarded – undo
171 171
 	 * @subpackage layout
172 172
 	 */
173 173
 	function lsx_global_header() {
174
-		$show_on_front  = get_option( 'show_on_front' );
174
+		$show_on_front  = get_option('show_on_front');
175 175
 		$queried_object = get_queried_object();
176 176
 		$default_size   = 'sm';
177
-		$size           = apply_filters( 'lsx_bootstrap_column_size', $default_size );
177
+		$size           = apply_filters('lsx_bootstrap_column_size', $default_size);
178 178
 
179 179
 		// Cart and Checkout won't have banners of any kind.
180
-		if ( function_exists( 'is_woocommerce' ) && ( is_checkout() || is_cart() ) ) {
180
+		if (function_exists('is_woocommerce') && (is_checkout() || is_cart())) {
181 181
 			return;
182 182
 		}
183 183
 
184 184
 		// Product pages have their own banner function 'lsx_page_banner()'.
185
-		if ( function_exists( 'is_woocommerce' ) && ( is_product() ) ) {
185
+		if (function_exists('is_woocommerce') && (is_product())) {
186 186
 			return;
187 187
 		}
188 188
 
189
-		if ( is_page() && ( 'page' !== $show_on_front || ! is_front_page() ) ) :
190
-			if ( class_exists( 'LSX_Banners' ) && empty( apply_filters( 'lsx_banner_plugin_disable', false ) && ( ! has_post_thumbnail() ) ) ) {
189
+		if (is_page() && ('page' !== $show_on_front || ! is_front_page())) :
190
+			if (class_exists('LSX_Banners') && empty(apply_filters('lsx_banner_plugin_disable', false) && ( ! has_post_thumbnail()))) {
191 191
 				return;
192 192
 			}
193 193
 				?>
194
-			<div class="archive-header-wrapper banner-page col-<?php echo esc_attr( $size ); ?>-12">
194
+			<div class="archive-header-wrapper banner-page col-<?php echo esc_attr($size); ?>-12">
195 195
 				<?php lsx_global_header_inner_bottom(); ?>
196 196
 				<header class="archive-header">
197 197
 					<h1 class="archive-title"><?php the_title(); ?></h1>
@@ -200,26 +200,26 @@  discard block
 block discarded – undo
200 200
 			</div>
201 201
 			<?php
202 202
 
203
-		elseif ( is_single() && ! is_singular( 'post' ) ) :
203
+		elseif (is_single() && ! is_singular('post')) :
204 204
 			?>
205
-			<div class="archive-header-wrapper banner-single col-<?php echo esc_attr( $size ); ?>-12">
205
+			<div class="archive-header-wrapper banner-single col-<?php echo esc_attr($size); ?>-12">
206 206
 				<?php lsx_global_header_inner_bottom(); ?>
207 207
 				<header class="archive-header">
208
-					<h1 class="archive-title"><?php echo wp_kses_post( apply_filters( 'lsx_global_header_title', get_the_title() ) ); ?></h1>
208
+					<h1 class="archive-title"><?php echo wp_kses_post(apply_filters('lsx_global_header_title', get_the_title())); ?></h1>
209 209
 				</header>
210 210
 
211 211
 			</div>
212 212
 			<?php
213
-		elseif ( is_search() ) :
213
+		elseif (is_search()) :
214 214
 			?>
215
-			<div class="archive-header-wrapper banner-search col-<?php echo esc_attr( $size ); ?>-12">
215
+			<div class="archive-header-wrapper banner-search col-<?php echo esc_attr($size); ?>-12">
216 216
 				<?php lsx_global_header_inner_bottom(); ?>
217 217
 				<header class="archive-header">
218 218
 					<h1 class="archive-title">
219 219
 						<?php
220 220
 							printf(
221 221
 								/* Translators: %s: search term/query */
222
-								esc_html__( 'Search Results for: %s', 'lsx' ),
222
+								esc_html__('Search Results for: %s', 'lsx'),
223 223
 								'<span>' . get_search_query() . '</span>'
224 224
 							);
225 225
 						?>
@@ -228,12 +228,12 @@  discard block
 block discarded – undo
228 228
 
229 229
 			</div>
230 230
 			<?php
231
-		elseif ( is_author() ) :
231
+		elseif (is_author()) :
232 232
 			$author        = get_the_author();
233
-			$author_avatar = get_avatar( get_the_author_meta( 'ID' ), 256 );
233
+			$author_avatar = get_avatar(get_the_author_meta('ID'), 256);
234 234
 			$author_bio    = get_the_archive_description();
235 235
 			?>
236
-			<div class="archive-header-wrapper banner-archive-author col-<?php echo esc_attr( $size ); ?>-12">
236
+			<div class="archive-header-wrapper banner-archive-author col-<?php echo esc_attr($size); ?>-12">
237 237
 				<?php lsx_global_header_inner_bottom(); ?>
238 238
 				<header class="archive-header">
239 239
 					<h1 class="archive-title"><?php the_archive_title(); ?></h1>
@@ -241,57 +241,57 @@  discard block
 block discarded – undo
241 241
 
242 242
 			</div>
243 243
 			<?php
244
-		elseif ( is_archive() ) :
244
+		elseif (is_archive()) :
245 245
 			?>
246
-			<div class="archive-header-wrapper banner-archive col-<?php echo esc_attr( $size ); ?>-12">
246
+			<div class="archive-header-wrapper banner-archive col-<?php echo esc_attr($size); ?>-12">
247 247
 				<?php lsx_global_header_inner_bottom(); ?>
248 248
 				<header class="archive-header">
249 249
 					<h1 class="archive-title">
250
-						<?php if ( has_post_format() && ! is_category() && ! is_tag() && ! is_date() && ! is_tax( 'post_format' ) ) { ?>
251
-							<?php the_archive_title( esc_html__( 'Type:', 'lsx' ) ); ?>
250
+						<?php if (has_post_format() && ! is_category() && ! is_tag() && ! is_date() && ! is_tax('post_format')) { ?>
251
+							<?php the_archive_title(esc_html__('Type:', 'lsx')); ?>
252 252
 						<?php } else { ?>
253
-							<?php echo wp_kses_post( apply_filters( 'lsx_global_header_title', get_the_archive_title() ) ); ?>
253
+							<?php echo wp_kses_post(apply_filters('lsx_global_header_title', get_the_archive_title())); ?>
254 254
 						<?php } ?>
255 255
 					</h1>
256 256
 
257 257
 					<?php
258
-					if ( false === apply_filters( 'lsx_display_global_header_description', false ) ) {
258
+					if (false === apply_filters('lsx_display_global_header_description', false)) {
259 259
 						the_archive_description();
260 260
 					}
261 261
 					?>
262 262
 				</header>
263 263
 			</div>
264 264
 			<?php
265
-		elseif ( 'page' === $show_on_front && (int) get_option( 'page_for_posts' ) === $queried_object->ID ) :
265
+		elseif ('page' === $show_on_front && (int) get_option('page_for_posts') === $queried_object->ID) :
266 266
 			?>
267
-			<div class="archive-header-wrapper banner-page col-<?php echo esc_attr( $size ); ?>-12">
267
+			<div class="archive-header-wrapper banner-page col-<?php echo esc_attr($size); ?>-12">
268 268
 				<?php lsx_global_header_inner_bottom(); ?>
269 269
 				<header class="archive-header">
270
-					<h1 class="archive-title"><?php esc_html_e( 'Blog', 'lsx' ); ?></h1>
270
+					<h1 class="archive-title"><?php esc_html_e('Blog', 'lsx'); ?></h1>
271 271
 				</header>
272 272
 
273 273
 			</div>
274 274
 			<?php
275
-		elseif ( ! is_singular( 'post' ) ) :
275
+		elseif ( ! is_singular('post')) :
276 276
 			// Display only the breadcrumbs.
277 277
 			?>
278
-			<div class="archive-header-wrapper banner-singular col-<?php echo esc_attr( $size ); ?>-12">
278
+			<div class="archive-header-wrapper banner-singular col-<?php echo esc_attr($size); ?>-12">
279 279
 				<?php lsx_global_header_inner_bottom(); ?>
280 280
 			</div>
281 281
 			<?php
282
-		elseif ( ( true === apply_filters( 'lsx_global_header_disable', false ) ) && ( ! is_search() ) ) :
282
+		elseif ((true === apply_filters('lsx_global_header_disable', false)) && ( ! is_search())) :
283 283
 			// Display only the breadcrumbs.
284 284
 			?>
285
-			<div class="archive-header-wrapper banner-global col-<?php echo esc_attr( $size ); ?>-12">
285
+			<div class="archive-header-wrapper banner-global col-<?php echo esc_attr($size); ?>-12">
286 286
 				<?php lsx_global_header_inner_bottom(); ?>
287 287
 			</div>
288 288
 			<?php
289 289
 		endif;
290 290
 	}
291
-	add_action( 'lsx_content_wrap_before', 'lsx_global_header' );
291
+	add_action('lsx_content_wrap_before', 'lsx_global_header');
292 292
 endif;
293 293
 
294
-if ( ! function_exists( 'lsx_author_extra_info' ) ) :
294
+if ( ! function_exists('lsx_author_extra_info')) :
295 295
 	/**
296 296
 	 * Displays the author extra info.
297 297
 	 *
@@ -300,83 +300,83 @@  discard block
 block discarded – undo
300 300
 	 */
301 301
 	function lsx_author_extra_info() {
302 302
 		$default_size = 'sm';
303
-		$size         = apply_filters( 'lsx_bootstrap_column_size', $default_size );
303
+		$size         = apply_filters('lsx_bootstrap_column_size', $default_size);
304 304
 
305
-		if ( is_author() ) :
306
-			$author_id         = get_the_author_meta( 'ID' );
305
+		if (is_author()) :
306
+			$author_id         = get_the_author_meta('ID');
307 307
 			$author            = get_the_author();
308
-			$author_avatar     = get_avatar( $author_id, 400 );
308
+			$author_avatar     = get_avatar($author_id, 400);
309 309
 			$author_bio        = get_the_archive_description();
310
-			$author_url        = get_the_author_meta( 'url', $author_id );
311
-			$author_email      = get_the_author_meta( 'email', $author_id );
312
-			$author_facebook   = get_the_author_meta( 'facebook', $author_id );
313
-			$author_linkedin   = get_the_author_meta( 'linkedin', $author_id );
314
-			$author_twitter    = get_the_author_meta( 'twitter', $author_id );
315
-			$author_googleplus = get_the_author_meta( 'googleplus', $author_id );
310
+			$author_url        = get_the_author_meta('url', $author_id);
311
+			$author_email      = get_the_author_meta('email', $author_id);
312
+			$author_facebook   = get_the_author_meta('facebook', $author_id);
313
+			$author_linkedin   = get_the_author_meta('linkedin', $author_id);
314
+			$author_twitter    = get_the_author_meta('twitter', $author_id);
315
+			$author_googleplus = get_the_author_meta('googleplus', $author_id);
316 316
 			?>
317
-			<div class="col-<?php echo esc_attr( $size ); ?>-12">
317
+			<div class="col-<?php echo esc_attr($size); ?>-12">
318 318
 				<div class="archive-author-data">
319 319
 					<div class="row">
320
-						<?php if ( ! empty( $author_avatar ) ) : ?>
320
+						<?php if ( ! empty($author_avatar)) : ?>
321 321
 							<div class="col-xs-12 col-sm-4 col-md-3">
322
-							<figure class="archive-author-avatar"><?php echo wp_kses_post( $author_avatar ); ?></figure>
322
+							<figure class="archive-author-avatar"><?php echo wp_kses_post($author_avatar); ?></figure>
323 323
 							</div>
324 324
 						<?php endif; ?>
325 325
 						<div class="col-xs-12 col-sm-8 col-md-9">
326
-							<a class="back-to-blog" href="<?php echo ( esc_url( get_post_type_archive_link( 'post' ) ) ); ?>"><?php echo esc_html__( 'Back To Blog', 'lsx' ); ?></a>
326
+							<a class="back-to-blog" href="<?php echo (esc_url(get_post_type_archive_link('post'))); ?>"><?php echo esc_html__('Back To Blog', 'lsx'); ?></a>
327 327
 							<!-- Name -->
328 328
 							<h2 class="archive-author-title">
329 329
 								<?php
330
-								if ( '' !== $author ) {
331
-									echo esc_html( $author );
330
+								if ('' !== $author) {
331
+									echo esc_html($author);
332 332
 								}
333 333
 								?>
334 334
 							</h2>
335 335
 							<!-- Social -->
336
-							<?php if ( ! empty( $author_url ) || ! empty( $author_email ) || ! empty( $author_facebook ) || ! empty( $author_twitter ) || ! empty( $author_googleplus ) ) : ?>
336
+							<?php if ( ! empty($author_url) || ! empty($author_email) || ! empty($author_facebook) || ! empty($author_twitter) || ! empty($author_googleplus)) : ?>
337 337
 								<div class="archive-author-social-links">
338
-									<?php if ( ! empty( $author_url ) ) : ?>
339
-										<a href="<?php echo esc_url( $author_url ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-url"><i class="fa fa-link" aria-hidden="true"></i></a>
338
+									<?php if ( ! empty($author_url)) : ?>
339
+										<a href="<?php echo esc_url($author_url); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-url"><i class="fa fa-link" aria-hidden="true"></i></a>
340 340
 									<?php endif; ?>
341 341
 
342
-									<?php if ( ! empty( $author_email ) ) : ?>
343
-										<a href="mailto:<?php echo esc_attr( $author_email ); ?>" class="archive-author-social-link archive-author-social-link-email"><i class="fa fa-envelope" aria-hidden="true"></i></a>
342
+									<?php if ( ! empty($author_email)) : ?>
343
+										<a href="mailto:<?php echo esc_attr($author_email); ?>" class="archive-author-social-link archive-author-social-link-email"><i class="fa fa-envelope" aria-hidden="true"></i></a>
344 344
 									<?php endif; ?>
345 345
 
346
-									<?php if ( ! empty( $author_facebook ) ) : ?>
347
-										<a href="<?php echo esc_url( $author_facebook ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a>
346
+									<?php if ( ! empty($author_facebook)) : ?>
347
+										<a href="<?php echo esc_url($author_facebook); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a>
348 348
 									<?php endif; ?>
349 349
 
350
-									<?php if ( ! empty( $author_twitter ) ) : ?>
351
-										<a href="https://twitter.com/<?php echo esc_attr( $author_twitter ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a>
350
+									<?php if ( ! empty($author_twitter)) : ?>
351
+										<a href="https://twitter.com/<?php echo esc_attr($author_twitter); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a>
352 352
 									<?php endif; ?>
353 353
 
354
-									<?php if ( ! empty( $author_linkedin ) ) : ?>
355
-										<a href="<?php echo esc_url( $author_linkedin ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-linkedin"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
354
+									<?php if ( ! empty($author_linkedin)) : ?>
355
+										<a href="<?php echo esc_url($author_linkedin); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-linkedin"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
356 356
 									<?php endif; ?>
357 357
 
358
-									<?php if ( ! empty( $author_googleplus ) ) : ?>
359
-										<a href="<?php echo esc_url( $author_googleplus ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-googleplus"><i class="fa fa-google-plus" aria-hidden="true"></i></a>
358
+									<?php if ( ! empty($author_googleplus)) : ?>
359
+										<a href="<?php echo esc_url($author_googleplus); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-googleplus"><i class="fa fa-google-plus" aria-hidden="true"></i></a>
360 360
 									<?php endif; ?>
361 361
 								</div>
362 362
 							<?php endif; ?>
363 363
 
364 364
 							<!-- Bio -->
365
-							<?php if ( ! empty( $author_bio ) ) : ?>
366
-								<p class="archive-author-bio"><?php echo wp_kses_post( $author_bio ); ?></p>
365
+							<?php if ( ! empty($author_bio)) : ?>
366
+								<p class="archive-author-bio"><?php echo wp_kses_post($author_bio); ?></p>
367 367
 							<?php endif; ?>
368 368
 						</div>
369 369
 					</div>
370 370
 				</div>
371
-				<h2><?php echo esc_html__( 'Posts', 'lsx' ); ?></h2>
371
+				<h2><?php echo esc_html__('Posts', 'lsx'); ?></h2>
372 372
 			</div>
373 373
 			<?php
374 374
 		endif;
375 375
 	}
376
-	add_action( 'lsx_content_wrap_before', 'lsx_author_extra_info', 11 );
376
+	add_action('lsx_content_wrap_before', 'lsx_author_extra_info', 11);
377 377
 endif;
378 378
 
379
-if ( ! function_exists( 'lsx_post_header' ) ) :
379
+if ( ! function_exists('lsx_post_header')) :
380 380
 	/**
381 381
 	 * Displays the post header.
382 382
 	 *
@@ -385,26 +385,26 @@  discard block
 block discarded – undo
385 385
 	 */
386 386
 	function lsx_post_header() {
387 387
 		$default_size = 'sm';
388
-		$size         = apply_filters( 'lsx_bootstrap_column_size', $default_size );
388
+		$size         = apply_filters('lsx_bootstrap_column_size', $default_size);
389 389
 
390
-		$disable_title = get_post_meta( get_the_ID(), 'lsx_disable_title', true );
391
-		if ( 'yes' === $disable_title && is_singular( 'post' ) ) {
390
+		$disable_title = get_post_meta(get_the_ID(), 'lsx_disable_title', true);
391
+		if ('yes' === $disable_title && is_singular('post')) {
392 392
 			return;
393 393
 		}
394 394
 
395
-		if ( is_singular( 'post' ) ) :
395
+		if (is_singular('post')) :
396 396
 			$format = get_post_format();
397 397
 
398
-			if ( false === $format ) {
398
+			if (false === $format) {
399 399
 				$format = 'standard';
400 400
 			}
401 401
 
402
-			$format = lsx_translate_format_to_fontawesome( $format );
402
+			$format = lsx_translate_format_to_fontawesome($format);
403 403
 			?>
404
-			<div class="archive-header-wrapper banner-post-header col-<?php echo esc_attr( $size ); ?>-12">
404
+			<div class="archive-header-wrapper banner-post-header col-<?php echo esc_attr($size); ?>-12">
405 405
 				<header class="archive-header">
406 406
 					<h1 class="archive-title">
407
-						<i class="format-link fa fa-<?php echo esc_attr( $format ); ?>"></i>
407
+						<i class="format-link fa fa-<?php echo esc_attr($format); ?>"></i>
408 408
 						<span><?php the_title(); ?></span>
409 409
 					</h1>
410 410
 				</header>
@@ -412,10 +412,10 @@  discard block
 block discarded – undo
412 412
 			<?php
413 413
 		endif;
414 414
 	}
415
-	add_action( 'lsx_entry_top', 'lsx_post_header' );
415
+	add_action('lsx_entry_top', 'lsx_post_header');
416 416
 endif;
417 417
 
418
-if ( ! function_exists( 'lsx_add_viewport_meta_tag' ) ) :
418
+if ( ! function_exists('lsx_add_viewport_meta_tag')) :
419 419
 	/**
420 420
 	 * Add Viewport Meta Tag to head.
421 421
 	 *
@@ -427,10 +427,10 @@  discard block
 block discarded – undo
427 427
 		<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0">
428 428
 		<?php
429 429
 	}
430
-	add_action( 'wp_head', 'lsx_add_viewport_meta_tag' );
430
+	add_action('wp_head', 'lsx_add_viewport_meta_tag');
431 431
 endif;
432 432
 
433
-if ( ! function_exists( 'lsx_header_search_form' ) ) :
433
+if ( ! function_exists('lsx_header_search_form')) :
434 434
 	/**
435 435
 	 * Add a search form to just above the nav menu.
436 436
 	 *
@@ -438,24 +438,24 @@  discard block
 block discarded – undo
438 438
 	 * @subpackage layout
439 439
 	 */
440 440
 	function lsx_header_search_form() {
441
-		$search_form = get_theme_mod( 'lsx_header_search', false );
441
+		$search_form = get_theme_mod('lsx_header_search', false);
442 442
 
443
-		if ( false !== $search_form || is_customize_preview() ) {
444
-			get_search_form( true );
443
+		if (false !== $search_form || is_customize_preview()) {
444
+			get_search_form(true);
445 445
 		}
446 446
 	}
447
-	$mobile_header_layout = get_theme_mod( 'lsx_header_mobile_layout', 'navigation-bar' );
448
-	add_action( 'lsx_nav_before', 'lsx_header_search_form', 0 );
447
+	$mobile_header_layout = get_theme_mod('lsx_header_mobile_layout', 'navigation-bar');
448
+	add_action('lsx_nav_before', 'lsx_header_search_form', 0);
449 449
 endif;
450 450
 
451 451
 // Add entry meta to single post if active.
452
-if ( ! function_exists( 'lsx_add_entry_meta' ) ) :
452
+if ( ! function_exists('lsx_add_entry_meta')) :
453 453
 	function lsx_add_entry_meta() {
454
-		$disable_title = get_post_meta( get_the_ID(), 'lsx_disable_title', true );
455
-		if ( 'yes' === $disable_title && is_singular( 'post' ) ) {
454
+		$disable_title = get_post_meta(get_the_ID(), 'lsx_disable_title', true);
455
+		if ('yes' === $disable_title && is_singular('post')) {
456 456
 			return;
457 457
 		}
458
-		if ( is_single() && is_singular( 'post' ) ) {
458
+		if (is_single() && is_singular('post')) {
459 459
 			?>
460 460
 			<div class="entry-meta">
461 461
 				<?php lsx_post_meta_single_top(); ?>
@@ -463,5 +463,5 @@  discard block
 block discarded – undo
463 463
 			<?php
464 464
 		}
465 465
 	}
466
-	add_action( 'lsx_entry_top', 'lsx_add_entry_meta', 999 );
466
+	add_action('lsx_entry_top', 'lsx_add_entry_meta', 999);
467 467
 endif;
Please login to merge, or discard this patch.