lsx_to_review_dates()   B
last analyzed

Complexity

Conditions 8
Paths 12

Size

Total Lines 19
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 8
eloc 12
c 1
b 0
f 0
nc 12
nop 3
dl 0
loc 19
rs 8.4444
1
<?php
2
/**
3
 * Template Tags
4
 *
5
 * @package   LSX_TO_Reviews
6
 * @license   GPL-2.0+
7
 */
8
9
/**
10
 * Outputs the posts attached review
11
 *
12
 * @package 	to-reviews
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
13
 * @subpackage	template-tags
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
14
 * @category 	review
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
15
 */
16
if ( ! function_exists( 'lsx_to_review_posts' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
17
	function lsx_to_review_posts() {
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for function lsx_to_review_posts()
Loading history...
Coding Style introduced by
Expected 2 blank lines before function; 0 found
Loading history...
18
		global $lsx_to_archive;
19
20
		$args = array(
21
			'from'		=> 'post',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 3 space(s) between "'from'" and double arrow, but found 6.
Loading history...
22
			'to'		=> 'review',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 5 space(s) between "'to'" and double arrow, but found 8.
Loading history...
23
			'column'	=> '3',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'column'" and double arrow, but found 4.
Loading history...
24
			'before'	=> '<section id="posts" 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-posts">' . esc_html__( 'Featured Posts', 'to-reviews' ) . '</h2><div id="collapse-posts" class="collapse in"><div class="collapse-inner">',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'before'" and double arrow, but found 4.
Loading history...
25
			'after'		=> '</div></div></section>',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 2 space(s) between "'after'" and double arrow, but found 5.
Loading history...
26
		);
27
28
		lsx_to_connected_panel_query( $args );
29
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
30
}
31
32
/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$slug" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$name" missing
Loading history...
33
 * Find the content part in the plugin
34
 *
35
 * @package 	to-reviews
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
36
 * @subpackage	template-tag
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
37
 * @category 	content
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
38
 */
39
function lsx_to_review_content( $slug, $name = null ) {
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
40
	do_action( 'lsx_to_review_content', $slug, $name );
41
}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
42
43
/* ================  REVIEWS =========================== */
44
/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$before" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$after" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$echo" missing
Loading history...
45
 * Gets the current reviews rating
46
 *
47
 * @param		$before	| string
0 ignored issues
show
Documentation Bug introduced by
The doc comment | string at position 0 could not be parsed: Unknown type name '|' at position 0 in | string.
Loading history...
Coding Style introduced by
Missing parameter name
Loading history...
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
48
 * @param		$after	| string
0 ignored issues
show
Coding Style introduced by
Missing parameter name
Loading history...
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
49
 * @param		$echo	| boolean
0 ignored issues
show
Coding Style introduced by
Missing parameter name
Loading history...
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
50
 * @return		string
0 ignored issues
show
Coding Style introduced by
Function return type is not void, but function has no return statement
Loading history...
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
51
 *
52
 * @package 	lsx-tour-operators
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
53
 * @subpackage	template-tags
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
54
 * @category 	review
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
55
 */
56
function lsx_to_review_rating( $before = '', $after = '', $echo = true ) {
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 0 found
Loading history...
57
	lsx_to_custom_field_query( 'rating', $before, $after, $echo );
58
}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
59
60
/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$before" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$after" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$echo" missing
Loading history...
61
 * Outputs the reviews dates
62
 *
63
 * @param		$before	| string
0 ignored issues
show
Documentation Bug introduced by
The doc comment | string at position 0 could not be parsed: Unknown type name '|' at position 0 in | string.
Loading history...
Coding Style introduced by
Missing parameter name
Loading history...
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
64
 * @param		$after	| string
0 ignored issues
show
Coding Style introduced by
Missing parameter name
Loading history...
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
65
 * @param		$echo	| boolean
0 ignored issues
show
Coding Style introduced by
Missing parameter name
Loading history...
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
66
 * @return		string
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
67
 *
68
 * @package 	lsx-tour-operators
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
69
 * @subpackage	template-tags
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
70
 * @category 	review
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
71
 */
72
function lsx_to_review_dates( $before = '', $after = '', $echo = true ) {
73
	$valid_from = get_post_meta( get_the_ID(), 'date_of_visit_start', true );
0 ignored issues
show
Bug introduced by
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 ignore-type  annotation

73
	$valid_from = get_post_meta( /** @scrutinizer ignore-type */ get_the_ID(), 'date_of_visit_start', true );
Loading history...
74
	$valid_to = get_post_meta( get_the_ID(), 'date_of_visit_end', true );
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 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.

Loading history...
75
76
	if ( false !== $valid_from && '' !== $valid_from ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
77
		$valid_from = date( 'd M Y', strtotime( $valid_from ) );
0 ignored issues
show
introduced by
date() is affected by runtime timezone changes which can cause date/time to be incorrectly displayed. Use gmdate() instead.
Loading history...
78
	}
79
80
	if ( false !== $valid_to && '' !== $valid_to ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
81
		$valid_from .= ' - ' . date( 'd M Y', strtotime( $valid_to ) );
0 ignored issues
show
introduced by
date() is affected by runtime timezone changes which can cause date/time to be incorrectly displayed. Use gmdate() instead.
Loading history...
82
	}
83
84
	if ( false !== $valid_from && '' !== $valid_from ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
85
		$return = $before . $valid_from . $after;
86
87
		if ( $echo ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
88
			echo $return;
0 ignored issues
show
introduced by
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$return'.
Loading history...
89
		} else {
90
			return $return;
91
		}
92
	}
93
}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
94
/**
95
 * Outputs the connected accommodation for a review
96
 *
97
 * @package 	lsx-tour-operators
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
98
 * @subpackage	template-tags
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
99
 * @category 	review
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
100
 */
101
function lsx_to_review_accommodation() {
102
	global $lsx_archive;
103
104
	if ( post_type_exists( 'accommodation' ) && is_singular( 'review' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
105
		$args = array(
106
			'from'		=> 'accommodation',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 3 space(s) between "'from'" and double arrow, but found 6.
Loading history...
107
			'to'		=> 'review',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 5 space(s) between "'to'" and double arrow, but found 8.
Loading history...
108
			'column'	=> '3',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'column'" and double arrow, but found 4.
Loading history...
109
			'before'	=> '<section id="accommodation" 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-accommodation">' . __( lsx_to_get_post_type_section_title( 'accommodation', '', 'Featured Accommodations' ), 'to-reviews' ) . '</h2><div id="collapse-accommodation" class="collapse in"><div class="collapse-inner">',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'before'" and double arrow, but found 4.
Loading history...
introduced by
The $text arg must be a single string literal, not "lsx_to_get_post_type_section_title( 'accommodation', '', 'Featured Accommodations' )".
Loading history...
110
			'after'		=> '</div></div></section>',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 2 space(s) between "'after'" and double arrow, but found 5.
Loading history...
111
		);
112
113
		lsx_to_connected_panel_query( $args );
114
	}
115
}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
116
117
/**
118
 * Outputs the connected tour only a review
119
 *
120
 * @package 	lsx-tour-operators
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
121
 * @subpackage	template-tags
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
122
 * @category 	review
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
123
 */
124
function lsx_to_review_tour() {
125
	global $lsx_archive;
126
127
	if ( post_type_exists( 'tour' ) && is_singular( 'review' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
128
		$args = array(
129
			'from'		=> 'tour',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 3 space(s) between "'from'" and double arrow, but found 6.
Loading history...
130
			'to'		=> 'review',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 5 space(s) between "'to'" and double arrow, but found 8.
Loading history...
131
			'column'	=> '3',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'column'" and double arrow, but found 4.
Loading history...
132
			'before'	=> '<section id="tours" 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-tours">' . __( lsx_to_get_post_type_section_title( 'tour', '', 'Featured Tours' ), 'to-reviews' ) . '</h2><div id="collapse-tours" class="collapse in"><div class="collapse-inner">',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'before'" and double arrow, but found 4.
Loading history...
introduced by
The $text arg must be a single string literal, not "lsx_to_get_post_type_section_title( 'tour', '', 'Featured Tours' )".
Loading history...
133
			'after'		=> '</div></div></section>',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 2 space(s) between "'after'" and double arrow, but found 5.
Loading history...
134
		);
135
136
		lsx_to_connected_panel_query( $args );
137
	}
138
}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
139
140
/**
141
 * Outputs the connected destination only a review
142
 *
143
 * @package 	lsx-tour-operators
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
144
 * @subpackage	template-tags
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
145
 * @category 	review
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
146
 */
147
function lsx_to_review_destination() {
148
	global $lsx_archive;
149
150
	if ( post_type_exists( 'destination' ) && is_singular( 'review' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
151
		$args = array(
152
			'from'		=> 'destination',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 3 space(s) between "'from'" and double arrow, but found 6.
Loading history...
153
			'to'		=> 'review',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 5 space(s) between "'to'" and double arrow, but found 8.
Loading history...
154
			'column'	=> '3',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'column'" and double arrow, but found 4.
Loading history...
155
			'before'	=> '<section id="destinations" 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-destinations">' . __( lsx_to_get_post_type_section_title( 'destination', '', 'Featured Destinations' ), 'to-reviews' ) . '</h2><div id="collapse-destinations" class="collapse in"><div class="collapse-inner">',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'before'" and double arrow, but found 4.
Loading history...
introduced by
The $text arg must be a single string literal, not "lsx_to_get_post_type_section_title( 'destination', '', 'Featured Destinations' )".
Loading history...
156
			'after'		=> '</div></div></section>',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 2 space(s) between "'after'" and double arrow, but found 5.
Loading history...
157
		);
158
159
		lsx_to_connected_panel_query( $args );
160
	}
161
}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
162
163
/**
164
 * Outputs the connected reviews for an accommodation
165
 *
166
 * @package 	lsx-tour-operators
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
167
 * @subpackage	template-tags
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
168
 * @category 	review
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
169
 */
170
function lsx_to_accommodation_reviews() {
171
	global $lsx_archive;
172
173
	if ( post_type_exists( 'review' ) && is_singular( 'accommodation' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
174
		$args = array(
175
			'from'		=> 'review',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 3 space(s) between "'from'" and double arrow, but found 6.
Loading history...
176
			'to'		=> 'accommodation',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 5 space(s) between "'to'" and double arrow, but found 8.
Loading history...
177
			'column'	=> '2',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'column'" and double arrow, but found 4.
Loading history...
178
			'before'	=> '<section id="review" 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-review">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Reviews' ), 'to-reviews' ) . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'before'" and double arrow, but found 4.
Loading history...
introduced by
The $text arg must be a single string literal, not "lsx_to_get_post_type_section_title( 'review', '', 'Reviews' )".
Loading history...
179
			'after'		=> '</div></div></section>',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 2 space(s) between "'after'" and double arrow, but found 5.
Loading history...
180
		);
181
182
		lsx_to_connected_panel_query( $args );
183
	}
184
}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
185
186
/**
187
 * Outputs the connected reviews for a tour
188
 *
189
 * @package 	lsx-tour-operators
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
190
 * @subpackage	template-tags
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
191
 * @category 	review
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
192
 */
193
function lsx_to_tour_reviews() {
194
	global $lsx_archive;
195
196
	if ( post_type_exists( 'review' ) && is_singular( 'tour' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
197
		$args = array(
198
			'from'		=> 'review',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 3 space(s) between "'from'" and double arrow, but found 6.
Loading history...
199
			'to'		=> 'tour',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 5 space(s) between "'to'" and double arrow, but found 8.
Loading history...
200
			'column'	=> '2',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'column'" and double arrow, but found 4.
Loading history...
201
			'before'	=> '<section id="review" 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-review">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Reviews' ), 'to-reviews' ) . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'before'" and double arrow, but found 4.
Loading history...
introduced by
The $text arg must be a single string literal, not "lsx_to_get_post_type_section_title( 'review', '', 'Reviews' )".
Loading history...
202
			'after'		=> '</div></div></section>',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 2 space(s) between "'after'" and double arrow, but found 5.
Loading history...
203
		);
204
205
		lsx_to_connected_panel_query( $args );
206
	}
207
}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
208
209
/**
210
 * Outputs the connected reviews for a destination
211
 *
212
 * @package 	lsx-tour-operators
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
213
 * @subpackage	template-tags
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
214
 * @category 	review
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
215
 */
216
function lsx_to_destination_reviews() {
217
	global $lsx_archive;
218
219
	if ( post_type_exists( 'review' ) && is_singular( 'destination' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
220
		$args = array(
221
			'from'		=> 'review',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 3 space(s) between "'from'" and double arrow, but found 6.
Loading history...
222
			'to'		=> 'destination',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 5 space(s) between "'to'" and double arrow, but found 8.
Loading history...
223
			'column'	=> '2',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'column'" and double arrow, but found 4.
Loading history...
224
			'before'	=> '<section id="review" 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-review">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Reviews' ), 'to-reviews' ) . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 1 space(s) between "'before'" and double arrow, but found 4.
Loading history...
introduced by
The $text arg must be a single string literal, not "lsx_to_get_post_type_section_title( 'review', '', 'Reviews' )".
Loading history...
225
			'after'		=> '</div></div></section>',
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
introduced by
Array double arrow not aligned correctly; expected 2 space(s) between "'after'" and double arrow, but found 5.
Loading history...
226
		);
227
228
		lsx_to_connected_panel_query( $args );
229
	}
230
}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
231
232
/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$before" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$after" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$echo" missing
Loading history...
233
 * Gets the current specials connected reviews
234
 *
235
 * @param		$before	| string
0 ignored issues
show
Documentation Bug introduced by
The doc comment | string at position 0 could not be parsed: Unknown type name '|' at position 0 in | string.
Loading history...
Coding Style introduced by
Missing parameter name
Loading history...
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
236
 * @param		$after	| string
0 ignored issues
show
Coding Style introduced by
Missing parameter name
Loading history...
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
237
 * @param		$echo	| boolean
0 ignored issues
show
Coding Style introduced by
Missing parameter name
Loading history...
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
238
 * @return		string
0 ignored issues
show
Coding Style introduced by
Function return type is not void, but function has no return statement
Loading history...
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
239
 *
240
 * @package 	tour-operator
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
241
 * @subpackage	template-tags
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
242
 * @category 	connections
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
243
 */
244
function lsx_to_connected_reviews( $before = '', $after = '', $echo = true ) {
245
	lsx_to_connected_items_query( 'review', get_post_type(), $before, $after, $echo );
246
}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
247