Issues (1082)

includes/metaboxes/config-team.php (86 issues)

1
<?php
2
/**
3
 * Tour Operator - Team Metabox config
4
 *
5
 * @package   tour_operator
6
 * @author    LightSpeed
7
 * @license   GPL-2.0+
8
 * @link
9
 * @copyright 2017 LightSpeedDevelopment
10
 */
11
12
global $lsx_to_team;
13
14
$metabox = array(
15
	'title'  => esc_html__( 'Tour Operator Plugin', 'to-team' ),
16
	'pages'  => 'team',
17
	'fields' => array(),
18
);
19
20
$metabox['fields'][] = array(
21
	'id'   => 'featured',
22
	'name' => esc_html__( 'Featured', 'to-team' ),
23
	'type' => 'checkbox',
24
);
25
26
$metabox['fields'][] = array(
27
	'id'   => 'disable_single',
28
	'name' => esc_html__( 'Disable Single', 'to-team' ),
29
	'type' => 'checkbox',
30
);
31
32
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...
33
	$metabox['fields'][] = array(
34
		'id'   => 'tagline',
35
		'name' => esc_html__( 'Tagline', 'to-team' ),
36
		'type' => 'text',
37
	);
38
}
39
40
$metabox['fields'][] = array(
41
	'id'	=> 'role',
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...
42
	'name'	=> esc_html__( 'Role', 'to-team' ),
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...
43
	'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...
44
);
45
46
$metabox['fields'][] = array(
47
	'name' => esc_html__( 'Site User', 'to-team' ),
0 ignored issues
show
Array double arrow not aligned correctly; expected 7 space(s) between "'name'" and double arrow, but found 1.
Loading history...
48
	'id' => 'site_user',
0 ignored issues
show
Array double arrow not aligned correctly; expected 9 space(s) between "'id'" and double arrow, but found 1.
Loading history...
49
	'allow_none' => true,
50
	'type' => 'select',
0 ignored issues
show
Array double arrow not aligned correctly; expected 7 space(s) between "'type'" and double arrow, but found 1.
Loading history...
51
	'options' => $lsx_to_team->site_users,
0 ignored issues
show
Array double arrow not aligned correctly; expected 4 space(s) between "'options'" and double arrow, but found 1.
Loading history...
52
);
53
54
$metabox['fields'][] = array(
55
	'id'	=> 'contact_title',
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...
56
	'name'	=> esc_html__( 'Contact', 'to-team' ),
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...
57
	'type'	=> 'title',
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...
58
);
59
60
$metabox['fields'][] = array(
61
	'id'	=> 'contact_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...
62
	'name'	=> esc_html__( 'Email', 'to-team' ),
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...
63
	'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...
64
);
65
66
$metabox['fields'][] = array(
67
	'id'	=> 'contact_number',
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...
68
	'name'	=> esc_html__( 'Number (international format)', 'to-team' ),
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...
69
	'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...
70
);
71
72
$metabox['fields'][] = array(
73
	'id'	=> 'skype',
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...
74
	'name'	=> esc_html__( 'Skype', 'to-team' ),
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...
75
	'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...
76
);
77
78
$metabox['fields'][] = array(
79
	'id'	=> 'social_title',
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...
80
	'name'	=> esc_html__( 'Social Profiles', 'to-team' ),
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...
81
	'type'	=> 'title',
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...
82
);
83
84
$metabox['fields'][] = array(
85
	'id'	=> 'facebook',
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...
86
	'name'	=> esc_html__( 'Facebook', 'to-team' ),
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...
87
	'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...
88
);
89
90
$metabox['fields'][] = array(
91
	'id'	=> 'twitter',
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...
92
	'name'	=> esc_html__( 'Twitter', 'to-team' ),
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...
93
	'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...
94
);
95
96
$metabox['fields'][] = array(
97
	'id'	=> 'googleplus',
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...
98
	'name'	=> esc_html__( 'Google Plus', 'to-team' ),
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...
99
	'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...
100
);
101
102
$metabox['fields'][] = array(
103
	'id'	=> 'linkedin',
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...
104
	'name'	=> esc_html__( 'LinkedIn', 'to-team' ),
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...
105
	'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...
106
);
107
108
$metabox['fields'][] = array(
109
	'id'	=> 'pinterest',
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...
110
	'name'	=> esc_html__( 'Pinterest', 'to-team' ),
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...
111
	'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...
112
);
113
114
$metabox['fields'][] = array(
115
	'id'   => 'gallery_title',
116
	'name' => esc_html__( 'Gallery', 'to-team' ),
117
	'type' => 'title',
118
);
119
120
$metabox['fields'][] = array(
121
	'id'                  => 'gallery',
122
	'name'                => '',
123
	'type'                => 'image',
124
	'repeatable'          => true,
125
	'show_size'           => false,
126
	'sortable'            => true,
127
	'string-repeat-field' => esc_html__( 'Add new image', 'tour-operator' ),
128
);
129
130
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...
131
	$metabox['fields'][] = array(
132
		'id'   => 'envira_title',
133
		'name' => esc_html__( 'Envira Gallery', 'to-team' ),
134
		'type' => 'title',
135
	);
