Passed
Push — dependabot/github_actions/acti... ( 98239e )
by
unknown
15:46
created
classes/class-lsx-search-facetwp.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -21,57 +21,57 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function __construct() {
23 23
 
24
-		require_once LSX_SEARCH_PATH . '/classes/facetwp/class-hierarchy.php';
24
+		require_once LSX_SEARCH_PATH.'/classes/facetwp/class-hierarchy.php';
25 25
 		$this->hierarchy = lsx\search\classes\facetwp\Hierarchy::get_instance();
26 26
 
27
-		require_once LSX_SEARCH_PATH . '/classes/facetwp/class-post-connections.php';
27
+		require_once LSX_SEARCH_PATH.'/classes/facetwp/class-post-connections.php';
28 28
 		$this->post_connections = lsx\search\classes\facetwp\Post_Connections::get_instance();
29 29
 
30
-		add_filter( 'facetwp_pager_html', array( $this, 'facetwp_pager_html' ), 10, 2 );
31
-		add_filter( 'facetwp_result_count', array( $this, 'facetwp_result_count' ), 10, 2 );
32
-		add_filter( 'facetwp_facet_html', array( $this, 'facetwp_slide_html' ), 10, 2 );
33
-		add_filter( 'facetwp_load_css', array( $this, 'facetwp_load_css' ), 10, 1 );
34
-		add_filter( 'facetwp_index_row', array( $this, 'index_row' ), 10, 2 );
30
+		add_filter('facetwp_pager_html', array($this, 'facetwp_pager_html'), 10, 2);
31
+		add_filter('facetwp_result_count', array($this, 'facetwp_result_count'), 10, 2);
32
+		add_filter('facetwp_facet_html', array($this, 'facetwp_slide_html'), 10, 2);
33
+		add_filter('facetwp_load_css', array($this, 'facetwp_load_css'), 10, 1);
34
+		add_filter('facetwp_index_row', array($this, 'index_row'), 10, 2);
35 35
 	}
36 36
 
37 37
 	/**
38 38
 	 * Change FaceWP pagination HTML to be equal LSX pagination.
39 39
 	 */
