lsx_to_travel_dates()   C
last analyzed

Complexity

Conditions 15
Paths 20

Size

Total Lines 71
Code Lines 40

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 40
c 1
b 0
f 0
dl 0
loc 71
rs 5.9166
cc 15
nc 20
nop 3

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * Template Tags
4
 *
5
 * @package tour-operator
6
 * @license GPL-3.0+
7
 */
8
9
/**
10
 * Outputs the posts attached special
11
 *
12
 * @package 	to-specials
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 	special
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_special_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_special_posts() {
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for function lsx_to_special_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'		=> 'special',
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-specials' ) . '</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 2 blank lines after function; 0 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 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    tour-operator
36
 * @subpackage template-tag
37
 * @category   to-specials
38
 */
39
function lsx_to_special_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_special_content', $slug, $name );
41
}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
42
43
/**
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...
44
 * Outputs the terms and conditions.
45
 *
46
 * @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...
47
 * @param  $after | string
0 ignored issues
show
Coding Style introduced by
Missing parameter name
Loading history...
48
 * @param  $echo | boolean
0 ignored issues
show
Coding Style introduced by
Missing parameter name
Loading history...
49
 * @return string
0 ignored issues
show
Coding Style introduced by
Function return type is not void, but function has no return statement
Loading history...
50
 *
51
 * @package    tour-operator
52
 * @subpackage template-tag
53
 * @category   to-specials
54
 */
55
function lsx_to_specials_terms_conditions( $before = '', $after = '', $echo = true ) {
56
	lsx_to_custom_field_query( 'terms_conditions', $before, $after, $echo );
57
}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
58
59
/**
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...
60
 * Outputs the travel dates.
61
 *
62
 * @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...
63
 * @param  $after | string
0 ignored issues
show
Coding Style introduced by
Missing parameter name
Loading history...
64
 * @param  $echo | boolean
0 ignored issues
show
Coding Style introduced by
Missing parameter name
Loading history...
65
 * @return string
66
 *
67
 * @package    tour-operator
68
 * @subpackage template-tag
69
 * @category   to-specials
70
 */