136
137
	$metabox['fields'][] = array(
138
		'id'         => 'envira_gallery',
139
		'name'       => esc_html__( 'Envira Gallery', 'to-team' ),
140
		'type'       => 'post_select',
141
		'use_ajax'   => false,
142
		'allow_none' => true,
143
		'query'      => array(
144
			'post_type'      => 'envira',
145
			'nopagin'        => true,
146
			'posts_per_page' => '-1',
147
			'orderby'        => 'title',
148
			'order'          => 'ASC',
149
		),
150
	);
151
152
	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...
153
		$metabox['fields'][] = array(
154
			'id'         => 'envira_video',
155
			'name'       => esc_html__( 'Envira Video Gallery', 'to-team' ),
156
			'type'       => 'post_select',
157
			'use_ajax'   => false,
158
			'allow_none' => true,
159
			'query'      => array(
160
				'post_type'      => 'envira',
161
				'nopagin'        => true,
162
				'posts_per_page' => '-1',
163
				'orderby'        => 'title',
164
				'order'          => 'ASC',
165
			),
166
		);
167
	}
168
}
169
170
$post_types = array(
171
	'accommodation'		=> esc_html__( 'Accommodation', 'to-team' ),
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 "'accommodation'" and double arrow, but found 5.
Loading history...
172
	'destination'		=> esc_html__( 'Destinations', 'to-team' ),
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 "'destination'" and double arrow, but found 7.
Loading history...
173
	'tour'				=> esc_html__( 'Tours', 'to-team' ),
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 10 space(s) between "'tour'" and double arrow, but found 14.
Loading history...
174
	'post'				=> esc_html__( 'Posts', 'to-team' ),
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 10 space(s) between "'post'" and double arrow, but found 14.
Loading history...
175
);
176
177
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...
178
	$metabox['fields'][] = array(
179
		'id'   => $slug . '_title',
180
		'name' => $label,
181
		'type' => 'title',
182
	);
183
184
	$metabox['fields'][] = array(
185
		'id'         => $slug . '_to_team',
186
		'name'       => $label . esc_html__( ' related with this team', 'to-team' ),
187
		'type'       => 'post_select',
188
		'use_ajax'   => false,
189
		'repeatable' => true,
190
		'allow_none' => true,
191
		'query'      => array(
192
			'post_type'      => $slug,
193
			'nopagin'        => true,
194
			'posts_per_page' => '-1',
195
			'orderby'        => 'title',
196
			'order'          => 'ASC',
197
		),
198
	);
199
}
200
201
$metabox['fields'] = apply_filters( 'lsx_to_team_custom_fields', $metabox['fields'] );
202
203
return $metabox;
204