PluginProbe ʕ •ᴥ•ʔ
Secure Custom Fields / 6.4.0-beta2
Secure Custom Fields v6.4.0-beta2
6.9.5 6.9.4 6.9.3 6.9.2 6.9.1 6.9.0 6.8.9 6.8.7 6.8.8 6.8.6 6.8.4 6.8.5 trunk 6.4.0-beta1 6.4.0-beta2 6.4.1 6.4.1-beta3 6.4.1-beta4 6.4.1-beta5 6.4.1-beta6 6.4.1-beta7 6.4.2 6.5.0 6.5.1 6.5.2 6.5.3 6.5.4 6.5.5 6.5.6 6.5.7 6.6.0 6.7.0 6.7.1 6.8.0 6.8.1 6.8.2 6.8.3
secure-custom-fields / includes / admin / views / acf-field-group / options.php
secure-custom-fields / includes / admin / views / acf-field-group Last commit date
conditional-logic.php 1 year ago field.php 1 year ago fields.php 1 year ago index.php 1 year ago list-empty.php 1 year ago location-group.php 1 year ago location-rule.php 1 year ago locations.php 1 year ago options.php 1 year ago
options.php
298 lines
1 <?php
2
3 // global
4 global $field_group;
5
6 // UI needs at lease 1 location rule
7 if ( empty( $field_group['location'] ) ) {
8 $field_group['location'] = array(
9 // Group 0.
10 array(
11 // Rule 0.
12 array(
13 'param' => 'post_type',
14 'operator' => '==',
15 'value' => 'post',
16 ),
17 ),
18 );
19
20 $acf_use_post_type = acf_get_post_type_from_request_args( 'add-fields' );
21 $acf_use_taxonomy = acf_get_taxonomy_from_request_args( 'add-fields' );
22 $acf_use_options_page = acf_get_ui_options_page_from_request_args( 'add-fields' );
23
24 if ( $acf_use_post_type && ! empty( $acf_use_post_type['post_type'] ) ) {
25 $field_group['location'] = array(
26 array(
27 array(
28 'param' => 'post_type',
29 'operator' => '==',
30 'value' => $acf_use_post_type['post_type'],
31 ),
32 ),
33 );
34 }
35
36 if ( $acf_use_taxonomy && ! empty( $acf_use_taxonomy['taxonomy'] ) ) {
37 $field_group['location'] = array(
38 array(
39 array(
40 'param' => 'taxonomy',
41 'operator' => '==',
42 'value' => $acf_use_taxonomy['taxonomy'],
43 ),
44 ),
45 );
46 }
47
48 if ( $acf_use_options_page && ! empty( $acf_use_options_page['menu_slug'] ) ) {
49 $field_group['location'] = array(
50 array(
51 array(
52 'param' => 'options_page',
53 'operator' => '==',
54 'value' => $acf_use_options_page['menu_slug'],
55 ),
56 ),
57 );
58 }
59 }
60
61 foreach ( acf_get_combined_field_group_settings_tabs() as $tab_key => $tab_label ) {
62 acf_render_field_wrap(
63 array(
64 'type' => 'tab',
65 'label' => $tab_label,
66 'key' => 'acf_field_group_settings_tabs',
67 'settings-type' => $tab_key,
68 )
69 );
70
71 switch ( $tab_key ) {
72 case 'location_rules':
73 echo '<div class="field-group-locations field-group-settings-tab">';
74 acf_get_view( 'acf-field-group/locations' );
75 echo '</div>';
76 break;
77 case 'presentation':
78 echo '<div class="field-group-setting-split-container field-group-settings-tab">';
79 echo '<div class="field-group-setting-split">';
80
81 // style
82 acf_render_field_wrap(
83 array(
84 'label' => __( 'Style', 'acf' ),
85 'instructions' => '',
86 'type' => 'button_group',
87 'name' => 'style',
88 'prefix' => 'acf_field_group',
89 'value' => $field_group['style'],
90 'choices' => array(
91 'default' => __( 'Standard (WP metabox)', 'acf' ),
92 'seamless' => __( 'Seamless (no metabox)', 'acf' ),
93 ),
94 )
95 );
96
97
98 // position
99 acf_render_field_wrap(
100 array(
101 'label' => __( 'Position', 'acf' ),
102 'instructions' => __( "'High' position not supported in the Block Editor", 'acf' ),
103 'type' => 'button_group',
104 'name' => 'position',
105 'prefix' => 'acf_field_group',
106 'value' => $field_group['position'],
107 'choices' => array(
108 'acf_after_title' => __( 'High (after title)', 'acf' ),
109 'normal' => __( 'Normal (after content)', 'acf' ),
110 'side' => __( 'Side', 'acf' ),
111 ),
112 'default_value' => 'normal',
113 ),
114 'div',
115 'field'
116 );
117
118
119 // label_placement
120 acf_render_field_wrap(
121 array(
122 'label' => __( 'Label Placement', 'acf' ),
123 'instructions' => '',
124 'type' => 'button_group',
125 'name' => 'label_placement',
126 'prefix' => 'acf_field_group',
127 'value' => $field_group['label_placement'],
128 'choices' => array(
129 'top' => __( 'Top aligned', 'acf' ),
130 'left' => __( 'Left aligned', 'acf' ),
131 ),
132 )
133 );
134
135
136 // instruction_placement
137 acf_render_field_wrap(
138 array(
139 'label' => __( 'Instruction Placement', 'acf' ),
140 'instructions' => '',
141 'type' => 'button_group',
142 'name' => 'instruction_placement',
143 'prefix' => 'acf_field_group',
144 'value' => $field_group['instruction_placement'],
145 'choices' => array(
146 'label' => __( 'Below labels', 'acf' ),
147 'field' => __( 'Below fields', 'acf' ),
148 ),
149 )
150 );
151
152
153 // menu_order
154 acf_render_field_wrap(
155 array(
156 'label' => __( 'Order No.', 'acf' ),
157 'instructions' => __( 'Field groups with a lower order will appear first', 'acf' ),
158 'type' => 'number',
159 'name' => 'menu_order',
160 'prefix' => 'acf_field_group',
161 'value' => $field_group['menu_order'],
162 ),
163 'div',
164 'field'
165 );
166
167 echo '</div>';
168 echo '<div class="field-group-setting-split">';
169
170 // hide on screen
171 $choices = array(
172 'permalink' => __( 'Permalink', 'acf' ),
173 'the_content' => __( 'Content Editor', 'acf' ),
174 'excerpt' => __( 'Excerpt', 'acf' ),
175 'custom_fields' => __( 'Custom Fields', 'acf' ),
176 'discussion' => __( 'Discussion', 'acf' ),
177 'comments' => __( 'Comments', 'acf' ),
178 'revisions' => __( 'Revisions', 'acf' ),
179 'slug' => __( 'Slug', 'acf' ),
180 'author' => __( 'Author', 'acf' ),
181 'format' => __( 'Format', 'acf' ),
182 'page_attributes' => __( 'Page Attributes', 'acf' ),
183 'featured_image' => __( 'Featured Image', 'acf' ),
184 'categories' => __( 'Categories', 'acf' ),
185 'tags' => __( 'Tags', 'acf' ),
186 'send-trackbacks' => __( 'Send Trackbacks', 'acf' ),
187 );
188 if ( acf_get_setting( 'remove_wp_meta_box' ) ) {
189 unset( $choices['custom_fields'] );
190 }
191
192 acf_render_field_wrap(
193 array(
194 'label' => __( 'Hide on screen', 'acf' ),
195 'instructions' => __( '<b>Select</b> items to <b>hide</b> them from the edit screen.', 'acf' ) . '<br /><br />' . __( "If multiple field groups appear on an edit screen, the first field group's options will be used (the one with the lowest order number)", 'acf' ),
196 'type' => 'checkbox',
197 'name' => 'hide_on_screen',
198 'prefix' => 'acf_field_group',
199 'value' => $field_group['hide_on_screen'],
200 'toggle' => true,
201 'choices' => $choices,
202 ),
203 'div',
204 'label',
205 true
206 );
207
208 echo '</div>';
209 echo '</div>';
210 break;
211 case 'group_settings':
212 echo '<div class="field-group-settings field-group-settings-tab">';
213
214 // active
215 acf_render_field_wrap(
216 array(
217 'label' => __( 'Active', 'acf' ),
218 'instructions' => '',
219 'type' => 'true_false',
220 'name' => 'active',
221 'prefix' => 'acf_field_group',
222 'value' => $field_group['active'],
223 'ui' => 1,
224 // 'ui_on_text' => __('Active', 'acf'),
225 // 'ui_off_text' => __('Inactive', 'acf'),
226 )
227 );
228
229 // Show fields in REST API.
230 if ( acf_get_setting( 'rest_api_enabled' ) ) {
231 acf_render_field_wrap(
232 array(
233 'label' => __( 'Show in REST API', 'acf' ),
234 'instructions' => '',
235 'type' => 'true_false',
236 'name' => 'show_in_rest',
237 'prefix' => 'acf_field_group',
238 'value' => $field_group['show_in_rest'],
239 'ui' => 1,
240 // 'ui_on_text' => __('Active', 'acf'),
241 // 'ui_off_text' => __('Inactive', 'acf'),
242 )
243 );
244 }
245
246 // description
247 acf_render_field_wrap(
248 array(
249 'label' => __( 'Description', 'acf' ),
250 'instructions' => __( 'Shown in field group list', 'acf' ),
251 'type' => 'text',
252 'name' => 'description',
253 'prefix' => 'acf_field_group',
254 'value' => $field_group['description'],
255 ),
256 'div',
257 'field'
258 );
259
260 /* translators: 1: Post creation date 2: Post creation time */
261 $acf_created_on = sprintf( __( 'Created on %1$s at %2$s', 'acf' ), get_the_date(), get_the_time() );
262 ?>
263 <div class="acf-field-group-settings-footer">
264 <span class="acf-created-on"><?php echo esc_html( $acf_created_on ); ?></span>
265 <a href="<?php echo get_delete_post_link(); ?>" class="acf-btn acf-btn-tertiary acf-delete-field-group">
266 <i class="acf-icon acf-icon-trash"></i>
267 <?php esc_html_e( 'Delete Field Group', 'acf' ); ?>
268 </a>
269 </div>
270 <?php
271 echo '</div>';
272 break;
273 default:
274 echo '<div class="field-group-' . esc_attr( $tab_key ) . ' field-group-settings-tab">';
275 do_action( 'acf/field_group/render_group_settings_tab/' . $tab_key, $field_group );
276 echo '</div>';
277 break;
278 }
279 }
280
281 // 3rd party settings
282 do_action( 'acf/render_field_group_settings', $field_group );
283 ?>
284
285 <div class="acf-hidden">
286 <input type="hidden" name="acf_field_group[key]" value="<?php echo esc_attr( $field_group['key'] ); ?>" />
287 </div>
288 <script type="text/javascript">
289 if( typeof acf !== 'undefined' ) {
290
291 acf.newPostbox({
292 'id': 'acf-field-group-options',
293 'label': 'top'
294 });
295
296 }
297 </script>
298