40
-	public function facetwp_pager_html( $output, $params ) {
40
+	public function facetwp_pager_html($output, $params) {
41 41
 		$output = '';
42 42
 		$page = (int) $params['page'];
43 43
 		$per_page = (int) $params['per_page'];
44 44
 		$total_pages = (int) $params['total_pages'];
45 45
 
46
-		if ( 1 < $total_pages ) {
46
+		if (1 < $total_pages) {
47 47
 			$output .= '<div class="lsx-pagination-wrapper facetwp-custom">';
48 48
 			$output .= '<div class="lsx-pagination">';
49 49
 			// $output .= '<span class="pages">Page '. $page .' of '. $total_pages .'</span>';
50 50
 
51
-			if ( 1 < $page ) {
52
-				$output .= '<a class="prev page-numbers facetwp-page" rel="prev" data-page="' . ( $page - 1 ) . '">«</a>';
51
+			if (1 < $page) {
52
+				$output .= '<a class="prev page-numbers facetwp-page" rel="prev" data-page="'.($page - 1).'">«</a>';
53 53
 			}
54 54
 
55 55
 			$temp = false;
56 56
 
57
-			for ( $i = 1; $i <= $total_pages; $i++ ) {
58
-				if ( $i == $page ) {
59
-					$output .= '<span class="page-numbers current">' . $i . '</span>';
60
-				} elseif ( ( $page - 2 ) < $i && ( $page + 2 ) > $i ) {
61
-					$output .= '<a class="page-numbers facetwp-page" data-page="' . $i . '">' . $i . '</a>';
62
-				} elseif ( ( $page - 2 ) >= $i && $page > 2 ) {
63
-					if ( ! $temp ) {
57
+			for ($i = 1; $i <= $total_pages; $i++) {
58
+				if ($i == $page) {
59
+					$output .= '<span class="page-numbers current">'.$i.'</span>';
60
+				} elseif (($page - 2) < $i && ($page + 2) > $i) {
61
+					$output .= '<a class="page-numbers facetwp-page" data-page="'.$i.'">'.$i.'</a>';
62
+				} elseif (($page - 2) >= $i && $page > 2) {
63
+					if (!$temp) {
64 64
 						$output .= '<span class="page-numbers dots">...</span>';
65 65
 						$temp = true;
66 66
 					}
67
-				} elseif ( ( $page + 2 ) <= $i && ( $page + 2 ) <= $total_pages ) {
67
+				} elseif (($page + 2) <= $i && ($page + 2) <= $total_pages) {
68 68
 					$output .= '<span class="page-numbers dots">...</span>';
69 69
 					break;
70 70
 				}
71 71
 			}
72 72
 
73
-			if ( $page < $total_pages ) {
74
-				$output .= '<a class="next page-numbers facetwp-page" rel="next" data-page="' . ( $page + 1 ) . '">»</a>';
73
+			if ($page < $total_pages) {
74
+				$output .= '<a class="next page-numbers facetwp-page" rel="next" data-page="'.($page + 1).'">»</a>';
75 75
 			}
76 76
 
77 77
 			$output .= '</div>';
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	/**
85 85
 	 * Change FaceWP result count HTML.
86 86
 	 */
87
-	public function facetwp_result_count( $output, $params ) {
87
+	public function facetwp_result_count($output, $params) {
88 88
 		$output = $params['total'];
89 89
 		return $output;
90 90
 	}
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 	/**
93 93
 	 * Change FaceWP slider HTML.
94 94
 	 */
95
-	public function facetwp_slide_html( $html, $args ) {
96
-		if ( 'slider' === $args['facet']['type'] ) {
97
-			$html = str_replace( 'class="facetwp-slider-reset"', 'class="btn btn-md facetwp-slider-reset"', $html );
95
+	public function facetwp_slide_html($html, $args) {
96
+		if ('slider' === $args['facet']['type']) {
97
+			$html = str_replace('class="facetwp-slider-reset"', 'class="btn btn-md facetwp-slider-reset"', $html);
98 98
 		}
99 99
 
100 100
 		return $html;
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
 	/**
104 104
 	 * Change FaceWP slider HTML.
105 105
 	 */
106
-	public function facetwp_counts_html( $html, $args ) {
107
-		if ( 'slider' === $args['facet']['type'] ) {
108
-			$html = str_replace( 'class="facetwp-slider-reset"', 'class="btn btn-md facetwp-slider-reset"', $html );
106
+	public function facetwp_counts_html($html, $args) {
107
+		if ('slider' === $args['facet']['type']) {
108
+			$html = str_replace('class="facetwp-slider-reset"', 'class="btn btn-md facetwp-slider-reset"', $html);
109 109
 		}
110 110
 		return $html;
111 111
 	}
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	/**
114 114
 	 * Disable FacetWP styles.
115 115
 	 */
116
-	public function facetwp_load_css( $boolean ) {
116
+	public function facetwp_load_css($boolean) {
117 117
 		$boolean = false;
118 118
 		return $boolean;
119 119
 	}
@@ -125,18 +125,18 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @return mixed
127 127
 	 */
128
-	public function index_row( $params, $class ) {
128
+	public function index_row($params, $class) {
129 129
 		// Custom woo fields
130
-		if ( 0 === strpos( $params['facet_source'], 'woo' ) ) {
131
-			$product = wc_get_product( $params['post_id'] );
130
+		if (0 === strpos($params['facet_source'], 'woo')) {
131
+			$product = wc_get_product($params['post_id']);
132 132
 
133 133
 			// Price
134
-			if ( in_array( $params['facet_source'], array( 'woo/price', 'woo/sale_price', 'woo/regular_price' ) ) ) {
134
+			if (in_array($params['facet_source'], array('woo/price', 'woo/sale_price', 'woo/regular_price'))) {
135 135
 				$price = $params['facet_value'];
136
-				if ( $product->is_taxable() ) {
137
-					$price = wc_get_price_including_tax( $product );
136
+				if ($product->is_taxable()) {
137
+					$price = wc_get_price_including_tax($product);
138 138
 				}
139
-				$params['facet_value']    = $price;
139
+				$params['facet_value'] = $price;
140 140
 				$params['facet_display_value'] = $price;
141 141
 
142 142
 			}
Please login to merge, or discard this patch.
classes/class-admin.php 1 patch
Spacing   +138 added lines, -138 removed lines patch added patch discarded remove patch
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	public function __construct() {
55 55
 		$this->load_classes();
56
-		add_action( 'cmb2_admin_init', array( $this, 'register_settings_page' ) );
57
-		add_action( 'lsx_search_settings_page', array( $this, 'configure_settings_search_engine_fields' ), 15, 1 );
58
-		add_action( 'lsx_search_settings_page', array( $this, 'configure_settings_search_archive_fields' ), 15, 1 );
59
-		add_action( 'admin_enqueue_scripts', array( $this, 'assets' ) );
60
-
61
-		if ( is_admin() ) {
62
-			add_filter( 'lsx_customizer_colour_selectors_body', array( $this, 'customizer_body_colours_handler' ), 15, 2 );
63
-			add_filter( 'lsx_customizer_colour_selectors_button', array( $this, 'customizer_button_colours' ), 10, 2 );
56
+		add_action('cmb2_admin_init', array($this, 'register_settings_page'));
57
+		add_action('lsx_search_settings_page', array($this, 'configure_settings_search_engine_fields'), 15, 1);
58
+		add_action('lsx_search_settings_page', array($this, 'configure_settings_search_archive_fields'), 15, 1);
59
+		add_action('admin_enqueue_scripts', array($this, 'assets'));
60
+
61
+		if (is_admin()) {
62
+			add_filter('lsx_customizer_colour_selectors_body', array($this, 'customizer_body_colours_handler'), 15, 2);
63
+			add_filter('lsx_customizer_colour_selectors_button', array($this, 'customizer_button_colours'), 10, 2);
64 64
 		}
65 65
 	}
66 66
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public static function get_instance() {
75 75
 		// If the single instance hasn't been set, set it now.
76
-		if ( null === self::$instance ) {
76
+		if (null === self::$instance) {
77 77
 			self::$instance = new self();
78 78
 		}
79 79
 		return self::$instance;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 * Loads the variable classes and the static classes.
84 84
 	 */
85 85
 	private function load_classes() {
86
-		require_once LSX_SEARCH_PATH . 'classes/admin/class-settings-theme.php';
86
+		require_once LSX_SEARCH_PATH.'classes/admin/class-settings-theme.php';
87 87
 		$this->settings_theme = admin\Settings_Theme::get_instance();
88 88
 	}
89 89
 
@@ -95,21 +95,21 @@  discard block
 block discarded – undo
95 95
 	public function register_settings_page() {
96 96
 		$args = array(
97 97
 			'id'           => 'lsx_search_settings',
98
-			'title'        => '<h1>' . esc_html__( 'LSX Search Settings', 'lsx-search' ) . ' <span class="version">' . LSX_SEARCH_VER . '</span></h1>',
99
-			'menu_title'   => esc_html__( 'LSX Search', 'search' ), // Falls back to 'title' (above).
100
-			'object_types' => array( 'options-page' ),
98
+			'title'        => '<h1>'.esc_html__('LSX Search Settings', 'lsx-search').' <span class="version">'.LSX_SEARCH_VER.'</span></h1>',
99
+			'menu_title'   => esc_html__('LSX Search', 'search'), // Falls back to 'title' (above).
100
+			'object_types' => array('options-page'),
101 101
 			'option_key'   => 'lsx-search-settings', // The option key and admin menu page slug.
102 102
 			'parent_slug'  => 'options-general.php',
103 103
 			'capability'   => 'manage_options', // Cap required to view options-page.
104 104
 		);
105
-		$cmb  = new_cmb2_box( $args );
106
-		do_action( 'lsx_search_settings_page', $cmb );
105
+		$cmb = new_cmb2_box($args);
106
+		do_action('lsx_search_settings_page', $cmb);
107 107
 	}
108 108
 
109 109
 	/**
110 110
 	 * Sets post types with active search options.
111 111
 	 */
112
-	public function register_post_type_tabs( $post_types_plural ) {
112
+	public function register_post_type_tabs($post_types_plural) {
113 113
 		$post_types_plural = array(
114 114
 			'project' => 'projects',
115 115
 			'service' => 'services',
@@ -146,19 +146,19 @@  discard block
 block discarded – undo
146 146
 	 * @return  void
147 147
 	 */
148 148
 	public function set_facetwp_vars() {
149
-		if ( function_exists( '\FWP' ) ) {
149
+		if (function_exists('\FWP')) {
150 150
 			$facet_data = \FWP()->helper->get_facets();
151 151
 		}
152 152
 		$this->facet_data = array();
153 153
 		$this->az_facets  = array(
154
-			'' => __( 'Do not show', 'lsx-search' ),
154
+			'' => __('Do not show', 'lsx-search'),
155 155
 		);
156
-		if ( ! empty( $facet_data ) && is_array( $facet_data ) ) {
157
-			foreach ( $facet_data as $facet ) {
158
-				if ( 'alpha' === $facet['type'] ) {
159
-					$this->az_facets[ $facet['name'] ] = $facet['label'] . '(' . $facet['name'] . ')';
156
+		if (!empty($facet_data) && is_array($facet_data)) {
157
+			foreach ($facet_data as $facet) {
158
+				if ('alpha' === $facet['type']) {
159
+					$this->az_facets[$facet['name']] = $facet['label'].'('.$facet['name'].')';
160 160
 				} else {
161
-					$this->facet_data[ $facet['name'] ] = $facet['label'] . '(' . $facet['name'] . ')';
161
+					$this->facet_data[$facet['name']] = $facet['label'].'('.$facet['name'].')';
162 162
 				}
163 163
 			}
164 164
 		}
@@ -167,9 +167,9 @@  discard block
 block discarded – undo
167 167
 	/**
168 168
 	 * Enqueue JS and CSS.
169 169
 	 */
170
-	public function assets( $hook ) {
171
-		wp_enqueue_script( 'lsx-search-admin', LSX_SEARCH_URL . 'assets/js/src/lsx-search-admin.js', array( 'jquery' ), LSX_SEARCH_VER, true );
172
-		wp_enqueue_style( 'lsx-search-admin', LSX_SEARCH_URL . 'assets/css/lsx-search-admin.css', array(), LSX_SEARCH_VER );
170
+	public function assets($hook) {
171
+		wp_enqueue_script('lsx-search-admin', LSX_SEARCH_URL.'assets/js/src/lsx-search-admin.js', array('jquery'), LSX_SEARCH_VER, true);
172
+		wp_enqueue_style('lsx-search-admin', LSX_SEARCH_URL.'assets/css/lsx-search-admin.css', array(), LSX_SEARCH_VER);
173 173
 	}
174 174
 
175 175
 	/**
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
 	 *
178 178
 	 * @return  void
179 179
 	 */
180
-	public function configure_settings_search_engine_fields( $cmb ) {
180
+	public function configure_settings_search_engine_fields($cmb) {
181 181
 		$global_args = array(
182
-			'title' => __( 'Global', 'lsx-search' ),
183
-			'desc'  => esc_html__( 'Control the filters which show on your WordPress search results page.', 'lsx-search' ),
182
+			'title' => __('Global', 'lsx-search'),
183
+			'desc'  => esc_html__('Control the filters which show on your WordPress search results page.', 'lsx-search'),
184 184
 		);
185
-		$this->search_fields( $cmb, 'engine', $global_args );
185
+		$this->search_fields($cmb, 'engine', $global_args);
186 186
 	}
187 187
 
188 188
 	/**
@@ -192,71 +192,71 @@  discard block
 block discarded – undo
192 192
 	 * @param string $position either top of bottom.
193 193
 	 * @return void
194 194
 	 */
195
-	public function configure_settings_search_archive_fields( $cmb ) {
195
+	public function configure_settings_search_archive_fields($cmb) {
196 196
 		$archives       = array();
197 197
 		$post_type_args = array(
198 198
 			'public' => true,
199 199
 		);
200
-		$post_types     = get_post_types( $post_type_args );
201
-		if ( ! empty( $post_types ) ) {
202
-			foreach ( $post_types as $post_type_key => $post_type_value ) {
203
-				switch ( $post_type_key ) {
200
+		$post_types     = get_post_types($post_type_args);
201
+		if (!empty($post_types)) {
202
+			foreach ($post_types as $post_type_key => $post_type_value) {
203
+				switch ($post_type_key) {
204 204
 					case 'post':
205 205
 						$page_url      = home_url();
206
-						$page_title    = __( 'Home', 'lsx-search' );
207
-						$show_on_front = get_option( 'show_on_front' );
208
-						if ( 'page' === $show_on_front ) {
209
-							$page_for_posts = get_option( 'page_for_posts' );
210
-							if ( '' !== $page_for_posts ) {
211
-								$page_title   = get_the_title( $page_for_posts );
212
-								$page_url     = get_permalink( $page_for_posts );
206
+						$page_title    = __('Home', 'lsx-search');
207
+						$show_on_front = get_option('show_on_front');
208
+						if ('page' === $show_on_front) {
209
+							$page_for_posts = get_option('page_for_posts');
210
+							if ('' !== $page_for_posts) {
211
+								$page_title   = get_the_title($page_for_posts);
212
+								$page_url     = get_permalink($page_for_posts);
213 213
 							}
214 214
 						}
215 215
 						$description = sprintf(
216 216
 							/* translators: %s: The subscription info */
217
-							__( 'Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> page.', 'lsx-search' ),
217
+							__('Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> page.', 'lsx-search'),
218 218
 							$page_url,
219 219
 							$page_title
220 220
 						);
221
-						$archives[ $post_type_key ] = array(
222
-							'title' => __( 'Blog', 'lsx-search' ),
221
+						$archives[$post_type_key] = array(
222
+							'title' => __('Blog', 'lsx-search'),
223 223
 							'desc'  => $description,
224 224
 						);
225 225
 						break;
226 226
 
227 227
 					case 'product':
228 228
 						$page_url = home_url();
229
-						$page_title    = __( 'Shop', 'lsx-search' );
230
-						if ( function_exists( 'wc_get_page_id' ) ) {
231
-							$shop_page  = wc_get_page_id( 'shop' );
232
-							$page_url   = get_permalink( $shop_page );
233
-							$page_title = get_the_title( $shop_page );
229
+						$page_title = __('Shop', 'lsx-search');
230
+						if (function_exists('wc_get_page_id')) {
231
+							$shop_page  = wc_get_page_id('shop');
232
+							$page_url   = get_permalink($shop_page);
233
+							$page_title = get_the_title($shop_page);
234 234
 						}
235 235
 						$description = sprintf(
236 236
 							/* translators: %s: The subscription info */
237
-							__( 'Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> page.', 'lsx-search' ),
237
+							__('Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> page.', 'lsx-search'),
238 238
 							$page_url,
239 239
 							$page_title
240 240
 						);
241
-						$archives[ $post_type_key ] = array(
242
-							'title' => __( 'Shop', 'lsx-search' ),
241
+						$archives[$post_type_key] = array(
242
+							'title' => __('Shop', 'lsx-search'),
243 243
 							'desc'  => $description,
244 244
 						);
245 245
 						break;
246 246
 
247 247
 					default:
248
-						if ( ! in_array( $post_type_key, \lsx\search\includes\get_restricted_post_types() ) ) {
249
-							$temp_post_type = get_post_type_object( $post_type_key );
250
-							if ( ! is_wp_error( $temp_post_type ) ) {
251
-								$page_url    = get_post_type_archive_link( $temp_post_type->name );
248
+						if (!in_array($post_type_key, \lsx\search\includes\get_restricted_post_types())) {
249
+							$temp_post_type = get_post_type_object($post_type_key);
250
+							if (!is_wp_error($temp_post_type)) {
251
+								$page_url    = get_post_type_archive_link($temp_post_type->name);
252 252
 								$description = sprintf(
253 253
 									/* translators: %s: The subscription info */
254
-									__( 'Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> archive.', 'lsx-search' ),
254
+									__('Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> archive.', 'lsx-search'),
255 255
 									$page_url,
256 256
 									$temp_post_type->label
257 257
 								);
258 258
 
259
-								$archives[ $post_type_key ] = array(
259
+								$archives[$post_type_key] = array(
260 260
 									'title' => $temp_post_type->label,
261 261
 									'desc'  => $description,
262 262
 								);
@@ -266,9 +266,9 @@  discard block
 block discarded – undo
266 266
 				}
267 267
 			}
268 268
 		}
269
-		if ( ! empty( $archives ) ) {
270
-			foreach ( $archives as $archive_key => $archive_args ) {
271
-				$this->search_fields( $cmb, $archive_key, $archive_args );
269
+		if (!empty($archives)) {
270
+			foreach ($archives as $archive_key => $archive_args) {
271
+				$this->search_fields($cmb, $archive_key, $archive_args);
272 272
 			}
273 273
 		}
274 274
 	}
@@ -280,126 +280,126 @@  discard block
 block discarded – undo
280 280
 	 * @param string $section either engine,archive or single.
281 281
 	 * @return void
282 282
 	 */
283
-	public function search_fields( $cmb, $section, $args ) {
283
+	public function search_fields($cmb, $section, $args) {
284 284
 		$this->set_facetwp_vars();
285 285
 		$cmb->add_field(
286 286
 			array(
287
-				'id'          => 'settings_' . $section . '_search',
287
+				'id'          => 'settings_'.$section.'_search',
288 288
 				'type'        => 'title',
289 289
 				'name'        => $args['title'],
290 290
 				'default'     => $args['title'],
291 291
 				'description' => $args['desc'],
292 292
 			)
293 293
 		);
294
-		do_action( 'lsx_search_settings_section', $cmb, 'top' );
294
+		do_action('lsx_search_settings_section', $cmb, 'top');
295 295
 		$cmb->add_field(
296 296
 			array(
297
-				'name'        => esc_html__( 'Enable Search Filters', 'lsx-search' ),
298
-				'id'          => $section . '_search_enable',
299
-				'description' => esc_html__( 'Display FacetWP filters on your search results page.', 'lsx-search' ),
297
+				'name'        => esc_html__('Enable Search Filters', 'lsx-search'),
298
+				'id'          => $section.'_search_enable',
299
+				'description' => esc_html__('Display FacetWP filters on your search results page.', 'lsx-search'),
300 300
 				'type'        => 'checkbox',
301 301
 			)
302 302
 		);
303 303
 
304 304
 		$cmb->add_field(
305 305
 			array(
306
-				'name'    => esc_html__( 'Page Layout', 'lsx-search' ),
307
-				'id'      => $section . '_search_layout',
306
+				'name'    => esc_html__('Page Layout', 'lsx-search'),
307
+				'id'      => $section.'_search_layout',
308 308
 				'type'    => 'select',
309 309
 				'options' => array(
310
-					''    => esc_html__( 'Follow the theme layout', 'lsx-search' ),
311
-					'1c'  => esc_html__( '1 column', 'lsx-search' ),
312
-					'2cr' => esc_html__( '2 columns / Content on right', 'lsx-search' ),
313
-					'2cl' => esc_html__( '2 columns / Content on left', 'lsx-search' ),
310
+					''    => esc_html__('Follow the theme layout', 'lsx-search'),
311
+					'1c'  => esc_html__('1 column', 'lsx-search'),
312
+					'2cr' => esc_html__('2 columns / Content on right', 'lsx-search'),
313
+					'2cl' => esc_html__('2 columns / Content on left', 'lsx-search'),
314 314
 				),
315 315
 				'default' => '',
316 316
 			)
317 317
 		);
318 318
 
319
-		if ( 'product' === $section ) {
319
+		if ('product' === $section) {
320 320
 			$cmb->add_field(
321 321
 				array(
322
-					'name'             => esc_html__( 'Results Layout', 'lsx-search' ),
323
-					'id'               => $section . '_search_grid_list',
322
+					'name'             => esc_html__('Results Layout', 'lsx-search'),
323
+					'id'               => $section.'_search_grid_list',
324 324
 					'type'             => 'select',
325 325
 					'show_option_none' => false,
326
-					'description'      => __( 'Set a default layout for the search results.', 'lsx-search' ),
326
+					'description'      => __('Set a default layout for the search results.', 'lsx-search'),
327 327
 					'options'          => array(
328
-						'grid' => esc_html__( 'Grid', 'lsx-search' ),
329
-						'list' => esc_html__( 'List', 'lsx-search' ),
328
+						'grid' => esc_html__('Grid', 'lsx-search'),
329
+						'list' => esc_html__('List', 'lsx-search'),
330 330
 					),
331 331
 					'default' => 'grid',
332 332
 				)
333 333
 			);
334 334
 			$cmb->add_field(
335 335
 				array(
336
-					'name'        => esc_html__( 'Layout Switcher', 'lsx-search' ),
337
-					'id'          => $section . '_search_layout_switcher_enable',
336
+					'name'        => esc_html__('Layout Switcher', 'lsx-search'),
337
+					'id'          => $section.'_search_layout_switcher_enable',
338 338
 					'type'        => 'checkbox',
339
-					'description' => __( 'Display the layout switcher to allow the user to toggle between the list and grid layouts.', 'lsx-search' ),
339
+					'description' => __('Display the layout switcher to allow the user to toggle between the list and grid layouts.', 'lsx-search'),
340 340
 				)
341 341
 			);
342 342
 		}
343
-		if ( 'engine' === $section && is_plugin_active( 'tour-operator/tour-operator.php' ) ) {
343
+		if ('engine' === $section && is_plugin_active('tour-operator/tour-operator.php')) {
344 344
 			$cmb->add_field(
345 345
 				array(
346
-					'name'    => esc_html__( 'List layout images', 'lsx-search' ),
347
-					'id'      => $section . '_search_list_layout_image_style',
346
+					'name'    => esc_html__('List layout images', 'lsx-search'),
347
+					'id'      => $section.'_search_list_layout_image_style',
348 348
 					'type'    => 'select',
349 349
 					'options' => array(
350
-						''           => esc_html__( 'Full Height', 'lsx-search' ),
351
-						'max-height' => esc_html__( 'Max Height', 'lsx-search' ),
350
+						''           => esc_html__('Full Height', 'lsx-search'),
351
+						'max-height' => esc_html__('Max Height', 'lsx-search'),
352 352
 					),
353 353
 					'default' => '',
354 354
 				)
355 355
 			);
356 356
 		}
357
-		if ( 'engine' === $section ) {
357
+		if ('engine' === $section) {
358 358
 			$cmb->add_field(
359 359
 				array(
360
-					'name'        => esc_html__( 'Display Excerpt', 'lsx-search' ),
361
-					'id'          => $section . '_excerpt_enable',
360
+					'name'        => esc_html__('Display Excerpt', 'lsx-search'),
361
+					'id'          => $section.'_excerpt_enable',
362 362
 					'type'        => 'checkbox',
363
-					'description' => __( 'Display the excerpt of a listing.', 'lsx-search' ),
363
+					'description' => __('Display the excerpt of a listing.', 'lsx-search'),
364 364
 				)
365 365
 			);
366 366
 			$cmb->add_field(
367 367
 				array(
368
-					'name'        => esc_html__( 'Enable Post Type Label', 'lsx-search' ),
369
-					'id'          => $section . '_search_enable_pt_label',
368
+					'name'        => esc_html__('Enable Post Type Label', 'lsx-search'),
369
+					'id'          => $section.'_search_enable_pt_label',
370 370
 					'type'        => 'checkbox',
371
-					'description' => __( 'This enables the post type label from entries on search results page.', 'lsx-search' ),
371
+					'description' => __('This enables the post type label from entries on search results page.', 'lsx-search'),
372 372
 				)
373 373
 			);
374
-			if ( is_plugin_active( 'tour-operator/tour-operator.php' ) ) {
374
+			if (is_plugin_active('tour-operator/tour-operator.php')) {
375 375
 				$cmb->add_field(
376 376
 					array(
377
-						'name'        => esc_html__( 'Enable Continent Filter', 'lsx-search' ),
378
-						'id'          => $section . '_search_enable_continent_filter',
377
+						'name'        => esc_html__('Enable Continent Filter', 'lsx-search'),
378
+						'id'          => $section.'_search_enable_continent_filter',
379 379
 						'type'        => 'checkbox',
380
-						'description' => __( 'This enables the continent filter in FacetWP destinations filter.', 'lsx-search' ),
380
+						'description' => __('This enables the continent filter in FacetWP destinations filter.', 'lsx-search'),
381 381
 					)
382 382
 				);
383 383
 				$cmb->add_field(
384 384
 					array(
385
-						'name'        => esc_html__( 'Enable Continental Regions', 'lsx-search' ),
386
-						'id'          => $section . '_search_enable_continental_regions',
385
+						'name'        => esc_html__('Enable Continental Regions', 'lsx-search'),
386
+						'id'          => $section.'_search_enable_continental_regions',
387 387
 						'type'        => 'checkbox',
388
-						'description' => __( 'This disable continents and enabled the sub regions.', 'lsx-search' ),
388
+						'description' => __('This disable continents and enabled the sub regions.', 'lsx-search'),
389 389
 					)
390 390
 				);
391 391
 			}
392 392
 		}
393 393
 
394
-		if ( is_plugin_active( 'tour-operator/tour-operator.php' ) && 'accommodation' === $section ) {
394
+		if (is_plugin_active('tour-operator/tour-operator.php') && 'accommodation' === $section) {
395 395
 			$cmb->add_field(
396 396
 				array(
397
-					'name'    => esc_html__( 'Results Layout - list vs map', 'lsx-search' ),
398
-					'id'      => $section . '_search_results_layout',
397
+					'name'    => esc_html__('Results Layout - list vs map', 'lsx-search'),
398
+					'id'      => $section.'_search_results_layout',
399 399
 					'type'    => 'select',
400 400
 					'options' => array(
401
-						'list_map'    => esc_html__( 'List and Map', 'lsx-search' ),
402
-						'list'        => esc_html__( 'List only', 'lsx-search' ),
401
+						'list_map'    => esc_html__('List and Map', 'lsx-search'),
402
+						'list'        => esc_html__('List only', 'lsx-search'),
403 403
 					),
404 404
 					'default' => '',
405 405
 				)
@@ -408,51 +408,51 @@  discard block
 block discarded – undo
408 408
 
409 409
 		$cmb->add_field(
410 410
 			array(
411
-				'name'        => esc_html__( 'Enable Collapse', 'lsx-search' ),
412
-				'id'          => $section . '_search_collapse',
411
+				'name'        => esc_html__('Enable Collapse', 'lsx-search'),
412
+				'id'          => $section.'_search_collapse',
413 413
 				'type'        => 'checkbox',
414
-				'description' => __( 'Enable collapsible filters on search results', 'lsx-search' ),
414
+				'description' => __('Enable collapsible filters on search results', 'lsx-search'),
415 415
 			)
416 416
 		);
417 417
 
418 418
 		$cmb->add_field(
419 419
 			array(
420
-				'name' => esc_html__( 'Disable Sorting', 'lsx-search' ),
421
-				'id'   => $section . '_search_disable_sorting',
420
+				'name' => esc_html__('Disable Sorting', 'lsx-search'),
421
+				'id'   => $section.'_search_disable_sorting',
422 422
 				'type' => 'checkbox',
423 423
 			)
424 424
 		);
425 425
 
426 426
 		$cmb->add_field(
427 427
 			array(
428
-				'name' => esc_html__( 'Disable the Date Option', 'lsx-search' ),
429
-				'id'   => $section . '_search_disable_date',
428
+				'name' => esc_html__('Disable the Date Option', 'lsx-search'),
429
+				'id'   => $section.'_search_disable_date',
430 430
 				'type' => 'checkbox',
431 431
 			)
432 432
 		);
433 433
 
434 434
 		$cmb->add_field(
435 435
 			array(
436
-				'name' => esc_html__( 'Display Clear Button', 'lsx-search' ),
437
-				'id'   => $section . '_search_display_clear_button',
436
+				'name' => esc_html__('Display Clear Button', 'lsx-search'),
437
+				'id'   => $section.'_search_display_clear_button',
438 438
 				'type' => 'checkbox',
439
-				'description' => __( 'Toggle the clear results button.', 'lsx-search' ),
439
+				'description' => __('Toggle the clear results button.', 'lsx-search'),
440 440
 			)
441 441
 		);
442 442
 
443 443
 		$cmb->add_field(
444 444
 			array(
445
-				'name' => esc_html__( 'Display Result Count', 'lsx-search' ),
446
-				'id'   => $section . '_search_display_result_count',
445
+				'name' => esc_html__('Display Result Count', 'lsx-search'),
446
+				'id'   => $section.'_search_display_result_count',
447 447
 				'type' => 'checkbox',
448 448
 			)
449 449
 		);
450
-		if ( is_plugin_active( 'facetwp-alpha/index.php' ) ) {
450
+		if (is_plugin_active('facetwp-alpha/index.php')) {
451 451
 			$cmb->add_field(
452 452
 				array(
453
-					'name'        => esc_html__( 'Alphabet Facet', 'lsx-search' ),
454
-					'description' => esc_html__( 'Select the alphabetical sorter facet.', 'lsx-search' ),
455
-					'id'          => $section . '_search_az_pagination',
453
+					'name'        => esc_html__('Alphabet Facet', 'lsx-search'),
454
+					'description' => esc_html__('Select the alphabetical sorter facet.', 'lsx-search'),
455
+					'id'          => $section.'_search_az_pagination',
456 456
 					'type'        => 'select',
457 457
 					'options'     => $this->az_facets,
458 458
 				)
@@ -460,17 +460,17 @@  discard block
 block discarded – undo
460 460
 		}
461 461
 		$cmb->add_field(
462 462
 			array(
463
-				'name'        => esc_html__( 'Facets', 'lsx-search' ),
464
-				'description' => esc_html__( 'Choose the filters to display in the sidebar. Edit FacetWP filters to change individual filters.', 'lsx-search' ),
465
-				'id'          => $section . '_search_facets',
463
+				'name'        => esc_html__('Facets', 'lsx-search'),
464
+				'description' => esc_html__('Choose the filters to display in the sidebar. Edit FacetWP filters to change individual filters.', 'lsx-search'),
465
+				'id'          => $section.'_search_facets',
466 466
 				'type'        => 'multicheck',
467 467
 				'options'     => $this->facet_data,
468 468
 			)
469 469
 		);
470
-		do_action( 'lsx_search_settings_section', $cmb, 'bottom' );
470
+		do_action('lsx_search_settings_section', $cmb, 'bottom');
471 471
 		$cmb->add_field(
472 472
 			array(
473
-				'id'   => 'settings_' . $section . '_search_closing',
473
+				'id'   => 'settings_'.$section.'_search_closing',
474 474
 				'type' => 'tab_closing',
475 475
 			)
476 476
 		);
@@ -479,20 +479,20 @@  discard block
 block discarded – undo
479 479
 	/**
480 480
 	 * Handle body colours that might be change by LSX Customiser.
481 481
 	 */
482
-	public function customizer_body_colours_handler( $css, $colors ) {
482
+	public function customizer_body_colours_handler($css, $colors) {
483 483
 		$css .= '
484
-			@import "' . LSX_SEARCH_PATH . '/assets/css/scss/customizer-search-body-colours";
484
+			@import "' . LSX_SEARCH_PATH.'/assets/css/scss/customizer-search-body-colours";
485 485
 
486 486
 			/**
487 487
 			 * LSX Customizer - Body (LSX Search)
488 488
 			 */
489 489
 			@include customizer-search-body-colours (
490
-				$bg: 		' . $colors['background_color'] . ',
491
-				$breaker: 	' . $colors['body_line_color'] . ',
492
-				$color:    	' . $colors['body_text_color'] . ',
493
-				$link:    	' . $colors['body_link_color'] . ',
494
-				$hover:    	' . $colors['body_link_hover_color'] . ',
495
-				$small:    	' . $colors['body_text_small_color'] . '
490
+				$bg: 		' . $colors['background_color'].',
491
+				$breaker: 	' . $colors['body_line_color'].',
492
+				$color:    	' . $colors['body_text_color'].',
493
+				$link:    	' . $colors['body_link_color'].',
494
+				$hover:    	' . $colors['body_link_hover_color'].',
495
+				$small:    	' . $colors['body_text_small_color'].'
496 496
 			);
497 497
 		';
498 498
 
@@ -506,14 +506,14 @@  discard block
 block discarded – undo
506 506
 	 * @param array $colours
507 507
 	 * @return string
508 508
 	 */
509
-	public function customizer_button_colours( $css, $colours ) {
509
+	public function customizer_button_colours($css, $colours) {
510 510
 		$css .= '
511 511
 			#secondary.facetwp-sidebar {
512 512
 				.facetwp-item.facetwp-form {
513 513
 					.search-form {
514 514
 						.btn {
515 515
 							&.search-submit {
516
-								@include lsx-button-colour(' . $colours['button_text_color'] . ', ' . $colours['button_text_color_hover'] . ', ' . $colours['button_background_color'] . ', ' . $colours['button_background_hover_color'] . ', ' . $colours['button_shadow'] . ');
516
+								@include lsx-button-colour(' . $colours['button_text_color'].', '.$colours['button_text_color_hover'].', '.$colours['button_background_color'].', '.$colours['button_background_hover_color'].', '.$colours['button_shadow'].');
517 517
 							}
518 518
 						}
519 519
 					}
Please login to merge, or discard this patch.