71
function lsx_to_travel_dates( $before = '', $after = '', $echo = true ) {
72
	// --- START: [legacy] migrate content from old fields to new repeatable fields (grouped fields)
73
74
	$start = get_post_meta( get_the_ID(), 'travel_dates_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

74
	$start = get_post_meta( /** @scrutinizer ignore-type */ get_the_ID(), 'travel_dates_start', true );
Loading history...
75
	$end = get_post_meta( get_the_ID(), 'travel_dates_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...
76
77
	if ( ! empty( $start ) && ! empty( $end ) ) {
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...
78
		$start = date( 'M j, Y', strtotime( $start ) );
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...
79
		$end = date( 'M j, Y', strtotime( $end ) );
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...
introduced by
date() is affected by runtime timezone changes which can cause date/time to be incorrectly displayed. Use gmdate() instead.
Loading history...
80
81
		$new_field = array(
82
			'travel_dates_start' => $start,
83
			'travel_dates_end'   => $end,
84
		);
85
86
		delete_post_meta( get_the_ID(), 'travel_dates' );
0 ignored issues
show
Bug introduced by
It seems like get_the_ID() can also be of type false; however, parameter $post_id of delete_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

86
		delete_post_meta( /** @scrutinizer ignore-type */ get_the_ID(), 'travel_dates' );
Loading history...
87
		update_post_meta( get_the_ID(), 'travel_dates', $new_field );
0 ignored issues
show
Bug introduced by
It seems like get_the_ID() can also be of type false; however, parameter $post_id of update_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

87
		update_post_meta( /** @scrutinizer ignore-type */ get_the_ID(), 'travel_dates', $new_field );
Loading history...
88
89
		delete_post_meta( get_the_ID(), 'travel_dates_start' );
90
		delete_post_meta( get_the_ID(), 'travel_dates_end' );
91
	}
92
93
	// --- END: [legacy] migrate content from old fields to new repeatable fields (grouped fields)
94
95
	$return = '';
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...
96
	$multiple = false;
97
	$dates = get_post_meta( get_the_ID(), 'travel_dates', false );
0 ignored issues
show
Coding Style introduced by
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.

Loading history...
98
99
	if ( is_array( $dates ) && ! empty( $dates ) ) {
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...
100
		foreach ( $dates as $key => $value ) {
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...
101
			$start = false;
102
			$end = false;
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...
103
104
			if ( isset( $value['travel_dates_start'] ) ) {
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
				$start = $value['travel_dates_start'];
106
			}
107
108
			if ( isset( $value['travel_dates_end'] ) ) {
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...
109
				$end = $value['travel_dates_end'];
110
			}
111
112
			if ( ! empty( $start ) ) {
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...
113
				$start = date( 'd M Y', strtotime( $start ) );
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...
114
			}
115
116
			if ( ! empty( $end ) ) {
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...
117
				$start .= ' - ' . date( 'd M Y', strtotime( $end ) );
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...
118
			}
119
120
			if ( ! empty( $start ) ) {
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...
121
				if ( ! empty( $return ) ) {
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...
122
					$multiple = true;
123
					$return .= '<br>';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 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...
124
				}
125
126
				$return .= $start;
127
			}
128
		}
129
	}
130
131
	if ( ! empty( $return ) ) {
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...
132
		if ( true === $multiple ) {
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...
133
			$return = '<br>' . $return;
134
		}
135
136
		$return = $before . $return . $after;
137
138
		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...
139
			echo wp_kses_post( $return );
140
		} else {
141
			return $return;
142
		}
143
	}
144
}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
145
146
/**
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...
147
 * Outputs the specials validity.
148
 *
149
 * @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...
150
 * @param  $after | string
0 ignored issues
show
Coding Style introduced by
Missing parameter name
Loading history...
151
 * @param  $echo | boolean
0 ignored issues
show
Coding Style introduced by
Missing parameter name
Loading history...
152
 * @return string
153
 *
154
 * @package    tour-operator
155
 * @subpackage template-tag
156
 * @category   to-specials
157
 */
158
function lsx_to_specials_validity( $before = '', $after = '', $echo = true ) {
159
	// $valid_from = get_the_date( 'M j, Y', get_the_ID() );
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.

Loading history...
160
	// $valid_to = get_post_meta( get_the_ID(), '_expiration-date', true );
161
162
	$valid_from = get_post_meta( get_the_ID(), 'booking_validity_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

162
	$valid_from = get_post_meta( /** @scrutinizer ignore-type */ get_the_ID(), 'booking_validity_start', true );
Loading history...
163
	$valid_to = get_post_meta( get_the_ID(), 'booking_validity_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...
164
165
	if ( ! empty( $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...
166
		$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...
167
	}
168
169
	if ( ! empty( $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...
170
		$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...
171
	}
172
173
	if ( ! empty( $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...
174
		$return = $before . $valid_from . $after;
175
176
		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...
177
			echo wp_kses_post( $return );
178
		} else {
179
			return $return;
180
		}
181
	}
182
}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
183
184
/**
185
 * Outputs the connected specials for an accommodation
186
 *
187
 * @package 	lsx-tour-operators
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
188
 * @subpackage	template-tags
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
189
 * @category 	special
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
190
 */
191
function lsx_to_accommodation_specials() {
192
	global $lsx_archive;
193
194
	if ( post_type_exists( 'special' ) && 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...
195
		$args = array(
196
			'from'		=> 'special',
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...
197
			'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...
198
			'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...
199
			'before'	=> '<section id="special" 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( 'special', '', 'Featured Specials' ), 'to-specials' ) . '</h2><div id="collapse-special" 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( 'special', '', 'Featured Specials' )".
Loading history...
200
			'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...
201
		);
202
203
		lsx_to_connected_panel_query( $args );
204
	}
205
}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
206
207
/**
208
 * Outputs the connected specials for a tour
209
 *
210
 * @package 	lsx-tour-operators
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
211
 * @subpackage	template-tags
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
212
 * @category 	special
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
213
 */
214
function lsx_to_tour_specials() {
215
	global $lsx_archive;
216
217
	if ( post_type_exists( 'special' ) && 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...
218
		$args = array(
219
			'from'		=> 'special',
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...
220
			'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...
221
			'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...
222
			'before'	=> '<section id="special" 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( 'special', '', 'Featured Specials' ), 'to-specials' ) . '</h2><div id="collapse-special" 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( 'special', '', 'Featured Specials' )".
Loading history...
223
			'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...
224
		);
225
226
		lsx_to_connected_panel_query( $args );
227
	}
228
}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
229
230
/**
231
 * Outputs the connected specials for a destination
232
 *
233
 * @package 	lsx-tour-operators
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
234
 * @subpackage	template-tags
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
235
 * @category 	special
0 ignored issues
show
introduced by
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
236
 */
237
function lsx_to_destination_specials() {
238
	global $lsx_archive;
239
240
	if ( post_type_exists( 'special' ) && 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...
241
		$args = array(
242
			'from'		=> 'special',
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...
243
			'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...
244
			'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...
245
			'before'	=> '<section id="special" 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( 'special', '', 'Featured Specials' ), 'to-specials' ) . '</h2><div id="collapse-special" 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( 'special', '', 'Featured Specials' )".
Loading history...
246
			'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...
247
		);
248
249
		lsx_to_connected_panel_query( $args );
250
	}
251
}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
252