1 | <?php |
||||
0 ignored issues
–
show
introduced
by
![]() |
|||||
2 | /** |
||||
3 | * LSX_TO_Reviews_Frontend |
||||
4 | * |
||||
5 | * @package LSX_TO_Reviews_Frontend |
||||
6 | * @author LightSpeed |
||||
7 | * @license GPL-2.0+ |
||||
8 | * @link |
||||
9 | * @copyright 2016 LightSpeedDevelopment |
||||
10 | */ |
||||
11 | |||||
12 | /** |
||||
13 | * Main plugin class. |
||||
14 | * |
||||
15 | * @package LSX_TO_Reviews_Frontend |
||||
16 | * @author LightSpeed |
||||
17 | */ |
||||
0 ignored issues
–
show
|
|||||
18 | |||||
19 | class LSX_TO_Reviews_Frontend extends LSX_TO_Reviews { |
||||
20 | |||||
21 | /** |
||||
22 | * Holds the $page_links array while its being built on the single review page. |
||||
23 | * |
||||
24 | * @var array |
||||
25 | */ |
||||
26 | public $page_links = false; |
||||
27 | |||||
28 | /** |
||||
29 | * Constructor |
||||
30 | */ |
||||
31 | public function __construct() { |
||||
0 ignored issues
–
show
|
|||||
32 | $this->set_vars(); |
||||
33 | |||||
34 | add_action( 'wp_head', array( $this, 'change_single_review_layout' ), 20, 1 ); |
||||
35 | |||||
36 | add_filter( 'lsx_to_entry_class', array( $this, 'entry_class' ) ); |
||||
37 | add_action( 'init', array( $this, 'init' ) ); |
||||
38 | |||||
39 | if ( ! class_exists( 'LSX_TO_Template_Redirects' ) ) { |
||||
0 ignored issues
–
show
|
|||||
40 | require_once( LSX_TO_REVIEWS_PATH . 'classes/class-template-redirects.php' ); |
||||
0 ignored issues
–
show
|
|||||
41 | } |
||||
42 | |||||
43 | $this->redirects = new LSX_TO_Template_Redirects( LSX_TO_REVIEWS_PATH, array_keys( $this->post_types ) ); |
||||
0 ignored issues
–
show
|
|||||
44 | |||||
45 | add_action( 'lsx_to_review_content', array( $this->redirects, 'content_part' ), 10 , 2 ); |
||||
0 ignored issues
–
show
|
|||||
46 | |||||
47 | add_filter( 'lsx_to_page_navigation', array( $this, 'page_links' ) ); |
||||
48 | |||||
49 | add_action( 'lsx_entry_top', array( $this, 'archive_entry_top' ), 15 ); |
||||
0 ignored issues
–
show
|
|||||
50 | add_action( 'lsx_entry_bottom', array( $this, 'archive_entry_bottom' ) ); |
||||
0 ignored issues
–
show
|
|||||
51 | add_action( 'lsx_content_bottom', array( $this, 'single_content_bottom' ) ); |
||||
52 | add_action( 'lsx_to_fast_facts', array( $this, 'single_fast_facts' ) ); |
||||
53 | } |
||||
0 ignored issues
–
show
|
|||||
54 | |||||
55 | /** |
||||
56 | * Change single review layout. |
||||
57 | */ |
||||
58 | public function change_single_review_layout() { |
||||
59 | global $lsx_to_archive; |
||||
60 | |||||
61 | if ( is_singular( 'review' ) && 1 !== $lsx_to_archive ) { |
||||
0 ignored issues
–
show
|
|||||
62 | remove_action( 'lsx_entry_bottom', 'lsx_to_single_entry_bottom' ); |
||||
63 | add_action( 'lsx_entry_top', array( $this, 'lsx_to_single_entry_bottom' ) ); |
||||
64 | } |
||||
65 | } |
||||
0 ignored issues
–
show
|
|||||
66 | |||||
67 | /** |
||||
68 | * Change single review layout. |
||||
69 | */ |
||||
70 | public function lsx_to_single_entry_bottom() { |
||||
71 | if ( is_singular( 'review' ) ) { ?> |
||||
0 ignored issues
–
show
|
|||||
72 | <div class="col-xs-12 col-sm-4 col-md-3"> |
||||
73 | <figure class="lsx-to-review-thumb"> |
||||
74 | <?php lsx_thumbnail( 'lsx-thumbnail-square' ); ?> |
||||
75 | </figure> |
||||
76 | |||||
77 | <?php $reviewer_name = get_post_meta( get_the_ID(), 'reviewer_name', true ); ?> |
||||
0 ignored issues
–
show
It seems like
get_the_ID() can also be of type false ; however, parameter $post_id of get_post_meta() does only seem to accept integer , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
78 | <h3 class="lsx-to-summary-title text-center"><?php echo esc_html( $reviewer_name ); ?></h3> |
||||
0 ignored issues
–
show
It seems like
$reviewer_name can also be of type false ; however, parameter $text of esc_html() does only seem to accept string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
79 | </div> |
||||
80 | <?php } |
||||
0 ignored issues
–
show
|
|||||
81 | } |
||||
0 ignored issues
–
show
|
|||||
82 | |||||
83 | /** |
||||
84 | * Runs on init after all files have been parsed. |
||||
85 | */ |
||||
86 | public function init() { |
||||
87 | add_filter( 'lsx_to_custom_field_query',array( $this, 'rating' ),5,10 ); |
||||
88 | } |
||||
0 ignored issues
–
show
|
|||||
89 | |||||
90 | /** |
||||
0 ignored issues
–
show
|
|||||
91 | * A filter to set the content area to a small column on single |
||||
92 | */ |
||||
93 | public function entry_class( $classes ) { |
||||
94 | global $lsx_to_archive; |
||||
95 | |||||
96 | if ( 1 !== $lsx_to_archive ) { |
||||
0 ignored issues
–
show
|
|||||
97 | $lsx_to_archive = false; |
||||
98 | } |
||||
99 | |||||
100 | if ( is_main_query() && is_singular( 'review' ) && false === $lsx_to_archive ) { |
||||
0 ignored issues
–
show
|
|||||
101 | //if ( lsx_to_has_enquiry_contact() ) { |
||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
55% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
|||||
102 | $classes[] = 'col-xs-12 col-sm-8 col-md-9'; |
||||
103 | //} else { |
||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
63% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
|||||
104 | //$classes[] = 'col-sm-12'; |
||||
0 ignored issues
–
show
|
|||||
105 | //} |
||||
0 ignored issues
–
show
|
|||||
106 | } |
||||
107 | |||||
108 | return $classes; |
||||
109 | } |
||||
0 ignored issues
–
show
|
|||||
110 | |||||
111 | /** |
||||
0 ignored issues
–
show
|
|||||
112 | * Filter and make the star ratings |
||||
113 | */ |
||||
114 | public function rating( $html = '', $meta_key = false, $value = false, $before = '', $after = '' ) { |
||||
115 | if ( get_post_type() === 'review' && 'rating' === $meta_key ) { |
||||
0 ignored issues
–
show
|
|||||
116 | $ratings_array = array(); |
||||
117 | $counter = 5; |
||||
118 | $html = ''; |
||||
119 | if ( 0 !== (int) $value ) { |
||||
0 ignored issues
–
show
|
|||||
120 | while ( $counter > 0 ) { |
||||
0 ignored issues
–
show
|
|||||
121 | if ( $value > 0 ) { |
||||
0 ignored issues
–
show
|
|||||
122 | $ratings_array[] = '<i class="fa fa-star"></i>'; |
||||
123 | } else { |
||||
124 | $ratings_array[] = '<i class="fa fa-star-o"></i>'; |
||||
125 | } |
||||
126 | |||||
127 | $counter--; |
||||
128 | $value--; |
||||
129 | } |
||||
130 | |||||
131 | $html = $before . implode( '', $ratings_array ) . $after; |
||||
132 | } |
||||
133 | } |
||||
0 ignored issues
–
show
|
|||||
134 | return $html; |
||||
135 | } |
||||
0 ignored issues
–
show
|
|||||
136 | |||||
137 | /** |
||||
0 ignored issues
–
show
|
|||||
138 | * Adds our navigation links to the review single post |
||||
139 | * |
||||
140 | * @param $page_links array |
||||
0 ignored issues
–
show
|
|||||
141 | * @return $page_links array |
||||
0 ignored issues
–
show
|
|||||
142 | */ |
||||
143 | public function page_links( $page_links ) { |
||||
144 | if ( is_singular( 'review' ) ) { |
||||
0 ignored issues
–
show
|
|||||
145 | $this->page_links = $page_links; |
||||
146 | |||||
147 | $this->get_related_accommodation_link(); |
||||
148 | $this->get_related_tours_link(); |
||||
149 | $this->get_related_destinations_link(); |
||||
150 | $this->get_gallery_link(); |
||||
151 | $this->get_videos_link(); |
||||
152 | $this->get_related_posts_link(); |
||||
153 | |||||
154 | $page_links = $this->page_links; |
||||
155 | } |
||||
156 | |||||
157 | return $page_links; |
||||
158 | } |
||||
0 ignored issues
–
show
|
|||||
159 | |||||
160 | /** |
||||
161 | * Tests for the Related Accommodation and returns a link for the section |
||||
162 | */ |
||||
163 | public function get_related_accommodation_link() { |
||||
164 | $connected_accommodation = get_post_meta( get_the_ID(), 'accommodation_to_review', false ); |
||||
0 ignored issues
–
show
It seems like
get_the_ID() can also be of type false ; however, parameter $post_id of get_post_meta() does only seem to accept integer , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
165 | |||||
166 | if ( post_type_exists( 'accommodation' ) && is_array( $connected_accommodation ) && ! empty( $connected_accommodation ) ) { |
||||
0 ignored issues
–
show
|
|||||
167 | $connected_accommodation = new \WP_Query( array( |
||||
0 ignored issues
–
show
|
|||||
168 | 'post_type' => 'accommodation', |
||||
0 ignored issues
–
show
|
|||||
169 | 'post__in' => $connected_accommodation, |
||||
0 ignored issues
–
show
|
|||||
170 | 'post_status' => 'publish', |
||||
0 ignored issues
–
show
|
|||||
171 | 'nopagin' => true, |
||||
0 ignored issues
–
show
|
|||||
172 | 'posts_per_page' => '-1', |
||||
173 | 'fields' => 'ids', |
||||
0 ignored issues
–
show
|
|||||
174 | ) ); |
||||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
![]() |
|||||
175 | |||||
176 | $connected_accommodation = $connected_accommodation->posts; |
||||
177 | |||||
178 | if ( is_array( $connected_accommodation ) && ! empty( $connected_accommodation ) ) { |
||||
0 ignored issues
–
show
|
|||||
179 | $this->page_links['accommodation'] = esc_html__( 'Accommodation', 'to-reviews' ); |
||||
180 | } |
||||
181 | } |
||||
182 | } |
||||
0 ignored issues
–
show
|
|||||
183 | |||||
184 | /** |
||||
185 | * Tests for the Related Tours and returns a link for the section |
||||
186 | */ |
||||
187 | public function get_related_tours_link() { |
||||
188 | $connected_tours = get_post_meta( get_the_ID(), 'tour_to_review', false ); |
||||
0 ignored issues
–
show
It seems like
get_the_ID() can also be of type false ; however, parameter $post_id of get_post_meta() does only seem to accept integer , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
189 | |||||
190 | if ( post_type_exists( 'tour' ) && is_array( $connected_tours ) && ! empty( $connected_tours ) ) { |
||||
0 ignored issues
–
show
|
|||||
191 | $connected_tours = new \WP_Query( array( |
||||
0 ignored issues
–
show
|
|||||
192 | 'post_type' => 'tour', |
||||
0 ignored issues
–
show
|
|||||
193 | 'post__in' => $connected_tours, |
||||
0 ignored issues
–
show
|
|||||
194 | 'post_status' => 'publish', |
||||
0 ignored issues
–
show
|
|||||
195 | 'nopagin' => true, |
||||
0 ignored issues
–
show
|
|||||
196 | 'posts_per_page' => '-1', |
||||
197 | 'fields' => 'ids', |
||||
0 ignored issues
–
show
|
|||||
198 | ) ); |
||||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
![]() |
|||||
199 | |||||
200 | $connected_tours = $connected_tours->posts; |
||||
201 | |||||
202 | if ( is_array( $connected_tours ) && ! empty( $connected_tours ) ) { |
||||
0 ignored issues
–
show
|
|||||
203 | $this->page_links['tours'] = esc_html__( 'Tours', 'to-reviews' ); |
||||
204 | } |
||||
205 | } |
||||
206 | } |
||||
0 ignored issues
–
show
|
|||||
207 | |||||
208 | /** |
||||
209 | * Tests for the Related Destinations and returns a link for the section |
||||
210 | */ |
||||
211 | public function get_related_destinations_link() { |
||||
212 | $connected_destination = ''; |
||||
213 | $connected_destinations = get_post_meta( get_the_ID(), 'destination_to_review', false ); |
||||
0 ignored issues
–
show
It seems like
get_the_ID() can also be of type false ; however, parameter $post_id of get_post_meta() does only seem to accept integer , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
214 | |||||
215 | if ( post_type_exists( 'destination' ) && is_array( $connected_destinations ) && ! empty( $connected_destinations ) ) { |
||||
0 ignored issues
–
show
|
|||||
216 | $connected_destination = new \WP_Query( array( |
||||
0 ignored issues
–
show
|
|||||
217 | 'post_type' => 'destination', |
||||
0 ignored issues
–
show
|
|||||
218 | 'post__in' => $connected_destination, |
||||
0 ignored issues
–
show
|
|||||
219 | 'post_status' => 'publish', |
||||
0 ignored issues
–
show
|
|||||
220 | 'nopagin' => true, |
||||
0 ignored issues
–
show
|
|||||
221 | 'posts_per_page' => '-1', |
||||
222 | 'fields' => 'ids', |
||||
0 ignored issues
–
show
|
|||||
223 | ) ); |
||||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
![]() |
|||||
224 | |||||
225 | $connected_destination = $connected_destination->posts; |
||||
226 | |||||
227 | if ( is_array( $connected_destination ) && ! empty( $connected_destination ) ) { |
||||
0 ignored issues
–
show
|
|||||
228 | $this->page_links['destinations'] = esc_html__( 'Destinations', 'to-reviews' ); |
||||
229 | } |
||||
230 | } |
||||
231 | } |
||||
0 ignored issues
–
show
|
|||||
232 | |||||
233 | /** |
||||
234 | * Tests for the Gallery and returns a link for the section |
||||
235 | */ |
||||
236 | public function get_gallery_link() { |
||||
237 | $gallery_ids = get_post_meta( get_the_ID(), 'gallery', false ); |
||||
0 ignored issues
–
show
It seems like
get_the_ID() can also be of type false ; however, parameter $post_id of get_post_meta() does only seem to accept integer , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||||
238 | $envira_gallery = get_post_meta( get_the_ID(), 'envira_gallery', true ); |
||||
239 | |||||
240 | if ( ( ! empty( $gallery_ids ) && is_array( $gallery_ids ) ) || ( function_exists( 'envira_gallery' ) && ! empty( $envira_gallery ) && false === lsx_to_enable_envira_banner() ) ) { |
||||
0 ignored issues
–
show
|
|||||
241 | if ( function_exists( 'envira_gallery' ) && ! empty( $envira_gallery ) && false === lsx_to_enable_envira_banner() ) { |
||||
0 ignored issues
–
show
|
|||||
242 | // Envira Gallery |
||||
0 ignored issues
–
show
|
|||||
243 | $this->page_links['gallery'] = esc_html__( 'Gallery', 'to-reviews' ); |
||||
244 | return; |
||||
245 | } else { |
||||
246 | if ( function_exists( 'envira_dynamic' ) ) { |
||||
0 ignored issues
–
show
|
|||||
247 | // Envira Gallery - Dynamic |
||||
0 ignored issues
–
show
|
|||||
248 | $this->page_links['gallery'] = esc_html__( 'Gallery', 'to-reviews' ); |
||||
249 | return; |
||||
250 | } else { |
||||
251 | // WordPress Gallery |
||||
0 ignored issues
–
show
|
|||||
252 | $this->page_links['gallery'] = esc_html__( 'Gallery', 'to-reviews' ); |
||||
253 | return; |
||||
254 | } |
||||
255 | } |
||||
256 | } |
||||
257 | } |
||||
0 ignored issues
–
show
|
|||||
258 | |||||
259 | /** |
||||
260 | * Tests for the Videos and returns a link for the section |
||||
261 | */ |
||||
262 | public function get_videos_link() { |
||||
263 | $videos_id = false; |
||||
264 | |||||
265 | if ( class_exists( 'Envira_Videos' ) ) { |
||||
0 ignored issues
–
show
|
|||||
266 | $videos_id = get_post_meta( get_the_ID(), 'envira_video', true ); |
||||
0 ignored issues
–
show
It seems like
get_the_ID() can also be of type false ; however, parameter $post_id of get_post_meta() does only seem to accept integer , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
267 | } |
||||
268 | |||||
269 | if ( empty( $videos_id ) && function_exists( 'lsx_to_videos' ) ) { |
||||
0 ignored issues
–
show
|
|||||
270 | $videos_id = get_post_meta( get_the_ID(), 'videos', true ); |
||||
271 | } |
||||
272 | |||||
273 | if ( ! empty( $videos_id ) ) { |
||||
0 ignored issues
–
show
|
|||||
274 | $this->page_links['videos'] = esc_html__( 'Videos', 'to-reviews' ); |
||||
275 | } |
||||
276 | } |
||||
0 ignored issues
–
show
|
|||||
277 | |||||
278 | /** |
||||
279 | * Tests for the Related Posts and returns a link for the section |
||||
280 | */ |
||||
281 | public function get_related_posts_link() { |
||||
282 | $connected_posts = get_post_meta( get_the_ID(), 'post_to_review', false ); |
||||
0 ignored issues
–
show
It seems like
get_the_ID() can also be of type false ; however, parameter $post_id of get_post_meta() does only seem to accept integer , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
283 | |||||
284 | if ( is_array( $connected_posts ) && ! empty( $connected_posts ) ) { |
||||
0 ignored issues
–
show
|
|||||
285 | $connected_posts = new \WP_Query( array( |
||||
0 ignored issues
–
show
|
|||||
286 | 'post_type' => 'post', |
||||
0 ignored issues
–
show
|
|||||
287 | 'post__in' => $connected_posts, |
||||
0 ignored issues
–
show
|
|||||
288 | 'post_status' => 'publish', |
||||
0 ignored issues
–
show
|
|||||
289 | 'nopagin' => true, |
||||
0 ignored issues
–
show
|
|||||
290 | 'posts_per_page' => '-1', |
||||
291 | 'fields' => 'ids', |
||||
0 ignored issues
–
show
|
|||||
292 | ) ); |
||||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
![]() |
|||||
293 | |||||
294 | $connected_posts = $connected_posts->posts; |
||||
295 | |||||
296 | if ( is_array( $connected_posts ) && ! empty( $connected_posts ) ) { |
||||
0 ignored issues
–
show
|
|||||
297 | $this->page_links['posts'] = esc_html__( 'Posts', 'to-reviews' ); |
||||
298 | } |
||||
299 | } |
||||
300 | } |
||||
0 ignored issues
–
show
|
|||||
301 | |||||
302 | /** |
||||
303 | * Adds the template tags to the top of the archive review |
||||
304 | */ |
||||
305 | public function archive_entry_top() { |
||||
306 | global $lsx_to_archive; |
||||
307 | |||||
308 | if ( 'review' === get_post_type() && ( is_archive() || $lsx_to_archive ) ) { |
||||
0 ignored issues
–
show
|
|||||
309 | if ( is_search() || empty( tour_operator()->options[ get_post_type() ]['disable_entry_metadata'] ) ) { ?> |
||||
0 ignored issues
–
show
|
|||||
310 | <div class="lsx-to-archive-meta-data lsx-to-archive-meta-data-grid-mode"> |
||||
311 | <?php |
||||
312 | $meta_class = 'lsx-to-meta-data lsx-to-meta-data-'; |
||||
313 | |||||
314 | lsx_to_connected_accommodation( '<span class="' . $meta_class . 'accommodations"><span class="lsx-to-meta-data-key">' . __( 'Accommodation', 'to-reviews' ) . ':</span> ', '</span>' ); |
||||
315 | lsx_to_connected_tours( '<span class="' . $meta_class . 'tours"><span class="lsx-to-meta-data-key">' . __( 'Tours', 'to-reviews' ) . ':</span> ', '</span>' ); |
||||
316 | lsx_to_connected_destinations( '<span class="' . $meta_class . 'destinations"><span class="lsx-to-meta-data-key">' . __( 'Destinations', 'to-reviews' ) . ':</span> ', '</span>' ); |
||||
317 | ?> |
||||
318 | </div> |
||||
319 | <?php } ?> |
||||
320 | <?php } |
||||
0 ignored issues
–
show
|
|||||
321 | } |
||||
0 ignored issues
–
show
|
|||||
322 | |||||
323 | /** |
||||
324 | * Adds the template tags to the bottom of the archive review |
||||
325 | */ |
||||
326 | public function archive_entry_bottom() { |
||||
327 | global $lsx_to_archive; |
||||
328 | |||||
329 | if ( 'review' === get_post_type() && ( is_archive() || $lsx_to_archive ) ) { ?> |
||||
0 ignored issues
–
show
|
|||||
330 | </div> |
||||
331 | |||||
332 | <?php if ( is_search() || empty( tour_operator()->options[ get_post_type() ]['disable_entry_metadata'] ) ) { ?> |
||||
0 ignored issues
–
show
|
|||||
333 | <div class="lsx-to-archive-meta-data lsx-to-archive-meta-data-list-mode"> |
||||
334 | <?php |
||||
335 | $meta_class = 'lsx-to-meta-data lsx-to-meta-data-'; |
||||
336 | |||||
337 | lsx_to_connected_accommodation( '<span class="' . $meta_class . 'accommodations"><span class="lsx-to-meta-data-key">' . __( 'Accommodation', 'to-reviews' ) . ':</span> ', '</span>' ); |
||||
338 | lsx_to_connected_tours( '<span class="' . $meta_class . 'tours"><span class="lsx-to-meta-data-key">' . __( 'Tours', 'to-reviews' ) . ':</span> ', '</span>' ); |
||||
339 | lsx_to_connected_destinations( '<span class="' . $meta_class . 'destinations"><span class="lsx-to-meta-data-key">' . __( 'Destinations', 'to-reviews' ) . ':</span> ', '</span>' ); |
||||
340 | ?> |
||||
341 | </div> |
||||
342 | <?php } ?> |
||||
343 | </div> |
||||
344 | |||||
345 | <?php $has_single = ! lsx_to_is_single_disabled(); ?> |
||||
346 | |||||
347 | <?php if ( $has_single && 'grid' === tour_operator()->archive_layout ) : ?> |
||||
0 ignored issues
–
show
|
|||||
348 | <a href="<?php the_permalink(); ?>" class="moretag"><?php esc_html_e( 'View more', 'to-reviews' ); ?></a> |
||||
349 | <?php endif; ?> |
||||
350 | <?php } |
||||
0 ignored issues
–
show
|
|||||
351 | } |
||||
0 ignored issues
–
show
|
|||||
352 | |||||
353 | /** |
||||
354 | * Adds the template tags fast facts |
||||
355 | */ |
||||
356 | public function single_fast_facts() { |
||||
357 | if ( is_singular( 'review' ) ) { ?> |
||||
0 ignored issues
–
show
|
|||||
358 | <section id="fast-facts"> |
||||
359 | <div class="lsx-to-single-meta-data"> |
||||
360 | <?php |
||||
361 | $meta_class = 'lsx-to-meta-data lsx-to-meta-data-'; |
||||
362 | |||||
363 | lsx_to_review_rating( '<span class="' . $meta_class . 'rating"><span class="lsx-to-meta-data-key">' . esc_html__( 'Rating', 'to-reviews' ) . ':</span> ', '</span>' ); |
||||
364 | lsx_to_review_dates( '<span class="' . $meta_class . 'travel-dates"><span class="lsx-to-meta-data-key">' . esc_html__( 'Date Travelled', 'to-reviews' ) . ':</span> ', '</span>' ); |
||||
365 | lsx_to_connected_accommodation( '<span class="' . $meta_class . 'accommodations"><span class="lsx-to-meta-data-key">' . esc_html__( 'Accommodation', 'to-reviews' ) . ':</span> ', '</span>' ); |
||||
366 | lsx_to_connected_tours( '<span class="' . $meta_class . 'tours"><span class="lsx-to-meta-data-key">' . esc_html__( 'Tours', 'to-reviews' ) . ':</span> ', '</span>' ); |
||||
367 | lsx_to_connected_destinations( '<span class="' . $meta_class . 'destinations"><span class="lsx-to-meta-data-key">' . esc_html__( 'Destinations', 'to-reviews' ) . ':</span> ', '</span>' ); |
||||
368 | ?> |
||||
369 | </div> |
||||
370 | </section> |
||||
371 | <?php } |
||||
0 ignored issues
–
show
|
|||||
372 | } |
||||
0 ignored issues
–
show
|
|||||
373 | |||||
374 | /** |
||||
375 | * Adds the template tags to the bottom of the single review |
||||
376 | */ |
||||
377 | public function single_content_bottom() { |
||||
378 | if ( is_singular( 'review' ) ) { |
||||
0 ignored issues
–
show
|
|||||
379 | lsx_to_review_accommodation(); |
||||
380 | |||||
381 | lsx_to_review_tour(); |
||||
382 | |||||
383 | lsx_to_review_destination(); |
||||
384 | |||||
385 | 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>' ); |
||||
386 | |||||
387 | if ( function_exists( 'lsx_to_videos' ) ) { |
||||
0 ignored issues
–
show
|
|||||
388 | 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>' ); |
||||
389 | } elseif ( class_exists( 'Envira_Videos' ) ) { |
||||
0 ignored issues
–
show
|
|||||
390 | 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>' ); |
||||
391 | } |
||||
392 | |||||
393 | lsx_to_review_posts(); |
||||
394 | } |
||||
395 | } |
||||
0 ignored issues
–
show
|
|||||
396 | |||||
397 | } |
||||
398 | |||||
399 | new LSX_TO_Reviews_Frontend(); |
||||
400 |