Issues (1057)

includes/metaboxes/config-review.php (63 issues)

1
<?php
2
/**
3
 * Tour Operator - Review Metabox config
4
 *
5
 * @package   tour_operator
6
 * @author    LightSpeed
7
 * @license   GPL-2.0+
8
 * @link
9
 * @copyright 2017 LightSpeedDevelopment
10
 */
11
12
$metabox = array(
13
	'title'  => esc_html__( 'Tour Operator Plugin', 'to-reviews' ),
14
	'pages'  => 'review',
15
	'fields' => array(),
16
);
17
18
$metabox['fields'][] = array(
19
	'id'   => 'featured',
20
	'name' => esc_html__( 'Featured', 'to-reviews' ),
21
	'type' => 'checkbox',
22
);
23
24
$metabox['fields'][] = array(
25
	'id'   => 'disable_single',
26
	'name' => esc_html__( 'Disable Single', 'to-reviews' ),
27
	'type' => 'checkbox',
28
);
29
30
if ( ! class_exists( 'LSX_Banners' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
31
	$metabox['fields'][] = array(
32
		'id'   => 'tagline',
33
		'name' => esc_html__( 'Tagline', 'to-reviews' ),
34
		'type' => 'text',
35
	);
36
}
37
38
$metabox['fields'][] = array(
39
	'id'	=> 'no_adults',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 3 space(s) between "'id'" and double arrow, but found 4.
Loading history...
40
	'name'	=> esc_html__( 'No of Adults', 'to-reviews' ),
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'name'" and double arrow, but found 2.
Loading history...
41
	'type'	=> 'text',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'type'" and double arrow, but found 2.
Loading history...
42
	'cols'	=> 6,
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'cols'" and double arrow, but found 2.
Loading history...
43
);
44
45
$metabox['fields'][] = array(
46
	'id'	=> 'no_children',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 3 space(s) between "'id'" and double arrow, but found 4.
Loading history...
47
	'name'	=> esc_html__( 'No of Children', 'to-reviews' ),
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'name'" and double arrow, but found 2.
Loading history...
48
	'type'	=> 'text',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'type'" and double arrow, but found 2.
Loading history...
49
	'cols'	=> 6,
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'cols'" and double arrow, but found 2.
Loading history...
50
);
51
52
$metabox['fields'][] = array(
53
	'id'	=> 'reviewer_name',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 3 space(s) between "'id'" and double arrow, but found 4.
Loading history...
54
	'name'	=> esc_html__( 'Reviewer Name', 'to-reviews' ),
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'name'" and double arrow, but found 2.
Loading history...
55
	'type'	=> 'text',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'type'" and double arrow, but found 2.
Loading history...
56
	'cols'	=> 6,
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'cols'" and double arrow, but found 2.
Loading history...
57
);
58
59
$metabox['fields'][] = array(
60
	'id'	=> 'reviewer_email',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 3 space(s) between "'id'" and double arrow, but found 4.
Loading history...
61
	'name'	=> esc_html__( 'Reviewer Email', 'to-reviews' ),
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'name'" and double arrow, but found 2.
Loading history...
62
	'type'	=> 'text',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'type'" and double arrow, but found 2.
Loading history...
63
	'cols'	=> 6,
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'cols'" and double arrow, but found 2.
Loading history...
64
);
65
66
$metabox['fields'][] = array(
67
	'id'		 => 'rating',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
68
	'name'		 => esc_html__( 'Rating', 'to-reviews' ),
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
69
	'type'		 => 'radio',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
70
	'options'	 => array( '0', '1', '2', '3', '4', '5' ),
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
71
	'allow_none' => true,
72
);
73
$metabox['fields'][] = array(
74
	'id'	=> 'date_of_visit_start',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 3 space(s) between "'id'" and double arrow, but found 4.
Loading history...
75
	'name'	=> esc_html__( 'Date of visit', 'to-reviews' ),
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'name'" and double arrow, but found 2.
Loading history...
76
	'type'	=> 'date',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'type'" and double arrow, but found 2.
Loading history...
77
	'cols'	=> 6,
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'cols'" and double arrow, but found 2.
Loading history...
78
);
79
80
$metabox['fields'][] = array(
81
	'id'	=> 'date_of_visit_end',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 3 space(s) between "'id'" and double arrow, but found 4.
Loading history...
82
	'name'	=> '',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'name'" and double arrow, but found 2.
Loading history...
83
	'type'	=> 'date',
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'type'" and double arrow, but found 2.
Loading history...
84
	'cols'	=> 6,
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Array double arrow not aligned correctly; expected 1 space(s) between "'cols'" and double arrow, but found 2.
Loading history...
85
);
86
87
if ( class_exists( 'LSX_TO_Team' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
88
	$metabox['fields'][] = array(
89
		'id'         => 'team_to_review',
90
		'name'       => esc_html__( 'Reviewed By', 'to-reviews' ),
91
		'type'       => 'post_select',
92
		'use_ajax'   => false,
93
		'allow_none' => true,
94
		'query'      => array(
95
			'post_type'      => 'team',
96
			'nopagin'        => true,
97
			'posts_per_page' => 1000,
0 ignored issues
show
Detected high pagination limit, posts_per_page is set to 1000
Loading history...
98
			'orderby'        => 'title',
99
			'order'          => 'ASC',
100
		),
101
	);
102
}
103
104
$metabox['fields'][] = array(
105
	'id'   => 'gallery_title',
106
	'name' => esc_html__( 'Gallery', 'to-reviews' ),
107
	'type' => 'title',
108
);
109
110
$metabox['fields'][] = array(
111
	'id'                  => 'gallery',
112
	'name'                => '',
113
	'type'                => 'image',
114
	'repeatable'          => true,
115
	'show_size'           => false,
116
	'sortable'            => true,
117
	'string-repeat-field' => esc_html__( 'Add new image', 'tour-operator' ),
118
);
119
120
if ( class_exists( 'Envira_Gallery' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
121
	$metabox['fields'][] = array(
122
		'id'   => 'envira_title',
123
		'name' => esc_html__( 'Envira Gallery', 'to-reviews' ),
124
		'type' => 'title',
125
	);
126
127
	$metabox['fields'][] = array(
128
		'id'         => 'envira_gallery',
129
		'name'       => esc_html__( 'Envira Gallery', 'to-reviews' ),
130
		'type'       => 'post_select',
131
		'use_ajax'   => false,
132
		'allow_none' => true,
133
		'query'      => array(
134
			'post_type'      => 'envira',
135
			'nopagin'        => true,
136
			'posts_per_page' => '-1',
137
			'orderby'        => 'title',
138
			'order'          => 'ASC',
139
		),
140
	);
141
142
	if ( class_exists( 'Envira_Videos' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
143
		$metabox['fields'][] = array(
144
			'id'         => 'envira_video',
145
			'name'       => esc_html__( 'Envira Video Gallery', 'to-reviews' ),
146
			'type'       => 'post_select',
147
			'use_ajax'   => false,
148
			'allow_none' => true,
149
			'query'      => array(
150
				'post_type'      => 'envira',
151
				'nopagin'        => true,
152
				'posts_per_page' => '-1',
153
				'orderby'        => 'title',
154
				'order'          => 'ASC',
155
			),
156
		);
157
	}
158
}
159
160
$post_types = array(
161
	'post'          => esc_html__( 'Posts', 'to-reviews' ),
162
	'accommodation' => esc_html__( 'Accommodation', 'to-reviews' ),
163
	'destination'   => esc_html__( 'Destinations', 'to-reviews' ),
164
	'tour'          => esc_html__( 'Tours', 'to-reviews' ),
165
);
166
167
foreach ( $post_types as $slug => $label ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
168
	$metabox['fields'][] = array(
169
		'id'   => $slug . '_title',
170
		'name' => $label,
171
		'type' => 'title',
172
	);
173
174
	$metabox['fields'][] = array(
175
		'id'         => $slug . '_to_review',
176
		'name'       => $label . esc_html__( ' related with this review', 'to-reviews' ),
177
		'type'       => 'post_select',
178
		'use_ajax'   => false,
179
		'repeatable' => true,
180
		'allow_none' => true,
181
		'query'      => array(
182
			'post_type'      => $slug,
183
			'nopagin'        => true,
184
			'posts_per_page' => '-1',
185
			'orderby'        => 'title',
186
			'order'          => 'ASC',
187
		),
188
	);
189
}
190
191
$metabox['fields'] = apply_filters( 'lsx_to_review_custom_fields', $metabox['fields'] );
192
193
return $metabox;
194