|
9 | 9 | * @copyright 2017 LightSpeedDevelopment |
10 | 10 | */ |
11 | 11 |
|
12 | | -$metabox = array( |
| 12 | +if ( ! defined( 'ABSPATH' ) ) { |
| 13 | + exit; |
| 14 | +} |
| 15 | + |
| 16 | +$to_reviews_metabox = array( |
13 | 17 | 'title' => esc_html__( 'Tour Operator Plugin', 'to-reviews' ), |
14 | 18 | 'pages' => 'review', |
15 | 19 | 'fields' => array(), |
16 | 20 | ); |
17 | 21 |
|
18 | 22 | if ( ! class_exists( 'LSX_Banners' ) ) { |
19 | | - $metabox['fields'][] = array( |
| 23 | + $to_reviews_metabox['fields'][] = array( |
20 | 24 | 'id' => 'tagline', |
21 | 25 | 'name' => esc_html__( 'Tagline', 'to-reviews' ), |
22 | 26 | 'type' => 'text', |
23 | 27 | ); |
24 | 28 | } |
25 | 29 |
|
26 | | -$metabox['fields'][] = array( |
| 30 | +$to_reviews_metabox['fields'][] = array( |
27 | 31 | 'id' => 'no_adults', |
28 | 32 | 'name' => esc_html__( 'No of Adults', 'to-reviews' ), |
29 | 33 | 'type' => 'text', |
30 | 34 | 'cols' => 6, |
31 | 35 | ); |
32 | 36 |
|
33 | | -$metabox['fields'][] = array( |
| 37 | +$to_reviews_metabox['fields'][] = array( |
34 | 38 | 'id' => 'no_children', |
35 | 39 | 'name' => esc_html__( 'No of Children', 'to-reviews' ), |
36 | 40 | 'type' => 'text', |
37 | 41 | 'cols' => 6, |
38 | 42 | ); |
39 | 43 |
|
40 | | -$metabox['fields'][] = array( |
| 44 | +$to_reviews_metabox['fields'][] = array( |
41 | 45 | 'id' => 'reviewer_name', |
42 | 46 | 'name' => esc_html__( 'Reviewer Name', 'to-reviews' ), |
43 | 47 | 'type' => 'text', |
44 | 48 | 'cols' => 6, |
45 | 49 | ); |
46 | 50 |
|
47 | | -$metabox['fields'][] = array( |
| 51 | +$to_reviews_metabox['fields'][] = array( |
48 | 52 | 'id' => 'reviewer_email', |
49 | 53 | 'name' => esc_html__( 'Reviewer Email', 'to-reviews' ), |
50 | 54 | 'type' => 'text', |
51 | 55 | 'cols' => 6, |
52 | 56 | ); |
53 | 57 |
|
54 | | -$metabox['fields'][] = array( |
| 58 | +$to_reviews_metabox['fields'][] = array( |
55 | 59 | 'id' => 'rating', |
56 | 60 | 'name' => esc_html__( 'Rating', 'to-reviews' ), |
57 | 61 | 'type' => 'select', |
58 | 62 | 'options' => array( '0', '1', '2', '3', '4', '5' ), |
59 | 63 | 'allow_none' => true, |
60 | 64 | ); |
61 | | -$metabox['fields'][] = array( |
| 65 | +$to_reviews_metabox['fields'][] = array( |
62 | 66 | 'id' => 'date_of_visit_start', |
63 | 67 | 'name' => esc_html__( 'Start date of visit', 'to-reviews' ), |
64 | 68 | 'type' => 'text_date_timestamp', |
65 | 69 | 'cols' => 6, |
66 | 70 | ); |
67 | 71 |
|
68 | | -$metabox['fields'][] = array( |
| 72 | +$to_reviews_metabox['fields'][] = array( |
69 | 73 | 'id' => 'date_of_visit_end', |
70 | 74 | 'name' => esc_html__( 'End date of visit', 'to-reviews' ), |
71 | 75 | 'type' => 'text_date_timestamp', |
72 | 76 | 'cols' => 6, |
73 | 77 | ); |
74 | 78 |
|
75 | 79 | if ( class_exists( 'LSX_TO_Team' ) ) { |
76 | | - $metabox['fields'][] = array( |
| 80 | + $to_reviews_metabox['fields'][] = array( |
77 | 81 | 'id' => 'team_to_review', |
78 | 82 | 'name' => esc_html__( 'Reviewed By', 'to-reviews' ), |
79 | 83 | 'type' => 'pw_multiselect', |
|
85 | 89 | ); |
86 | 90 | } |
87 | 91 |
|
88 | | -$metabox['fields'][] = array( |
| 92 | +$to_reviews_metabox['fields'][] = array( |
89 | 93 | 'id' => 'gallery_title', |
90 | 94 | 'name' => esc_html__( 'Gallery', 'to-reviews' ), |
91 | 95 | 'type' => 'title', |
92 | 96 | ); |
93 | 97 |
|
94 | | -$metabox['fields'][] = array( |
| 98 | +$to_reviews_metabox['fields'][] = array( |
95 | 99 | 'name' => esc_html__( 'Gallery', 'to-reviews' ), |
96 | 100 | 'desc' => esc_html__( 'Add images related to the review to be displayed in the Reviews\'s gallery.', 'to-reviews' ), |
97 | 101 | 'id' => 'gallery', |
|
103 | 107 | ), |
104 | 108 | ); |
105 | 109 |
|
106 | | -$metabox['fields'][] = array( |
| 110 | +$to_reviews_metabox['fields'][] = array( |
107 | 111 | 'id' => 'related_title', |
108 | 112 | 'name' => esc_html__( 'Related', 'to-reviews' ), |
109 | 113 | 'type' => 'title', |
110 | 114 | ); |
111 | 115 |
|
112 | | -$post_types = array( |
| 116 | +$to_reviews_post_types = array( |
113 | 117 | 'post' => esc_html__( 'Posts', 'to-reviews' ), |
114 | 118 | 'accommodation' => esc_html__( 'Accommodation', 'to-reviews' ), |
115 | 119 | 'destination' => esc_html__( 'Destinations', 'to-reviews' ), |
116 | 120 | 'tour' => esc_html__( 'Tours', 'to-reviews' ), |
117 | 121 | ); |
118 | 122 |
|
119 | | -foreach ( $post_types as $slug => $label ) { |
120 | | - $metabox['fields'][] = array( |
121 | | - 'id' => $slug . '_to_review', |
122 | | - 'name' => $label . esc_html__( ' related with this review', 'to-reviews' ), |
| 123 | +foreach ( $to_reviews_post_types as $to_reviews_slug => $to_reviews_label ) { |
| 124 | + $to_reviews_metabox['fields'][] = array( |
| 125 | + 'id' => $to_reviews_slug . '_to_review', |
| 126 | + 'name' => $to_reviews_label . esc_html__( ' related with this review', 'to-reviews' ), |
123 | 127 | 'type' => 'pw_multiselect', |
124 | 128 | 'use_ajax' => false, |
125 | 129 | 'repeatable' => false, |
126 | 130 | 'allow_none' => true, |
127 | 131 | 'options' => array( |
128 | | - 'post_type_args' => $slug, |
| 132 | + 'post_type_args' => $to_reviews_slug, |
129 | 133 | ), |
130 | 134 | ); |
131 | 135 | } |
132 | 136 |
|
133 | | -$metabox['fields'] = apply_filters( 'lsx_to_review_custom_fields', $metabox['fields'] ); |
| 137 | +$to_reviews_metabox['fields'] = apply_filters( 'lsx_to_review_custom_fields', $to_reviews_metabox['fields'] ); |
134 | 138 |
|
135 | | -return $metabox; |
| 139 | +return $to_reviews_metabox; |
0 commit comments