@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | * @subpackage template-tag |
14 | 14 | * @category content |
15 | 15 | */ |
16 | -function lsx_vehicle_content( $slug, $name = null ) { |
|
17 | - do_action( 'lsx_vehicle_content', $slug, $name ); |
|
16 | +function lsx_vehicle_content($slug, $name = null) { |
|
17 | + do_action('lsx_vehicle_content', $slug, $name); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /* ================ VEHICLES =========================== */ |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | * @subpackage template-tags |
31 | 31 | * @category vehicle |
32 | 32 | */ |
33 | -function lsx_vehicle_code( $before = '', $after = '', $echo = true ) { |
|
34 | - lsx_to_custom_field_query( 'code', $before, $after, $echo ); |
|
33 | +function lsx_vehicle_code($before = '', $after = '', $echo = true) { |
|
34 | + lsx_to_custom_field_query('code', $before, $after, $echo); |
|
35 | 35 | } |
36 | 36 | /** |
37 | 37 | * Outputs the current vehicles vehicle_type. |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | * @subpackage template-tags |
46 | 46 | * @category vehicle |
47 | 47 | */ |
48 | -function lsx_vehicle_type( $before = '', $after = '', $echo = true ) { |
|
49 | - lsx_to_custom_field_query( 'vehicle_type', $before, $after, $echo ); |
|
48 | +function lsx_vehicle_type($before = '', $after = '', $echo = true) { |
|
49 | + lsx_to_custom_field_query('vehicle_type', $before, $after, $echo); |
|
50 | 50 | } |
51 | 51 | /** |
52 | 52 | * Outputs the current vehicles price. |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | * @subpackage template-tags |
61 | 61 | * @category vehicle |
62 | 62 | */ |
63 | -function lsx_vehicle_price( $before = '', $after = '', $echo = true ) { |
|
64 | - lsx_to_custom_field_query( 'price', $before, $after, $echo ); |
|
63 | +function lsx_vehicle_price($before = '', $after = '', $echo = true) { |
|
64 | + lsx_to_custom_field_query('price', $before, $after, $echo); |
|
65 | 65 | } |
66 | 66 | /** |
67 | 67 | * Outputs the current vehicles engine_type. |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | * @subpackage template-tags |
76 | 76 | * @category vehicle |
77 | 77 | */ |
78 | -function lsx_vehicle_engine_type( $before = '', $after = '', $echo = true ) { |
|
79 | - lsx_to_custom_field_query( 'engine_type', $before, $after, $echo ); |
|
78 | +function lsx_vehicle_engine_type($before = '', $after = '', $echo = true) { |
|
79 | + lsx_to_custom_field_query('engine_type', $before, $after, $echo); |
|
80 | 80 | } |
81 | 81 | /** |
82 | 82 | * Outputs the current vehicles gearbox. |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | * @subpackage template-tags |
91 | 91 | * @category vehicle |
92 | 92 | */ |
93 | -function lsx_vehicle_gearbox( $before = '', $after = '', $echo = true ) { |
|
94 | - lsx_to_custom_field_query( 'gearbox', $before, $after, $echo ); |
|
93 | +function lsx_vehicle_gearbox($before = '', $after = '', $echo = true) { |
|
94 | + lsx_to_custom_field_query('gearbox', $before, $after, $echo); |
|
95 | 95 | } |
96 | 96 | /** |
97 | 97 | * Outputs the current vehicles engine_size. |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | * @subpackage template-tags |
106 | 106 | * @category vehicle |
107 | 107 | */ |
108 | -function lsx_vehicle_engine_size( $before = '', $after = '', $echo = true ) { |
|
109 | - lsx_to_custom_field_query( 'engine_size', $before, $after, $echo ); |
|
108 | +function lsx_vehicle_engine_size($before = '', $after = '', $echo = true) { |
|
109 | + lsx_to_custom_field_query('engine_size', $before, $after, $echo); |
|
110 | 110 | } |
111 | 111 | /** |
112 | 112 | * Outputs the current vehicles gears. |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | * @subpackage template-tags |
121 | 121 | * @category vehicle |
122 | 122 | */ |
123 | -function lsx_vehicle_gears( $before = '', $after = '', $echo = true ) { |
|
124 | - lsx_to_custom_field_query( 'gears', $before, $after, $echo ); |
|
123 | +function lsx_vehicle_gears($before = '', $after = '', $echo = true) { |
|
124 | + lsx_to_custom_field_query('gears', $before, $after, $echo); |
|
125 | 125 | } |
126 | 126 | /** |
127 | 127 | * Outputs the current vehicles seating. |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | * @subpackage template-tags |
136 | 136 | * @category vehicle |
137 | 137 | */ |
138 | -function lsx_vehicle_seating( $before = '', $after = '', $echo = true ) { |
|
139 | - lsx_to_custom_field_query( 'seating', $before, $after, $echo ); |
|
138 | +function lsx_vehicle_seating($before = '', $after = '', $echo = true) { |
|
139 | + lsx_to_custom_field_query('seating', $before, $after, $echo); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * @category vehicle |
149 | 149 | */ |
150 | 150 | function lsx_has_vehicle_features() { |
151 | - return lsx_to_has_custom_field_query( 'features', get_the_ID() ); |
|
151 | + return lsx_to_has_custom_field_query('features', get_the_ID()); |
|
152 | 152 | } |
153 | 153 | /** |
154 | 154 | * Outputs the Vehicles Custom Fields on the Single Vehicle Templates |
@@ -158,19 +158,19 @@ discard block |
||
158 | 158 | * @category vehicle |
159 | 159 | */ |
160 | 160 | function lsx_vehicle_features() { |
161 | - if ( is_singular( 'vehicle' ) ) { |
|
162 | - $features = lsx_to_custom_field_query( 'features', '', '', false ); |
|
163 | - if ( null !== $features ) { ?> |
|
161 | + if (is_singular('vehicle')) { |
|
162 | + $features = lsx_to_custom_field_query('features', '', '', false); |
|
163 | + if (null !== $features) { ?> |
|
164 | 164 | <section id="features"> |
165 | 165 | <div class="row"> |
166 | - <?php if ( null !== $features ) { ?> |
|
166 | + <?php if (null !== $features) { ?> |
|
167 | 167 | <div class=" col-sm-12"> |
168 | - <h3 class="section-title"><?php esc_html_e( 'Features', 'to-vehicles' ); ?></h3> |
|
168 | + <h3 class="section-title"><?php esc_html_e('Features', 'to-vehicles'); ?></h3> |
|
169 | 169 | <div class="entry-content"> |
170 | 170 | <?php |
171 | - $the_feature = apply_filters( 'the_content', $features ); |
|
171 | + $the_feature = apply_filters('the_content', $features); |
|
172 | 172 | ?> |
173 | - <?php echo wp_kses_post( $the_feature ); ?> |
|
173 | + <?php echo wp_kses_post($the_feature); ?> |
|
174 | 174 | </div> |
175 | 175 | </div> |
176 | 176 | <?php } ?> |
@@ -190,15 +190,15 @@ discard block |
||
190 | 190 | */ |
191 | 191 | function lsx_vehicle_accommodation() { |
192 | 192 | global $lsx_archive; |
193 | - if ( post_type_exists( 'accommodation' ) && is_singular( 'vehicle' ) ) { |
|
193 | + if (post_type_exists('accommodation') && is_singular('vehicle')) { |
|
194 | 194 | $args = array( |
195 | 195 | 'from' => 'accommodation', |
196 | 196 | 'to' => 'vehicle', |
197 | 197 | 'column' => '3', |
198 | - 'before' => '<section id="accommodation"><h2 class="section-title">' . lsx_to_get_post_type_section_title( 'accommodation', '', 'Featured Accommodations' ) . '</h2>', |
|
198 | + 'before' => '<section id="accommodation"><h2 class="section-title">' . lsx_to_get_post_type_section_title('accommodation', '', 'Featured Accommodations') . '</h2>', |
|
199 | 199 | 'after' => '</section>', |
200 | 200 | ); |
201 | - lsx_to_connected_panel_query( $args ); |
|
201 | + lsx_to_connected_panel_query($args); |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | |
@@ -212,16 +212,16 @@ discard block |
||
212 | 212 | function lsx_to_destination_vehicles() { |
213 | 213 | global $lsx_archive; |
214 | 214 | |
215 | - if ( post_type_exists( 'vehicle' ) && is_singular( 'destination' ) ) { |
|
215 | + if (post_type_exists('vehicle') && is_singular('destination')) { |
|
216 | 216 | $args = array( |
217 | 217 | 'from' => 'vehicle', |
218 | 218 | 'to' => 'destination', |
219 | 219 | 'column' => '3', |
220 | - 'before' => '<section id="vehicle" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-special">' . lsx_to_get_post_type_section_title( 'vehicle', '', __( 'Featured Vehicles', 'to-vehicles' ) ) . '</h2><div id="collapse-vehicle" class="collapse in"><div class="collapse-inner">', |
|
220 | + 'before' => '<section id="vehicle" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-special">' . lsx_to_get_post_type_section_title('vehicle', '', __('Featured Vehicles', 'to-vehicles')) . '</h2><div id="collapse-vehicle" class="collapse in"><div class="collapse-inner">', |
|
221 | 221 | 'after' => '</div></div></section>', |
222 | 222 | ); |
223 | 223 | |
224 | - lsx_to_connected_panel_query( $args ); |
|
224 | + lsx_to_connected_panel_query($args); |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
@@ -234,14 +234,14 @@ discard block |
||
234 | 234 | */ |
235 | 235 | function lsx_vehicle_tours() { |
236 | 236 | global $lsx_archive; |
237 | - if ( post_type_exists( 'tour' ) && is_singular( 'vehicle' ) ) { |
|
237 | + if (post_type_exists('tour') && is_singular('vehicle')) { |
|
238 | 238 | $args = array( |
239 | 239 | 'from' => 'tour', |
240 | 240 | 'to' => 'vehicle', |
241 | 241 | 'column' => '3', |
242 | - 'before' => '<section id="tours"><h2 class="section-title">' . lsx_to_get_post_type_section_title( 'tour', '', 'Featured Tours' ) . '</h2>', |
|
242 | + 'before' => '<section id="tours"><h2 class="section-title">' . lsx_to_get_post_type_section_title('tour', '', 'Featured Tours') . '</h2>', |
|
243 | 243 | 'after' => '</section>', |
244 | 244 | ); |
245 | - lsx_to_connected_panel_query( $args ); |
|
245 | + lsx_to_connected_panel_query($args); |
|
246 | 246 | } |
247 | 247 | } |
@@ -1,28 +1,28 @@ discard block |
||
1 | 1 | <div class="uix-field-wrapper"> |
2 | 2 | |
3 | 3 | <ul class="ui-tab-nav"> |
4 | - <li><a href="#ui-general" class="active"><?php esc_html_e( 'General', 'tour-operator' ); ?></a></li> |
|
5 | - <?php if ( class_exists( 'LSX_TO_Search' ) ) { ?> |
|
6 | - <li><a href="#ui-search"><?php esc_html_e( 'Search', 'tour-operator' ); ?></a></li> |
|
4 | + <li><a href="#ui-general" class="active"><?php esc_html_e('General', 'tour-operator'); ?></a></li> |
|
5 | + <?php if (class_exists('LSX_TO_Search')) { ?> |
|
6 | + <li><a href="#ui-search"><?php esc_html_e('Search', 'tour-operator'); ?></a></li> |
|
7 | 7 | <?php } ?> |
8 | - <li><a href="#ui-placeholders"><?php esc_html_e( 'Placeholders', 'tour-operator' ); ?></a></li> |
|
9 | - <li><a href="#ui-archives"><?php esc_html_e( 'Archives', 'tour-operator' ); ?></a></li> |
|
10 | - <li><a href="#ui-single"><?php esc_html_e( 'Single', 'tour-operator' ); ?></a></li> |
|
8 | + <li><a href="#ui-placeholders"><?php esc_html_e('Placeholders', 'tour-operator'); ?></a></li> |
|
9 | + <li><a href="#ui-archives"><?php esc_html_e('Archives', 'tour-operator'); ?></a></li> |
|
10 | + <li><a href="#ui-single"><?php esc_html_e('Single', 'tour-operator'); ?></a></li> |
|
11 | 11 | </ul> |
12 | 12 | |
13 | 13 | <div id="ui-general" class="ui-tab active"> |
14 | 14 | <table class="form-table"> |
15 | 15 | <tbody> |
16 | - <?php do_action( 'lsx_to_framework_vehicle_tab_content', 'vehicle', 'general' ); ?> |
|
16 | + <?php do_action('lsx_to_framework_vehicle_tab_content', 'vehicle', 'general'); ?> |
|
17 | 17 | </tbody> |
18 | 18 | </table> |
19 | 19 | </div> |
20 | 20 | |
21 | - <?php if ( class_exists( 'LSX_TO_Search' ) ) { ?> |
|
21 | + <?php if (class_exists('LSX_TO_Search')) { ?> |
|
22 | 22 | <div id="ui-search" class="ui-tab"> |
23 | 23 | <table class="form-table"> |
24 | 24 | <tbody> |
25 | - <?php do_action( 'lsx_to_framework_vehicle_tab_content', 'vehicle', 'search' ); ?> |
|
25 | + <?php do_action('lsx_to_framework_vehicle_tab_content', 'vehicle', 'search'); ?> |
|
26 | 26 | </tbody> |
27 | 27 | </table> |
28 | 28 | </div> |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | <div id="ui-placeholders" class="ui-tab"> |
32 | 32 | <table class="form-table"> |
33 | 33 | <tbody> |
34 | - <?php do_action( 'lsx_to_framework_vehicle_tab_content', 'vehicle', 'placeholders' ); ?> |
|
34 | + <?php do_action('lsx_to_framework_vehicle_tab_content', 'vehicle', 'placeholders'); ?> |
|
35 | 35 | </tbody> |
36 | 36 | </table> |
37 | 37 | </div> |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | <div id="ui-archives" class="ui-tab"> |
40 | 40 | <table class="form-table"> |
41 | 41 | <tbody> |
42 | - <?php do_action( 'lsx_to_framework_vehicle_tab_content', 'vehicle', 'archives' ); ?> |
|
42 | + <?php do_action('lsx_to_framework_vehicle_tab_content', 'vehicle', 'archives'); ?> |
|
43 | 43 | </tbody> |
44 | 44 | </table> |
45 | 45 | </div> |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | <div id="ui-single" class="ui-tab"> |
48 | 48 | <table class="form-table"> |
49 | 49 | <tbody> |
50 | - <?php do_action( 'lsx_to_framework_vehicle_tab_content', 'vehicle', 'single' ); ?> |
|
50 | + <?php do_action('lsx_to_framework_vehicle_tab_content', 'vehicle', 'single'); ?> |
|
51 | 51 | </tbody> |
52 | 52 | </table> |
53 | 53 | </div> |
54 | - <?php do_action( 'lsx_to_framework_vehicle_tab_bottom', 'vehicle' ); ?> |
|
54 | + <?php do_action('lsx_to_framework_vehicle_tab_bottom', 'vehicle'); ?> |
|
55 | 55 | </div> |
@@ -13,14 +13,14 @@ |
||
13 | 13 | */ |
14 | 14 | |
15 | 15 | // If this file is called directly, abort. |
16 | -if ( ! defined( 'WPINC' ) ) { |
|
16 | +if ( ! defined('WPINC')) { |
|
17 | 17 | die; |
18 | 18 | } |
19 | 19 | |
20 | -define( 'LSX_TO_VEHICLES_PATH', plugin_dir_path( __FILE__ ) ); |
|
21 | -define( 'LSX_TO_VEHICLES_CORE', __FILE__ ); |
|
22 | -define( 'LSX_TO_VEHICLES_URL', plugin_dir_url( __FILE__ ) ); |
|
23 | -define( 'LSX_TO_VEHICLES_VER', '1.0.5' ); |
|
20 | +define('LSX_TO_VEHICLES_PATH', plugin_dir_path(__FILE__)); |
|
21 | +define('LSX_TO_VEHICLES_CORE', __FILE__); |
|
22 | +define('LSX_TO_VEHICLES_URL', plugin_dir_url(__FILE__)); |
|
23 | +define('LSX_TO_VEHICLES_VER', '1.0.5'); |
|
24 | 24 | |
25 | 25 | /* ======================= Below is the Plugin Class init ========================= */ |
26 | 26 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | <?php lsx_content_wrap_before(); ?> |
12 | 12 | |
13 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
13 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
14 | 14 | |
15 | 15 | <?php lsx_content_before(); ?> |
16 | 16 | |
@@ -18,15 +18,15 @@ discard block |
||
18 | 18 | |
19 | 19 | <?php lsx_content_top(); ?> |
20 | 20 | |
21 | - <?php while ( have_posts() ) : the_post(); ?> |
|
21 | + <?php while (have_posts()) : the_post(); ?> |
|
22 | 22 | |
23 | - <section id="summary" class="lsx-to-section <?php lsx_to_collapsible_class( 'vehicle', false ); ?>"> |
|
24 | - <h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title hidden-lg" data-toggle="collapse" data-target="#collapse-summary"><?php esc_html_e( 'Summary', 'lsx-vehicles' ); ?></h2> |
|
23 | + <section id="summary" class="lsx-to-section <?php lsx_to_collapsible_class('vehicle', false); ?>"> |
|
24 | + <h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title hidden-lg" data-toggle="collapse" data-target="#collapse-summary"><?php esc_html_e('Summary', 'lsx-vehicles'); ?></h2> |
|
25 | 25 | |
26 | 26 | <div id="collapse-summary" class="collapse in"> |
27 | 27 | <div class="collapse-inner"> |
28 | 28 | <div class="row"> |
29 | - <?php lsx_vehicle_content( 'content', 'vehicle' ); ?> |
|
29 | + <?php lsx_vehicle_content('content', 'vehicle'); ?> |
|
30 | 30 | </div> |
31 | 31 | </div> |
32 | 32 | </div> |
@@ -45,6 +45,6 @@ discard block |
||
45 | 45 | <?php lsx_content_wrap_after(); ?> |
46 | 46 | |
47 | 47 | <?php get_sidebar(); ?> |
48 | -<?php get_sidebar( 'alt' ); ?> |
|
48 | +<?php get_sidebar('alt'); ?> |
|
49 | 49 | |
50 | 50 | <?php get_footer(); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | <?php lsx_content_wrap_before(); ?> |
12 | 12 | |
13 | - <section id="primary" class="content-area <?php echo esc_html( lsx_main_class() ); ?>"> |
|
13 | + <section id="primary" class="content-area <?php echo esc_html(lsx_main_class()); ?>"> |
|
14 | 14 | |
15 | 15 | <?php lsx_content_before(); ?> |
16 | 16 | |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | |
19 | 19 | <?php lsx_content_top(); ?> |
20 | 20 | |
21 | - <?php if ( have_posts() ) : ?> |
|
21 | + <?php if (have_posts()) : ?> |
|
22 | 22 | |
23 | 23 | <div class="row lsx-to-archive-items lsx-to-archive-template-grid lsx-to-archive-template-image-max-height"> |
24 | - <?php while ( have_posts() ) : the_post(); ?> |
|
25 | - <div class="lsx-to-archive-item col-xs-12 col-sm-6 col-md-4 <?php echo esc_attr( lsx_to_archive_class( 'lsx-to-archive-item' ) ); ?>"> |
|
26 | - <?php lsx_vehicle_content( 'content', 'vehicle' ); ?> |
|
24 | + <?php while (have_posts()) : the_post(); ?> |
|
25 | + <div class="lsx-to-archive-item col-xs-12 col-sm-6 col-md-4 <?php echo esc_attr(lsx_to_archive_class('lsx-to-archive-item')); ?>"> |
|
26 | + <?php lsx_vehicle_content('content', 'vehicle'); ?> |
|
27 | 27 | </div> |
28 | 28 | <?php endwhile; ?> |
29 | 29 | </div> |
@@ -31,13 +31,13 @@ discard block |
||
31 | 31 | |
32 | 32 | <?php else : ?> |
33 | 33 | |
34 | - <?php get_template_part( 'content', 'none' ); ?> |
|
34 | + <?php get_template_part('content', 'none'); ?> |
|
35 | 35 | |
36 | 36 | <?php endif; ?> |
37 | 37 | |
38 | 38 | <div class="lsx-full-width vehicles-bottom text-center"> |
39 | - <h2><?php esc_html_e( 'See our vehicles in action in our gallery', 'to-vehicles' ); ?></h2> |
|
40 | - <a href="/vehicles/" class="btn border-btn"><?php esc_html_e( 'See Gallery', 'to-vehicles' ); ?></a> |
|
39 | + <h2><?php esc_html_e('See our vehicles in action in our gallery', 'to-vehicles'); ?></h2> |
|
40 | + <a href="/vehicles/" class="btn border-btn"><?php esc_html_e('See Gallery', 'to-vehicles'); ?></a> |
|
41 | 41 | </div> |
42 | 42 | |
43 | 43 | <?php lsx_content_bottom(); ?> |
@@ -29,9 +29,12 @@ |
||
29 | 29 | </div> |
30 | 30 | <?php lsx_paging_nav(); ?> |
31 | 31 | |
32 | - <?php else : ?> |
|
32 | + <?php else { |
|
33 | + : ?> |
|
33 | 34 | |
34 | - <?php get_template_part( 'content', 'none' ); ?> |
|
35 | + <?php get_template_part( 'content', 'none' ); |
|
36 | +} |
|
37 | +?> |
|
35 | 38 | |
36 | 39 | <?php endif; ?> |
37 | 40 |
@@ -11,22 +11,22 @@ discard block |
||
11 | 11 | $has_single = ! lsx_to_is_single_disabled(); |
12 | 12 | $permalink = ''; |
13 | 13 | |
14 | -if ( $has_single ) { |
|
14 | +if ($has_single) { |
|
15 | 15 | $permalink = get_the_permalink(); |
16 | -} elseif ( ! is_post_type_archive( 'vehicle' ) ) { |
|
16 | +} elseif ( ! is_post_type_archive('vehicle')) { |
|
17 | 17 | $has_single = true; |
18 | - $permalink = get_post_type_archive_link( 'vehicle' ) . '#vehicle-' . $post->post_name; |
|
18 | + $permalink = get_post_type_archive_link('vehicle') . '#vehicle-' . $post->post_name; |
|
19 | 19 | } |
20 | 20 | ?> |
21 | 21 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
22 | 22 | |
23 | 23 | <?php lsx_widget_entry_top(); ?> |
24 | 24 | |
25 | - <?php if ( empty( $disable_placeholder ) ) { ?> |
|
25 | + <?php if (empty($disable_placeholder)) { ?> |
|
26 | 26 | <div class="lsx-to-widget-thumb"> |
27 | - <?php if ( $has_single ) { ?><a href="<?php echo esc_url( $permalink ); ?>"><?php } ?> |
|
28 | - <?php lsx_thumbnail( 'lsx-thumbnail-single' ); ?> |
|
29 | - <?php if ( $has_single ) { ?></a><?php } ?> |
|
27 | + <?php if ($has_single) { ?><a href="<?php echo esc_url($permalink); ?>"><?php } ?> |
|
28 | + <?php lsx_thumbnail('lsx-thumbnail-single'); ?> |
|
29 | + <?php if ($has_single) { ?></a><?php } ?> |
|
30 | 30 | </div> |
31 | 31 | <?php } ?> |
32 | 32 | |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | <?php lsx_widget_entry_content_top(); ?> |
35 | 35 | |
36 | 36 | <h4 class="lsx-to-widget-title text-center"> |
37 | - <?php if ( false !== $has_single ) { ?> |
|
38 | - <a href="<?php echo esc_url( $permalink ); ?>"><?php } ?> |
|
37 | + <?php if (false !== $has_single) { ?> |
|
38 | + <a href="<?php echo esc_url($permalink); ?>"><?php } ?> |
|
39 | 39 | <?php the_title(); ?> |
40 | - <?php if ( false !== $has_single ) { ?> |
|
40 | + <?php if (false !== $has_single) { ?> |
|
41 | 41 | </a> |
42 | 42 | <?php } ?> |
43 | 43 | </h4> |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | <?php |
47 | 47 | $meta_class = 'lsx-to-meta-data lsx-to-meta-data-'; |
48 | 48 | ?> |
49 | - <?php if ( false !== get_post_meta( get_the_ID(), 'vehicle_type', true ) ) { ?> |
|
50 | - <div <?php echo 'class="' . esc_html( $meta_class ) . 'type"'; ?>><span class="lsx-to-meta-data-key"><?php esc_html_e( 'Type', 'to-vehicles' ); ?>:</span> <?php echo esc_attr( get_post_meta( get_the_ID(), 'vehicle_type', true ) ); ?></div> |
|
49 | + <?php if (false !== get_post_meta(get_the_ID(), 'vehicle_type', true)) { ?> |
|
50 | + <div <?php echo 'class="' . esc_html($meta_class) . 'type"'; ?>><span class="lsx-to-meta-data-key"><?php esc_html_e('Type', 'to-vehicles'); ?>:</span> <?php echo esc_attr(get_post_meta(get_the_ID(), 'vehicle_type', true)); ?></div> |
|
51 | 51 | <?php } ?> |
52 | - <?php if ( false !== get_post_meta( get_the_ID(), 'seating', true ) ) { ?> |
|
53 | - <div <?php echo 'class="' . esc_html( $meta_class ) . 'seating"'; ?>><span class="lsx-to-meta-data-key"><?php esc_html_e( 'Seats', 'to-vehicles' ); ?>:</span> <?php echo esc_attr( get_post_meta( get_the_ID(), 'seating', true ) ); ?></div> |
|
52 | + <?php if (false !== get_post_meta(get_the_ID(), 'seating', true)) { ?> |
|
53 | + <div <?php echo 'class="' . esc_html($meta_class) . 'seating"'; ?>><span class="lsx-to-meta-data-key"><?php esc_html_e('Seats', 'to-vehicles'); ?>:</span> <?php echo esc_attr(get_post_meta(get_the_ID(), 'seating', true)); ?></div> |
|
54 | 54 | <?php } ?> |
55 | - <?php if ( false !== get_post_meta( get_the_ID(), 'price', true ) ) { ?> |
|
56 | - <div <?php echo 'class="' . esc_html( $meta_class ) . 'price"'; ?>><span class="lsx-to-meta-data-key"><?php esc_html_e( 'Price Guide', 'to-vehicles' ); ?>:</span> <?php echo esc_attr( get_post_meta( get_the_ID(), 'price', true ) ); ?></div> |
|
55 | + <?php if (false !== get_post_meta(get_the_ID(), 'price', true)) { ?> |
|
56 | + <div <?php echo 'class="' . esc_html($meta_class) . 'price"'; ?>><span class="lsx-to-meta-data-key"><?php esc_html_e('Price Guide', 'to-vehicles'); ?>:</span> <?php echo esc_attr(get_post_meta(get_the_ID(), 'price', true)); ?></div> |
|
57 | 57 | <?php } ?> |
58 | 58 | </div> |
59 | 59 | <?php |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | lsx_to_widget_entry_content_bottom(); |
64 | 64 | $excerpt = ob_get_clean(); |
65 | 65 | |
66 | - if ( empty( $disable_text ) && ! empty( $excerpt ) ) { |
|
67 | - echo wp_kses_post( $excerpt ); |
|
68 | - } elseif ( $has_single ) { ?> |
|
69 | - <p><a href="<?php echo esc_url( $permalink ); ?>" class="moretag"><?php esc_html_e( 'View more', 'tour-operator' ); ?></a></p> |
|
66 | + if (empty($disable_text) && ! empty($excerpt)) { |
|
67 | + echo wp_kses_post($excerpt); |
|
68 | + } elseif ($has_single) { ?> |
|
69 | + <p><a href="<?php echo esc_url($permalink); ?>" class="moretag"><?php esc_html_e('View more', 'tour-operator'); ?></a></p> |
|
70 | 70 | <?php |
71 | 71 | } |
72 | 72 | ?> |
@@ -8,48 +8,48 @@ discard block |
||
8 | 8 | |
9 | 9 | global $lsx_archive, $lsx_to_archive, $post; |
10 | 10 | |
11 | -if ( 1 !== $lsx_archive ) { |
|
11 | +if (1 !== $lsx_archive) { |
|
12 | 12 | $lsx_archive = false; |
13 | 13 | } |
14 | 14 | ?> |
15 | 15 | |
16 | 16 | <?php lsx_entry_before(); ?> |
17 | 17 | |
18 | - <article id="tour-<?php echo esc_attr( $post->post_name ); ?>" <?php post_class( 'lsx-to-archive-container' ); ?>> |
|
18 | + <article id="tour-<?php echo esc_attr($post->post_name); ?>" <?php post_class('lsx-to-archive-container'); ?>> |
|
19 | 19 | |
20 | - <?php if ( is_archive() ) { ?> |
|
20 | + <?php if (is_archive()) { ?> |
|
21 | 21 | <div class="lsx-to-archive-thumb lsx-to-widget-thumb"> |
22 | 22 | <a href="<?php the_permalink(); ?>"> |
23 | - <?php lsx_thumbnail( 'lsx-thumbnail-wide' ); ?> |
|
23 | + <?php lsx_thumbnail('lsx-thumbnail-wide'); ?> |
|
24 | 24 | </a> |
25 | 25 | </div> |
26 | 26 | |
27 | 27 | <div class="lsx-to-archive-wrapper"> |
28 | 28 | <div class="lsx-to-archive-content"> |
29 | 29 | <h3 class="lsx-to-archive-content-title"> |
30 | - <a href="<?php the_permalink(); ?>" title="<?php esc_html_e( 'Read more', 'tour-operator' ); ?>"> |
|
30 | + <a href="<?php the_permalink(); ?>" title="<?php esc_html_e('Read more', 'tour-operator'); ?>"> |
|
31 | 31 | <?php |
32 | 32 | the_title(); |
33 | - do_action( 'lsx_to_the_title_end', get_the_ID() ); |
|
33 | + do_action('lsx_to_the_title_end', get_the_ID()); |
|
34 | 34 | ?> |
35 | 35 | </a> |
36 | 36 | </h3> |
37 | 37 | <!-- .entry-header --> |
38 | 38 | <?php } ?> |
39 | 39 | |
40 | - <div <?php lsx_to_entry_class( 'entry-content' ); ?>> |
|
40 | + <div <?php lsx_to_entry_class('entry-content'); ?>> |
|
41 | 41 | |
42 | - <?php if ( is_single() ) { ?> |
|
43 | - <div <?php lsx_to_entry_class( 'entry-content' ); ?>> |
|
42 | + <?php if (is_single()) { ?> |
|
43 | + <div <?php lsx_to_entry_class('entry-content'); ?>> |
|
44 | 44 | <div class="col-xs-12 col-sm-12 col-md-7"> |
45 | 45 | <div class="lsx-to-summary"> |
46 | 46 | <h2 class="lsx-to-summary-title"><?php the_title(); ?></h2> |
47 | 47 | </div> |
48 | 48 | |
49 | - <?php lsx_to_price( '<p class="lsx-to-meta-data lsx-to-meta-data-big lsx-to-meta-data-price"><span class="lsx-to-meta-data-key">' . esc_html__( 'From price', 'tour-operator' ) . ':</span> ', '</p>' ); ?> |
|
49 | + <?php lsx_to_price('<p class="lsx-to-meta-data lsx-to-meta-data-big lsx-to-meta-data-price"><span class="lsx-to-meta-data-key">' . esc_html__('From price', 'tour-operator') . ':</span> ', '</p>'); ?> |
|
50 | 50 | <?php the_content(); ?> |
51 | 51 | <div class="key-fetures"> |
52 | - <?php lsx_vehicle_features( '<div class="meta features">' . __( 'Features', 'to-vehicles' ) . ': ', '</div>' ); ?> |
|
52 | + <?php lsx_vehicle_features('<div class="meta features">' . __('Features', 'to-vehicles') . ': ', '</div>'); ?> |
|
53 | 53 | </div> |
54 | 54 | <?php lsx_to_sharing(); ?> |
55 | 55 | </div> |
@@ -59,17 +59,17 @@ discard block |
||
59 | 59 | <div class="vehicle-summary"> |
60 | 60 | <div class="lsx-to-archive-thumb lsx-to-widget-thumb"> |
61 | 61 | <a href="<?php the_permalink(); ?>"> |
62 | - <?php the_post_thumbnail( 'full' ); ?> |
|
62 | + <?php the_post_thumbnail('full'); ?> |
|
63 | 63 | </a> |
64 | 64 | </div> |
65 | 65 | <div class="lsx-to-section-inner"> |
66 | - <h3 class="lsx-to-section-title"><?php esc_html_e( 'Vehicle Summary', 'tour-operator' ); ?></h3> |
|
66 | + <h3 class="lsx-to-section-title"><?php esc_html_e('Vehicle Summary', 'tour-operator'); ?></h3> |
|
67 | 67 | <div class="lsx-to-single-meta-data"> |
68 | 68 | <div class="meta taxonomies"> |
69 | 69 | <?php //lsx_vehicle_code( '<div class="meta code">' . __( 'Code', 'to-vehicles' ) . ': ', '</div>' ); ?> |
70 | - <?php lsx_vehicle_type( '<div class="meta vehicle-type"><span class="entry-meta-key">' . __( 'Type', 'to-vehicles' ) . '</span>: ', '</div>' ); ?> |
|
71 | - <?php lsx_vehicle_seating( '<div class="meta seating"><span class="entry-meta-key">' . __( 'Seats', 'to-vehicles' ) . '</span>: ', '</div>' ); ?> |
|
72 | - <?php lsx_vehicle_price( '<div class="meta seating"><span class="entry-meta-key">' . __( 'Price Guide', 'to-vehicles' ) . '</span>: ', '</div>' ); ?> |
|
70 | + <?php lsx_vehicle_type('<div class="meta vehicle-type"><span class="entry-meta-key">' . __('Type', 'to-vehicles') . '</span>: ', '</div>'); ?> |
|
71 | + <?php lsx_vehicle_seating('<div class="meta seating"><span class="entry-meta-key">' . __('Seats', 'to-vehicles') . '</span>: ', '</div>'); ?> |
|
72 | + <?php lsx_vehicle_price('<div class="meta seating"><span class="entry-meta-key">' . __('Price Guide', 'to-vehicles') . '</span>: ', '</div>'); ?> |
|
73 | 73 | <?php //lsx_vehicle_engine_type( '<div class="meta vehicle-type"><span class="entry-meta-key">' . __( 'Engine Type', 'to-vehicles' ) . '</span>: ', '</div>' ); ?> |
74 | 74 | <?php //lsx_vehicle_gearbox( '<div class="meta gearbox"><span class="entry-meta-key">' . __( 'Gearbox', 'to-vehicles' ) . '</span>: ', '</div>' ); ?> |
75 | 75 | <?php //lsx_vehicle_engine_size( '<div class="meta engine-size"><span class="entry-meta-key">' . __( 'Engine-size', 'to-vehicles' ) . '</span>: ', '</div>' ); ?> |
@@ -80,13 +80,13 @@ discard block |
||
80 | 80 | </div> |
81 | 81 | </div> |
82 | 82 | </section> |
83 | - <?php if ( lsx_to_has_enquiry_contact() ) : ?> |
|
83 | + <?php if (lsx_to_has_enquiry_contact()) : ?> |
|
84 | 84 | <div class="lsx-to-contact-widget"> |
85 | 85 | <?php |
86 | - if ( function_exists( 'lsx_to_has_team_member' ) && lsx_to_has_team_member() ) { |
|
87 | - lsx_to_team_member_panel( '<div class="lsx-to-contact">', '</div>' ); |
|
86 | + if (function_exists('lsx_to_has_team_member') && lsx_to_has_team_member()) { |
|
87 | + lsx_to_team_member_panel('<div class="lsx-to-contact">', '</div>'); |
|
88 | 88 | } else { |
89 | - lsx_to_enquiry_contact( '<div class="lsx-to-contact">', '</div>' ); |
|
89 | + lsx_to_enquiry_contact('<div class="lsx-to-contact">', '</div>'); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | lsx_to_enquire_modal(); |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | <?php } else { ?> |
98 | 98 | <div class="lsx-to-archive-meta-data lsx-to-archive-meta-data-grid-mode"> |
99 | 99 | <div class="vehicle-details"> |
100 | - <?php if ( false !== get_post_meta( get_the_ID(), 'type', true ) ) { ?> |
|
101 | - <div class="meta type lsx-to-meta-data lsx-to-meta-data-type"><?php esc_html_e( 'Type', 'to-vehicles' ); ?>: <span><?php echo esc_attr( get_post_meta( get_the_ID(), 'vehicle_type', true ) ); ?></span></div> |
|
100 | + <?php if (false !== get_post_meta(get_the_ID(), 'type', true)) { ?> |
|
101 | + <div class="meta type lsx-to-meta-data lsx-to-meta-data-type"><?php esc_html_e('Type', 'to-vehicles'); ?>: <span><?php echo esc_attr(get_post_meta(get_the_ID(), 'vehicle_type', true)); ?></span></div> |
|
102 | 102 | <?php } ?> |
103 | - <?php if ( false !== get_post_meta( get_the_ID(), 'seating', true ) ) { ?> |
|
104 | - <div class="meta seats lsx-to-meta-data lsx-to-meta-data-seating"><?php esc_html_e( 'Seats', 'to-vehicles' ); ?>: <span><?php echo esc_attr( get_post_meta( get_the_ID(), 'seating', true ) ); ?></span></div> |
|
103 | + <?php if (false !== get_post_meta(get_the_ID(), 'seating', true)) { ?> |
|
104 | + <div class="meta seats lsx-to-meta-data lsx-to-meta-data-seating"><?php esc_html_e('Seats', 'to-vehicles'); ?>: <span><?php echo esc_attr(get_post_meta(get_the_ID(), 'seating', true)); ?></span></div> |
|
105 | 105 | <?php } ?> |
106 | - <?php if ( false !== get_post_meta( get_the_ID(), 'price', true ) ) { ?> |
|
107 | - <div class="meta price lsx-to-meta-data lsx-to-meta-data-price"><?php esc_html_e( 'Price guide', 'to-vehicles' ); ?>: <span><?php echo esc_attr( get_post_meta( get_the_ID(), 'price', true ) ); ?></span></div> |
|
106 | + <?php if (false !== get_post_meta(get_the_ID(), 'price', true)) { ?> |
|
107 | + <div class="meta price lsx-to-meta-data lsx-to-meta-data-price"><?php esc_html_e('Price guide', 'to-vehicles'); ?>: <span><?php echo esc_attr(get_post_meta(get_the_ID(), 'price', true)); ?></span></div> |
|
108 | 108 | <?php } ?> |
109 | 109 | </div> |
110 | 110 | </div> |
@@ -114,10 +114,10 @@ discard block |
||
114 | 114 | <?php } ?> |
115 | 115 | </div><!-- .entry-content --> |
116 | 116 | |
117 | - <?php if ( is_archive() ) { ?> |
|
117 | + <?php if (is_archive()) { ?> |
|
118 | 118 | </div> |
119 | 119 | </div> |
120 | - <?php echo '<a class="moretag" href="' . wp_kses_post( get_permalink() ) . '" title="View more">', 'View More</a>'; ?> |
|
120 | + <?php echo '<a class="moretag" href="' . wp_kses_post(get_permalink()) . '" title="View more">', 'View More</a>'; ?> |
|
121 | 121 | <?php } ?> |
122 | 122 | |
123 | 123 | <?php |
@@ -38,29 +38,29 @@ discard block |
||
38 | 38 | public function __construct() { |
39 | 39 | $this->set_vars(); |
40 | 40 | |
41 | - add_action( 'wp_head', array( $this, 'wp_head' ), 20, 1 ); |
|
41 | + add_action('wp_head', array($this, 'wp_head'), 20, 1); |
|
42 | 42 | |
43 | 43 | //add_filter( 'lsx_to_entry_class', array( $this, 'entry_class' ) ); |
44 | 44 | //add_action( 'init', array( $this, 'init' ) ); |
45 | 45 | |
46 | - if ( ! class_exists( 'LSX_TO_Template_Redirects' ) ) { |
|
47 | - require_once( LSX_TO_VEHICLES_PATH . 'classes/class-lsx-to-template-redirects.php' ); |
|
46 | + if ( ! class_exists('LSX_TO_Template_Redirects')) { |
|
47 | + require_once(LSX_TO_VEHICLES_PATH . 'classes/class-lsx-to-template-redirects.php'); |
|
48 | 48 | } |
49 | - $this->redirects = new LSX_TO_Template_Redirects( LSX_TO_VEHICLES_PATH, array_keys( $this->post_types ) ); |
|
50 | - add_action( 'lsx_vehicle_content', array( $this->redirects, 'content_part' ), 10, 2 ); |
|
49 | + $this->redirects = new LSX_TO_Template_Redirects(LSX_TO_VEHICLES_PATH, array_keys($this->post_types)); |
|
50 | + add_action('lsx_vehicle_content', array($this->redirects, 'content_part'), 10, 2); |
|
51 | 51 | |
52 | - add_filter( 'lsx_to_page_navigation', array( $this, 'page_links' ) ); |
|
52 | + add_filter('lsx_to_page_navigation', array($this, 'page_links')); |
|
53 | 53 | |
54 | 54 | //add_action( 'lsx_entry_top', array( $this, 'archive_entry_top' ), 15 ); |
55 | 55 | //add_action( 'lsx_entry_bottom', array( $this, 'archive_entry_bottom' ) ); |
56 | - add_action( 'lsx_content_bottom', array( $this, 'single_content_bottom' ) ); |
|
56 | + add_action('lsx_content_bottom', array($this, 'single_content_bottom')); |
|
57 | 57 | |
58 | - add_action( 'lsx_banner_allowed_post_types', array( $this, 'theme_allowed_post_type_banners' ) ); |
|
58 | + add_action('lsx_banner_allowed_post_types', array($this, 'theme_allowed_post_type_banners')); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | function wp_head() { |
62 | - if ( is_singular( 'vehicle' ) ) { |
|
63 | - remove_action( 'lsx_entry_bottom', 'lsx_to_single_entry_bottom' ); |
|
62 | + if (is_singular('vehicle')) { |
|
63 | + remove_action('lsx_entry_bottom', 'lsx_to_single_entry_bottom'); |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
@@ -68,19 +68,19 @@ discard block |
||
68 | 68 | * Adds the template tags to the bottom of the single review |
69 | 69 | */ |
70 | 70 | public function single_content_bottom() { |
71 | - if ( is_singular( 'vehicle' ) ) { |
|
71 | + if (is_singular('vehicle')) { |
|
72 | 72 | // lsx_to_review_accommodation(); |
73 | 73 | |
74 | 74 | // lsx_to_review_tour(); |
75 | 75 | |
76 | 76 | // lsx_to_review_destination(); |
77 | 77 | |
78 | - lsx_to_gallery( '<section id="gallery" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-gallery">' . esc_html__( 'Gallery', 'to-reviews' ) . '</h2><div id="collapse-gallery" class="collapse in"><div class="collapse-inner">', '</div></div></section>' ); |
|
78 | + lsx_to_gallery('<section id="gallery" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-gallery">' . esc_html__('Gallery', 'to-reviews') . '</h2><div id="collapse-gallery" class="collapse in"><div class="collapse-inner">', '</div></div></section>'); |
|
79 | 79 | |
80 | - if ( function_exists( 'lsx_to_videos' ) ) { |
|
81 | - lsx_to_videos( '<section id="videos" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-videos">' . esc_html__( 'Videos', 'to-reviews' ) . '</h2><div id="collapse-videos" class="collapse in"><div class="collapse-inner">', '</div></div></section>' ); |
|
82 | - } elseif ( class_exists( 'Envira_Videos' ) ) { |
|
83 | - lsx_to_envira_videos( '<section id="videos" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-videos">' . esc_html__( 'Videos', 'to-reviews' ) . '</h2><div id="collapse-videos" class="collapse in"><div class="collapse-inner">', '</div></div></section>' ); |
|
80 | + if (function_exists('lsx_to_videos')) { |
|
81 | + lsx_to_videos('<section id="videos" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-videos">' . esc_html__('Videos', 'to-reviews') . '</h2><div id="collapse-videos" class="collapse in"><div class="collapse-inner">', '</div></div></section>'); |
|
82 | + } elseif (class_exists('Envira_Videos')) { |
|
83 | + lsx_to_envira_videos('<section id="videos" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-videos">' . esc_html__('Videos', 'to-reviews') . '</h2><div id="collapse-videos" class="collapse in"><div class="collapse-inner">', '</div></div></section>'); |
|
84 | 84 | } //lsx_to_review_posts(); |
85 | 85 | } |
86 | 86 | } |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | * @param $page_links array |
92 | 92 | * @return $page_links array |
93 | 93 | */ |
94 | - public function page_links( $page_links ) { |
|
95 | - if ( is_singular( 'vehicle' ) ) { |
|
94 | + public function page_links($page_links) { |
|
95 | + if (is_singular('vehicle')) { |
|
96 | 96 | $this->page_links = $page_links; |
97 | 97 | $this->get_gallery_link(); |
98 | 98 | $this->get_videos_link(); |
@@ -107,22 +107,22 @@ discard block |
||
107 | 107 | * Tests for the Gallery and returns a link for the section |
108 | 108 | */ |
109 | 109 | public function get_gallery_link() { |
110 | - $gallery_ids = get_post_meta( get_the_ID(), 'gallery', false ); |
|
111 | - $envira_gallery = get_post_meta( get_the_ID(), 'envira_gallery', true ); |
|
110 | + $gallery_ids = get_post_meta(get_the_ID(), 'gallery', false); |
|
111 | + $envira_gallery = get_post_meta(get_the_ID(), 'envira_gallery', true); |
|
112 | 112 | |
113 | - if ( ( ! empty( $gallery_ids ) && is_array( $gallery_ids ) ) || ( function_exists( 'envira_gallery' ) && ! empty( $envira_gallery ) && false === lsx_to_enable_envira_banner() ) ) { |
|
114 | - if ( function_exists( 'envira_gallery' ) && ! empty( $envira_gallery ) && false === lsx_to_enable_envira_banner() ) { |
|
113 | + if (( ! empty($gallery_ids) && is_array($gallery_ids)) || (function_exists('envira_gallery') && ! empty($envira_gallery) && false === lsx_to_enable_envira_banner())) { |
|
114 | + if (function_exists('envira_gallery') && ! empty($envira_gallery) && false === lsx_to_enable_envira_banner()) { |
|
115 | 115 | // Envira Gallery. |
116 | - $this->page_links['gallery'] = esc_html__( 'Gallery', 'to-vehicles' ); |
|
116 | + $this->page_links['gallery'] = esc_html__('Gallery', 'to-vehicles'); |
|
117 | 117 | return; |
118 | 118 | } else { |
119 | - if ( function_exists( 'envira_dynamic' ) ) { |
|
119 | + if (function_exists('envira_dynamic')) { |
|
120 | 120 | // Envira Gallery - Dynamic. |
121 | - $this->page_links['gallery'] = esc_html__( 'Gallery', 'to-vehicles' ); |
|
121 | + $this->page_links['gallery'] = esc_html__('Gallery', 'to-vehicles'); |
|
122 | 122 | return; |
123 | 123 | } else { |
124 | 124 | // WordPress Gallery. |
125 | - $this->page_links['gallery'] = esc_html__( 'Gallery', 'to-vehicles' ); |
|
125 | + $this->page_links['gallery'] = esc_html__('Gallery', 'to-vehicles'); |
|
126 | 126 | return; |
127 | 127 | } |
128 | 128 | } |
@@ -135,16 +135,16 @@ discard block |
||
135 | 135 | public function get_videos_link() { |
136 | 136 | $videos_id = false; |
137 | 137 | |
138 | - if ( class_exists( 'Envira_Videos' ) ) { |
|
139 | - $videos_id = get_post_meta( get_the_ID(), 'envira_video', true ); |
|
138 | + if (class_exists('Envira_Videos')) { |
|
139 | + $videos_id = get_post_meta(get_the_ID(), 'envira_video', true); |
|
140 | 140 | } |
141 | 141 | |
142 | - if ( empty( $videos_id ) && function_exists( 'lsx_to_videos' ) ) { |
|
143 | - $videos_id = get_post_meta( get_the_ID(), 'videos', true ); |
|
142 | + if (empty($videos_id) && function_exists('lsx_to_videos')) { |
|
143 | + $videos_id = get_post_meta(get_the_ID(), 'videos', true); |
|
144 | 144 | } |
145 | 145 | |
146 | - if ( ! empty( $videos_id ) ) { |
|
147 | - $this->page_links['videos'] = esc_html__( 'Videos', 'to-vehicles' ); |
|
146 | + if ( ! empty($videos_id)) { |
|
147 | + $this->page_links['videos'] = esc_html__('Videos', 'to-vehicles'); |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 |
@@ -31,22 +31,22 @@ discard block |
||
31 | 31 | * @param array $post_types an array of the post types to redirect. |
32 | 32 | * @param array $taxonomies an array of the taxonomies to redirect. |
33 | 33 | */ |
34 | - public function __construct( $plugin_path = false, $post_types = false, $taxonomies = false ) { |
|
35 | - if ( false !== $plugin_path ) { |
|
34 | + public function __construct($plugin_path = false, $post_types = false, $taxonomies = false) { |
|
35 | + if (false !== $plugin_path) { |
|
36 | 36 | $this->plugin_path = $plugin_path; |
37 | 37 | |
38 | - add_filter( 'lsx_to_widget_path', array( $this, 'widget_path' ), 10, 2 ); |
|
39 | - add_filter( 'lsx_to_content_path', array( $this, 'content_path' ), 10, 3 ); |
|
38 | + add_filter('lsx_to_widget_path', array($this, 'widget_path'), 10, 2); |
|
39 | + add_filter('lsx_to_content_path', array($this, 'content_path'), 10, 3); |
|
40 | 40 | |
41 | - if ( false !== $post_types ) { |
|
41 | + if (false !== $post_types) { |
|
42 | 42 | $this->post_types = $post_types; |
43 | - add_filter( 'template_include', array( $this, 'post_type_archive_template_include' ), 99 ); |
|
44 | - add_filter( 'template_include', array( $this, 'post_type_single_template_include' ), 99 ); |
|
45 | - add_filter( 'template_include', array( $this, 'search_template_include' ), 99 ); |
|
43 | + add_filter('template_include', array($this, 'post_type_archive_template_include'), 99); |
|
44 | + add_filter('template_include', array($this, 'post_type_single_template_include'), 99); |
|
45 | + add_filter('template_include', array($this, 'search_template_include'), 99); |
|
46 | 46 | } |
47 | - if ( false !== $taxonomies ) { |
|
47 | + if (false !== $taxonomies) { |
|
48 | 48 | $this->taxonomies = $taxonomies; |
49 | - add_filter( 'template_include', array( $this, 'taxonomy_template_include' ), 99 ); |
|
49 | + add_filter('template_include', array($this, 'taxonomy_template_include'), 99); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | } |
@@ -57,10 +57,10 @@ discard block |
||
57 | 57 | * @param $template |
58 | 58 | * @return $template |
59 | 59 | */ |
60 | - public function post_type_archive_template_include( $template ) { |
|
61 | - if ( is_main_query() && is_post_type_archive( $this->post_types ) ) { |
|
60 | + public function post_type_archive_template_include($template) { |
|
61 | + if (is_main_query() && is_post_type_archive($this->post_types)) { |
|
62 | 62 | $current_post_type = get_post_type(); |
63 | - if ( '' == locate_template( array( 'archive-' . $current_post_type . '.php' ) ) && file_exists( $this->plugin_path . 'templates/archive-' . $current_post_type . '.php' ) ) { |
|
63 | + if ('' == locate_template(array('archive-' . $current_post_type . '.php')) && file_exists($this->plugin_path . 'templates/archive-' . $current_post_type . '.php')) { |
|
64 | 64 | $template = $this->plugin_path . 'templates/archive-' . $current_post_type . '.php'; |
65 | 65 | } |
66 | 66 | } |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @return $template |
75 | 75 | */ |
76 | - public function post_type_single_template_include( $template ) { |
|
77 | - if ( is_main_query() && is_singular( $this->post_types ) ) { |
|
76 | + public function post_type_single_template_include($template) { |
|
77 | + if (is_main_query() && is_singular($this->post_types)) { |
|
78 | 78 | $current_post_type = get_post_type(); |
79 | - if ( '' == locate_template( array( 'single-' . $current_post_type . '.php' ) ) && file_exists( $this->plugin_path . 'templates/single-' . $current_post_type . '.php' ) ) { |
|
79 | + if ('' == locate_template(array('single-' . $current_post_type . '.php')) && file_exists($this->plugin_path . 'templates/single-' . $current_post_type . '.php')) { |
|
80 | 80 | $template = $this->plugin_path . 'templates/single-' . $current_post_type . '.php'; |
81 | 81 | } |
82 | 82 | } |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @return $template |
91 | 91 | */ |
92 | - public function taxonomy_template_include( $template ) { |
|
92 | + public function taxonomy_template_include($template) { |
|
93 | 93 | |
94 | - if ( is_main_query() && is_tax( $this->taxonomies ) ) { |
|
95 | - $current_taxonomy = get_query_var( 'taxonomy' ); |
|
96 | - if ( '' == locate_template( array( 'taxonomy-' . $current_taxonomy . '.php' ) ) && file_exists( $this->plugin_path . 'templates/taxonomy-' . $current_taxonomy . '.php' ) ) { |
|
94 | + if (is_main_query() && is_tax($this->taxonomies)) { |
|
95 | + $current_taxonomy = get_query_var('taxonomy'); |
|
96 | + if ('' == locate_template(array('taxonomy-' . $current_taxonomy . '.php')) && file_exists($this->plugin_path . 'templates/taxonomy-' . $current_taxonomy . '.php')) { |
|
97 | 97 | $template = $this->plugin_path . 'templates/taxonomy-' . $current_taxonomy . '.php'; |
98 | 98 | } |
99 | 99 | } |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | * |
108 | 108 | * @return $template |
109 | 109 | */ |
110 | - public function search_template_include( $template ) { |
|
111 | - if ( is_main_query() && is_search() ) { |
|
112 | - if ( file_exists( $this->plugin_path . 'templates/search.php' ) ) { |
|
110 | + public function search_template_include($template) { |
|
111 | + if (is_main_query() && is_search()) { |
|
112 | + if (file_exists($this->plugin_path . 'templates/search.php')) { |
|
113 | 113 | $template = $this->plugin_path . 'templates/search.php'; |
114 | 114 | } |
115 | 115 | } |
@@ -123,28 +123,28 @@ discard block |
||
123 | 123 | * |
124 | 124 | * @return $template |
125 | 125 | */ |
126 | - public function content_part( $slug, $name = null ) { |
|
126 | + public function content_part($slug, $name = null) { |
|
127 | 127 | $template = array(); |
128 | 128 | $name = (string) $name; |
129 | - if ( '' !== $name ) { |
|
129 | + if ('' !== $name) { |
|
130 | 130 | $template = "{$slug}-{$name}.php"; |
131 | 131 | } else { |
132 | 132 | $template = "{$slug}.php"; |
133 | 133 | } |
134 | 134 | $original_name = $template; |
135 | - $path = apply_filters( 'lsx_to_content_path', '', get_post_type() ); |
|
135 | + $path = apply_filters('lsx_to_content_path', '', get_post_type()); |
|
136 | 136 | |
137 | - if ( '' == locate_template( array( $template ) ) && file_exists( $path . 'templates/' . $template ) ) { |
|
137 | + if ('' == locate_template(array($template)) && file_exists($path . 'templates/' . $template)) { |
|
138 | 138 | $template = $path . 'templates/' . $template; |
139 | - } elseif ( file_exists( get_stylesheet_directory() . '/' . $template ) ) { |
|
139 | + } elseif (file_exists(get_stylesheet_directory() . '/' . $template)) { |
|
140 | 140 | $template = get_stylesheet_directory() . '/' . $template; |
141 | 141 | } else { |
142 | 142 | $template = false; |
143 | 143 | } |
144 | - if ( false !== $template ) { |
|
145 | - load_template( $template, false ); |
|
144 | + if (false !== $template) { |
|
145 | + load_template($template, false); |
|
146 | 146 | } else { |
147 | - echo wp_kses_post( '<p>No ' . $original_name . ' can be found.</p>' ); |
|
147 | + echo wp_kses_post('<p>No ' . $original_name . ' can be found.</p>'); |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
@@ -156,9 +156,9 @@ discard block |
||
156 | 156 | * |
157 | 157 | * @return $path |
158 | 158 | */ |
159 | - public function widget_path( $path, $slug ) { |
|
160 | - if ( ( false !== $this->post_types && in_array( $slug, $this->post_types ) ) |
|
161 | - || ( false !== $this->taxonomies && in_array( $slug, $this->taxonomies ) ) || 'post' === $slug ) { |
|
159 | + public function widget_path($path, $slug) { |
|
160 | + if ((false !== $this->post_types && in_array($slug, $this->post_types)) |
|
161 | + || (false !== $this->taxonomies && in_array($slug, $this->taxonomies)) || 'post' === $slug) { |
|
162 | 162 | $path = $this->plugin_path; |
163 | 163 | } |
164 | 164 | return $path; |
@@ -172,9 +172,9 @@ discard block |
||
172 | 172 | * |
173 | 173 | * @return $path |
174 | 174 | */ |
175 | - public function content_path( $path, $slug ) { |
|
176 | - if ( ( false !== $this->post_types && in_array( $slug, $this->post_types ) ) |
|
177 | - || ( false !== $this->taxonomies && in_array( $slug, $this->taxonomies ) ) || 'post' === $slug ) { |
|
175 | + public function content_path($path, $slug) { |
|
176 | + if ((false !== $this->post_types && in_array($slug, $this->post_types)) |
|
177 | + || (false !== $this->taxonomies && in_array($slug, $this->taxonomies)) || 'post' === $slug) { |
|
178 | 178 | $path = $this->plugin_path; |
179 | 179 | } |
180 | 180 | return $path; |