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
Coding Style
introduced
by
![]() |
|||
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
|
|||
42 | 'name' => esc_html__( 'Role', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
43 | 'type' => 'text', |
||
0 ignored issues
–
show
|
|||
44 | ); |
||
45 | |||
46 | $metabox['fields'][] = array( |
||
47 | 'name' => esc_html__( 'Site User', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
48 | 'id' => 'site_user', |
||
0 ignored issues
–
show
|
|||
49 | 'allow_none' => true, |
||
50 | 'type' => 'select', |
||
0 ignored issues
–
show
|
|||
51 | 'options' => $lsx_to_team->site_users, |
||
0 ignored issues
–
show
|
|||
52 | ); |
||
53 | |||
54 | $metabox['fields'][] = array( |
||
55 | 'id' => 'contact_title', |
||
0 ignored issues
–
show
|
|||
56 | 'name' => esc_html__( 'Contact', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
57 | 'type' => 'title', |
||
0 ignored issues
–
show
|
|||
58 | ); |
||
59 | |||
60 | $metabox['fields'][] = array( |
||
61 | 'id' => 'contact_email', |
||
0 ignored issues
–
show
|
|||
62 | 'name' => esc_html__( 'Email', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
63 | 'type' => 'text', |
||
0 ignored issues
–
show
|
|||
64 | ); |
||
65 | |||
66 | $metabox['fields'][] = array( |
||
67 | 'id' => 'contact_number', |
||
0 ignored issues
–
show
|
|||
68 | 'name' => esc_html__( 'Number (international format)', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
69 | 'type' => 'text', |
||
0 ignored issues
–
show
|
|||
70 | ); |
||
71 | |||
72 | $metabox['fields'][] = array( |
||
73 | 'id' => 'skype', |
||
0 ignored issues
–
show
|
|||
74 | 'name' => esc_html__( 'Skype', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
75 | 'type' => 'text', |
||
0 ignored issues
–
show
|
|||
76 | ); |
||
77 | |||
78 | $metabox['fields'][] = array( |
||
79 | 'id' => 'social_title', |
||
0 ignored issues
–
show
|
|||
80 | 'name' => esc_html__( 'Social Profiles', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
81 | 'type' => 'title', |
||
0 ignored issues
–
show
|
|||
82 | ); |
||
83 | |||
84 | $metabox['fields'][] = array( |
||
85 | 'id' => 'facebook', |
||
0 ignored issues
–
show
|
|||
86 | 'name' => esc_html__( 'Facebook', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
87 | 'type' => 'text', |
||
0 ignored issues
–
show
|
|||
88 | ); |
||
89 | |||
90 | $metabox['fields'][] = array( |
||
91 | 'id' => 'twitter', |
||
0 ignored issues
–
show
|
|||
92 | 'name' => esc_html__( 'Twitter', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
93 | 'type' => 'text', |
||
0 ignored issues
–
show
|
|||
94 | ); |
||
95 | |||
96 | $metabox['fields'][] = array( |
||
97 | 'id' => 'googleplus', |
||
0 ignored issues
–
show
|
|||
98 | 'name' => esc_html__( 'Google Plus', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
99 | 'type' => 'text', |
||
0 ignored issues
–
show
|
|||
100 | ); |
||
101 | |||
102 | $metabox['fields'][] = array( |
||
103 | 'id' => 'linkedin', |
||
0 ignored issues
–
show
|
|||
104 | 'name' => esc_html__( 'LinkedIn', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
105 | 'type' => 'text', |
||
0 ignored issues
–
show
|
|||
106 | ); |
||
107 | |||
108 | $metabox['fields'][] = array( |
||
109 | 'id' => 'pinterest', |
||
0 ignored issues
–
show
|
|||
110 | 'name' => esc_html__( 'Pinterest', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
111 | 'type' => 'text', |
||
0 ignored issues
–
show
|
|||
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
|
|||
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
|
|||
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
|
|||
172 | 'destination' => esc_html__( 'Destinations', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
173 | 'tour' => esc_html__( 'Tours', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
174 | 'post' => esc_html__( 'Posts', 'to-team' ), |
||
0 ignored issues
–
show
|
|||
175 | ); |
||
176 | |||
177 | foreach ( $post_types as $slug => $label ) { |
||
0 ignored issues
–
show
|
|||
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 |