PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 2.8.23.4
Pods – Custom Content Types and Fields v2.8.23.4
2.8.23.4 2.9.19.4 3.0.10.4 3.1.4.2 3.2.8.3 3.3.9.1 trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 3.2.5 3.2.6 3.2.7 3.2.7.1 3.2.8 3.2.8.1 3.2.8.2 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9
pods / ui / admin / setup-add.php
pods / ui / admin Last commit date
callouts 2 weeks ago upgrade 2 weeks ago widgets 2 weeks ago components-admin.php 2 weeks ago help.php 2 weeks ago postbox-header.php 2 weeks ago settings-reset.php 2 weeks ago settings-settings.php 2 weeks ago settings.php 2 weeks ago setup-add.php 2 weeks ago setup-edit.php 2 weeks ago shortcode.php 2 weeks ago view.php 2 weeks ago
setup-add.php
569 lines
1 <?php
2 // Don't load directly.
3 if ( ! defined( 'ABSPATH' ) || ! pods_is_admin( 'pods' ) ) {
4 die( '-1' );
5 }
6
7 $pods_meta = pods_meta();
8
9 $ignore = [];
10
11 // Only add support for built-in taxonomy "link_category" if link manager is enabled.
12 $link_manager_enabled = (int) get_option( 'link_manager_enabled', 0 );
13
14 if ( 0 === $link_manager_enabled ) {
15 $ignore['link_category'] = true;
16 }
17
18 $all_pods = pods_api()->load_pods( [ 'key_names' => true ] );
19
20 $quick_actions = [];
21
22 if ( ! pods_is_types_only() ) {
23 if ( ! isset( $all_pods['post'] ) ) {
24 $quick_actions[] = [
25 'label' => __( 'Add custom fields to Posts', 'pods' ),
26 'create_extend' => 'extend',
27 'type' => 'post_type',
28 'object' => 'post',
29 ];
30 }
31
32 if ( ! isset( $all_pods['page'] ) ) {
33 $quick_actions[] = [
34 'label' => __( 'Add custom fields to Pages', 'pods' ),
35 'create_extend' => 'extend',
36 'type' => 'post_type',
37 'object' => 'page',
38 ];
39 }
40
41 if ( ! isset( $all_pods['category'] ) ) {
42 $quick_actions[] = [
43 'label' => __( 'Add custom fields to Categories', 'pods' ),
44 'create_extend' => 'extend',
45 'type' => 'taxonomy',
46 'object' => 'category',
47 ];
48 }
49
50 if ( ! isset( $all_pods['user'] ) ) {
51 $quick_actions[] = [
52 'label' => __( 'Add custom fields to Users', 'pods' ),
53 'create_extend' => 'extend',
54 'type' => 'user',
55 'object' => 'user',
56 ];
57 }
58 }
59
60 /**
61 * Allow filtering the list of quick actions.
62 *
63 * @since 2.8.0
64 *
65 * @param array $quick_actions List of quick actions with the following info: label, create_extend, type, object.
66 * @param array $all_pods List of pods, keyed by name.
67 */
68 $quick_actions = apply_filters( 'pods_admin_setup_add_quick_actions', $quick_actions, $all_pods );
69 ?>
70
71 <div class="wrap pods-admin">
72 <div id="icon-pods" class="icon32"><br /></div>
73
74 <form action="" method="post" class="pods-submittable">
75 <div class="pods-submittable-fields">
76 <input type="hidden" name="action" value="pods_admin" />
77 <input type="hidden" name="method" value="add_pod" />
78 <input type="hidden" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( 'pods-add_pod' ) ); ?>" />
79 <input type="hidden" name="create_extend" id="pods_create_extend" value="create" />
80
81 <h2 class="italicized">
82 <?php
83 esc_html_e( 'Add New Pod', 'pods' );
84
85 if ( ! empty( $all_pods ) ) {
86 $link = pods_query_arg( [ 'page' => 'pods', 'action' . $obj->num => 'manage' ] );
87 ?>
88 <a href="<?php echo esc_url( $link ); ?>" class="add-new-h2">&laquo; <?php esc_html_e( 'Back to Manage', 'pods' ); ?></a>
89 <?php
90 }
91 ?>
92 </h2>
93
94 <img src="<?php echo esc_url( PODS_URL ); ?>ui/images/pods-logo-notext-rgb-transparent.png" class="pods-leaf-watermark-right" />
95
96 <div id="pods-wizard-box" class="pods-wizard-steps-2 pods-wizard-hide-first">
97 <div id="pods-wizard-heading">
98 <ul>
99 <li class="pods-wizard-menu-current" data-step="1">
100 <i></i> <span>1</span> <?php esc_html_e( 'Create or Extend', 'pods' ); ?>
101 <em></em>
102 </li>
103 <li data-step="2">
104 <i></i> <span>2</span> <?php esc_html_e( 'Configure', 'pods' ); ?>
105 <em></em>
106 </li>
107 </ul>
108 </div>
109 <div id="pods-wizard-main">
110 <div id="pods-wizard-panel-1" class="pods-wizard-panel">
111 <div class="pods-wizard-content">
112 <p>
113 <?php esc_html_e( 'Pods are content types that you can customize and define fields for based on your needs. You can choose to create a Custom Post Type, Custom Taxonomy, or Custom Settings Pages for site-specific data. You can also extend existing content types like WP Objects such as Post Types, Taxonomies, Users, or Comments.', 'pods' ); ?>
114 <br /><br />
115 <?php _e( 'Not sure what content type you should use? Check out our <a href="https://docs.pods.io/creating-editing-pods/compare-content-types/" target="_blank" rel="noopener noreferrer">Content Type Comparison</a> to help you decide.', 'pods' ); ?>
116 </p>
117
118 <?php if ( ! empty( $quick_actions ) ) : ?>
119 <h3><?php esc_html_e( 'One-Click Quick Actions', 'pods' ); ?></h3>
120
121 <ul class="normal">
122 <?php foreach ( $quick_actions as $quick_action ) : ?>
123 <li>
124 <a href="#<?php echo sanitize_title( $quick_action['create_extend'] . '-' . $quick_action['type'] . '-' . $quick_action['object'] ); ?>"
125 data-create-extend="<?php echo esc_attr( $quick_action['create_extend'] ); ?>"
126 data-object="<?php echo esc_attr( $quick_action['object'] ); ?>"
127 data-type="<?php echo esc_attr( $quick_action['type'] ); ?>"
128 class="pods-wizard-quick-action"
129 >
130 <?php echo esc_html( $quick_action['label'] ); ?>
131 </a>
132 </li>
133 <?php endforeach; ?>
134 </ul>
135 <?php endif; ?>
136 </div>
137 <div id="pods-wizard-options">
138 <h3><?php esc_html_e( 'Add New Pod Wizard', 'pods' ); ?></h3>
139
140 <div class="pods-wizard-options-list">
141 <div class="pods-wizard-option">
142 <a href="#pods-wizard-create" data-opt="create">
143 <h2><?php esc_html_e( 'Create New', 'pods' ); ?> &raquo;</h2>
144
145 <p><?php _e( 'Create entirely new content types using <strong>Post Types</strong>, <strong>Taxonomies</strong>, or <strong>Custom Settings Pages</strong>.', 'pods' ); ?></p>
146 </a>
147 </div>
148
149 <div class="pods-wizard-option">
150 <a href="#pods-wizard-extend" data-opt="extend">
151 <h2><?php esc_html_e( 'Extend Existing', 'pods' ); ?> &raquo;</h2>
152
153 <p><?php _e( 'Extend any existing content type within WordPress, including <strong>Post Types</strong> (Posts, Pages, etc), <strong>Taxonomies</strong> (Categories, Tags, etc), <strong>Media</strong>, <strong>Users</strong>, or <strong>Comments</strong>.', 'pods' ); ?></p>
154 </a>
155 </div>
156 </div>
157 </div>
158 </div>
159 <div id="pods-wizard-panel-2" class="pods-wizard-panel">
160 <div class="pods-wizard-option-content" id="pods-wizard-create">
161 <div class="pods-wizard-content">
162 <p><?php esc_html_e( 'Creating a new Content Type allows you to control exactly what that content type does, how it acts like, the fields it has, and the way you manage it.', 'pods' ); ?></p>
163 </div>
164 <div class="stuffbox">
165 <h3><label for="link_name"><?php esc_html_e( 'Create a New Content Type', 'pods' ); ?></label>
166 </h3>
167
168 <div class="inside pods-manage-field pods-dependency">
169 <div class="pods-field__container">
170 <?php
171 echo PodsForm::label( 'create_pod_type', __( 'Content Type', 'pods' ), [
172 __( '<h3>Content Types</h3> There are many content types to choose from, we have put together a comparison between them all to help you decide what fits your needs best.', 'pods' ),
173 'https://docs.pods.io/creating-editing-pods/compare-content-types/',
174 ] );
175
176 $data = [
177 'post_type' => __( 'Custom Post Type (like Posts or Pages)', 'pods' ),
178 'taxonomy' => __( 'Custom Taxonomy (like Categories or Tags)', 'pods' ),
179 'settings' => __( 'Custom Settings Page', 'pods' ),
180 'pod' => ''
181 // component will fill this in if it's enabled (this exists for placement)
182 ];
183
184 $data = apply_filters( 'pods_admin_setup_add_create_pod_type', $data );
185
186 if ( empty( $data['pod'] ) ) {
187 unset( $data['pod'] );
188 }
189
190 if ( pods_is_types_only() ) {
191 unset( $data['settings'], $data['pod'] );
192 }
193
194 echo PodsForm::field( 'create_pod_type', pods_v( 'create_pod_type', 'post', 'post_type', true ), 'pick', [
195 'data' => $data,
196 'dependency' => true,
197 ] );
198 ?>
199 </div>
200 <div class="pods-field__container">
201 <?php
202 echo PodsForm::label( 'create_label_singular', __( 'Singular Label', 'pods' ), __( '<h3>Singular Label</h3> This is the label for 1 item (Singular) that will appear throughout the WordPress admin area for managing the content.', 'pods' ) );
203 echo PodsForm::field( 'create_label_singular', pods_v( 'create_label_singular', 'post' ), 'text', [
204 'class' => 'pods-validate pods-validate-required',
205 'text_max_length' => 30,
206 'excludes-on' => [
207 'create_pod_type' => 'settings',
208 ],
209 ] );
210 ?>
211 </div>
212 <div class="pods-field__container">
213 <?php
214 echo PodsForm::label( 'create_label_plural', __( 'Plural Label', 'pods' ), __( '<h3>Plural Label</h3> This is the label for more than 1 item (Plural) that will appear throughout the WordPress admin area for managing the content.', 'pods' ) );
215 echo PodsForm::field( 'create_label_plural', pods_v( 'create_label_plural', 'post' ), 'text', [
216 'text_max_length' => 30,
217 'excludes-on' => [
218 'create_pod_type' => 'settings',
219 ],
220 ] );
221 ?>
222 </div>
223 <div class="pods-field__container">
224 <?php
225 echo PodsForm::label( 'create_label_title', __( 'Page Title', 'pods' ), __( '<h3>Page Title</h3> This is the text that will appear at the top of your settings page.', 'pods' ) );
226 echo PodsForm::field( 'create_label_title', pods_v( 'create_label_title', 'post' ), 'text', [
227 'class' => 'pods-validate pods-validate-required',
228 'text_max_length' => 30,
229 'depends-on' => [
230 'create_pod_type' => 'settings',
231 ],
232 ] );
233 ?>
234 </div>
235 <div class="pods-field__container">
236 <?php
237 echo PodsForm::label( 'create_label_menu', __( 'Menu Label', 'pods' ), __( '<h3>Menu Label</h3> This is the label that will appear throughout the WordPress admin area for your settings.', 'pods' ) );
238 echo PodsForm::field( 'create_label_menu', pods_v( 'create_label_menu', 'post' ), 'text', [
239 'text_max_length' => 30,
240 'depends-on' => [
241 'create_pod_type' => 'settings',
242 ],
243 ] );
244 ?>
245 </div>
246 <div class="pods-field__container">
247 <?php
248 echo PodsForm::label( 'create_menu_location', __( 'Menu Location', 'pods' ), __( '<h3>Menu Location</h3> This is the location where the new settings page will be added in the WordPress Dashboard menu.', 'pods' ) );
249
250 $data = [
251 'settings' => __( 'Add to Settings menu', 'pods' ),
252 'appearances' => __( 'Add to Appearances menu', 'pods' ),
253 'top' => __( 'Make a new menu item below Settings', 'pods' ),
254 ];
255
256 echo PodsForm::field( 'create_menu_location', pods_v( 'create_menu_location', 'post' ), 'pick', [
257 'data' => $data,
258 'depends-on' => [
259 'create_pod_type' => 'settings',
260 ],
261 ] );
262 ?>
263 </div>
264
265 <p>
266 <a href="#pods-advanced" class="pods-advanced-toggle"><?php esc_html_e( 'Advanced', 'pods' ); ?> +</a>
267 </p>
268
269 <div class="pods-advanced">
270 <div class="pods-field__container">
271 <?php
272 global $wpdb;
273 $max_length_name = 64;
274 $max_length_name -= 10; // Allow for WP Multisite or prefix changes in the future
275 $max_length_name -= strlen( $wpdb->prefix . 'pods_' );
276
277 echo PodsForm::label( 'create_name', __( 'Pod Name', 'pods' ), __( '<h3>Pod Identifier</h3> This is different than the labels users will see in the WordPress admin areas, it is the name you will use to programatically reference this object throughout your theme, WordPress, and other PHP.', 'pods' ) );
278 echo PodsForm::field( 'create_name', pods_v( 'create_name', 'post' ), 'slug', [
279 'attributes' => [
280 'maxlength' => $max_length_name,
281 'size' => 25,
282 ],
283 'excludes-on' => [
284 'create_pod_type' => 'settings',
285 ],
286 ] );
287 ?>
288 </div>
289 <div class="pods-field__container">
290 <?php
291 global $wpdb;
292 $max_length_name = 64;
293 $max_length_name -= 10; // Allow for WP Multisite or prefix changes in the future
294 $max_length_name -= strlen( $wpdb->prefix . 'pods_' );
295
296 echo PodsForm::label( 'create_setting_name', __( 'Pod Name', 'pods' ), __( '<h3>Pod Identifier</h3> This is different than the labels users will see in the WordPress admin areas, it is the name you will use to programatically reference this object throughout your theme, WordPress, and other PHP.', 'pods' ) );
297 echo PodsForm::field( 'create_setting_name', pods_v( 'create_setting_name', 'post' ), 'slug', [
298 'attributes' => [
299 'maxlength' => $max_length_name,
300 'size' => 25,
301 ],
302 'depends-on' => [
303 'create_pod_type' => 'settings',
304 ],
305 ] );
306 ?>
307 </div>
308 <div class="pods-field__container">
309 <?php
310 echo PodsForm::label( 'create_rest_api', __( 'Enable REST API', 'pods' ), __( 'This option will enable the REST API. For Custom Post Types, this will allow communication with the Block Editor. For Custom Taxonomies, this simply enables the REST API communication that can be taken advantage of by theme integrations.', 'pods' ) );
311 echo PodsForm::field( 'create_rest_api', pods_v( 'create_block_editor', 'post' ), 'boolean', [
312 'default' => 1,
313 'depends-on' => [
314 'create_pod_type' => [
315 'post_type',
316 'taxonomy',
317 ],
318 ],
319 ] );
320 ?>
321 </div>
322
323 <?php
324 if ( ! pods_tableless() && apply_filters( 'pods_admin_setup_add_create_storage', false ) ) {
325 ?>
326 <div class="pods-field__container">
327 <?php
328 echo PodsForm::label( 'create_storage', __( 'Storage Type', 'pods' ), [
329 __( '<h3>Storage Types</h3> Table based storage will operate in a way where each field you create for your content type becomes a field in a table. Meta based storage relies upon the WordPress meta storage table for all field data.', 'pods' ),
330 'https://docs.pods.io/creating-editing-pods/meta-vs-table-storage/',
331 ] );
332
333 $data = [
334 'meta' => __( 'Meta Based (WP Default)', 'pods' ),
335 'table' => __( 'Table Based', 'pods' ),
336 ];
337
338 echo PodsForm::field( 'create_storage', pods_v( 'create_storage', 'post' ), 'pick', [
339 'data' => $data,
340 'depends-on' => [
341 'create_pod_type' => [
342 'post_type',
343 'taxonomy',
344 ],
345 ],
346 ] );
347 ?>
348 </div>
349 <?php
350 }
351 ?>
352 </div>
353 </div>
354 </div>
355 </div>
356 <div class="pods-wizard-option-content" id="pods-wizard-extend">
357 <div class="pods-wizard-content">
358 <p><?php esc_html_e( 'Extending an existing Content Type allows you to add fields to it and take advantage of the Pods architecture for management and optionally for theming.', 'pods' ); ?></p>
359 </div>
360 <div class="stuffbox">
361 <h3>
362 <label for="link_name"><?php esc_html_e( 'Extend an Existing Content Type', 'pods' ); ?></label>
363 </h3>
364
365 <div class="inside pods-manage-field pods-dependency">
366
367 <div class="pods-field__container">
368 <?php
369 echo PodsForm::label( 'extend_pod_type', __( 'Content Type', 'pods' ), [
370 __( '<h3>Content Types</h3> There are many content types to choose from, we have put together a comparison between them all to help you decide what fits your needs best.', 'pods' ),
371 'https://docs.pods.io/creating-editing-pods/compare-content-types/',
372 ] );
373
374 $data = [
375 'post_type' => __( 'Post Types (Posts, Pages, etc..)', 'pods' ),
376 'taxonomy' => __( 'Taxonomies (Categories, Tags, etc..)', 'pods' ),
377 'media' => __( 'Media', 'pods' ),
378 'user' => __( 'Users', 'pods' ),
379 'comment' => __( 'Comments', 'pods' ),
380 ];
381
382 if ( isset( $all_pods['media'] ) && 'media' == $all_pods['media']['type'] ) {
383 unset( $data['media'] );
384 }
385
386 if ( isset( $all_pods['user'] ) && 'user' == $all_pods['user']['type'] ) {
387 unset( $data['user'] );
388 }
389
390 if ( isset( $all_pods['comment'] ) && 'comment' == $all_pods['comment']['type'] ) {
391 unset( $data['comment'] );
392 }
393
394 $data = apply_filters( 'pods_admin_setup_add_extend_pod_type', $data );
395
396 echo PodsForm::field( 'extend_pod_type', pods_v( 'extend_pod_type', 'post', 'post_type', true ), 'pick', [
397 'data' => $data,
398 'dependency' => true,
399 ] );
400 ?>
401 </div>
402 <div class="pods-field__container">
403 <?php
404 $post_types = get_post_types();
405
406 foreach ( $post_types as $post_type => $label ) {
407 if ( empty( $post_type ) || isset( $ignore[ $post_type ] ) || 0 === strpos( $post_type, '_pods_' ) || ! $pods_meta->is_type_covered( 'post_type', $post_type ) ) {
408 // Post type is ignored
409 unset( $post_types[ $post_type ] );
410
411 continue;
412 } elseif ( isset( $all_pods[ $post_type ] ) && 'post_type' === $all_pods[ $post_type ]['type'] ) {
413 unset( $post_types[ $post_type ] );
414
415 continue;
416 }
417
418 $post_type = get_post_type_object( $post_type );
419 $post_types[ $post_type->name ] = $post_type->label;
420 }
421
422 echo PodsForm::label( 'extend_post_type', __( 'Post Type', 'pods' ), [
423 __( '<h3>Post Types</h3> WordPress can hold and display many different types of content. Internally, these are all stored in the same place, in the wp_posts table. These are differentiated by a column called post_type.', 'pods' ),
424 'http://codex.wordpress.org/Post_Types',
425 ] );
426 echo PodsForm::field( 'extend_post_type', pods_v( 'extend_post_type', 'post' ), 'pick', [
427 'data' => $post_types,
428 'depends-on' => [
429 'extend_pod_type' => 'post_type',
430 ],
431 ] );
432 ?>
433 </div>
434 <div class="pods-field__container">
435 <?php
436 $taxonomies = get_taxonomies();
437
438 foreach ( $taxonomies as $taxonomy => $label ) {
439 if ( empty( $taxonomy ) || isset( $ignore[ $taxonomy ] ) || 0 === strpos( $taxonomy, '_pods_' ) || ! $pods_meta->is_type_covered( 'taxonomy', $taxonomy ) ) {
440 // Taxonomy is ignored
441 unset( $taxonomies[ $taxonomy ] );
442
443 continue;
444 } elseif ( isset( $all_pods[ $taxonomy ] ) && 'taxonomy' == $all_pods[ $taxonomy ]['type'] ) {
445 unset( $taxonomies[ $taxonomy ] );
446 continue;
447 }
448
449 $taxonomy = get_taxonomy( $taxonomy );
450 $taxonomies[ $taxonomy->name ] = $taxonomy->label;
451 }
452
453 echo PodsForm::label( 'extend_taxonomy', __( 'Taxonomy', 'pods' ), [
454 __( '<h3>Taxonomies</h3> A taxonomy is a way to group Post Types.', 'pods' ),
455 'http://codex.wordpress.org/Taxonomies',
456 ] );
457 echo PodsForm::field( 'extend_taxonomy', pods_v( 'extend_taxonomy', 'post' ), 'pick', [
458 'data' => $taxonomies,
459 'depends-on' => [
460 'extend_pod_type' => 'taxonomy',
461 ],
462 ] );
463 ?>
464 </div>
465
466 <?php
467 if ( ! pods_tableless() && apply_filters( 'pods_admin_setup_add_extend_storage', false ) ) {
468 ?>
469 <p>
470 <a href="#pods-advanced" class="pods-advanced-toggle"><?php esc_html_e( 'Advanced', 'pods' ); ?> +</a>
471 </p>
472
473 <div class="pods-advanced">
474 <div class="pods-field__container">
475 <?php
476 echo PodsForm::label( 'extend_storage', __( 'Storage Type', 'pods' ), [
477 __( '<h3>Storage Types</h3> Table based storage will operate in a way where each field you create for your content type becomes a field in a table. Meta based storage relies upon the WordPress meta storage table for all field data.', 'pods' ),
478 'https://docs.pods.io/creating-editing-pods/meta-vs-table-storage/',
479 ] );
480
481 $data = [
482 'meta' => __( 'Meta Based (WP Default)', 'pods' ),
483 'table' => __( 'Table Based', 'pods' ),
484 ];
485
486 echo PodsForm::field( 'extend_storage', pods_v( 'extend_storage', 'post' ), 'pick', [
487 'data' => $data,
488 'depends-on' => [
489 'extend_pod_type' => [
490 'post_type',
491 'taxonomy',
492 'media',
493 'user',
494 'comment',
495 ],
496 ],
497 ] );
498 ?>
499 </div>
500 </div>
501 <?php
502 }
503 ?>
504 </div>
505 </div>
506 </div>
507 </div>
508
509 <div id="pods-wizard-actions" class="pods-wizard-button-interface">
510 <div id="pods-wizard-toolbar">
511 <button id="pods-wizard-start" class="button button-secondary"><?php esc_html_e( 'Start Over', 'pods' ); ?></button>
512 <button id="pods-wizard-next" class="button button-primary" data-next="<?php esc_attr_e( 'Next Step', 'pods' ); ?>" data-finished="<?php esc_attr_e( 'Finished', 'pods' ); ?>" data-processing="<?php esc_attr_e( 'Processing', 'pods' ); ?>.."><?php esc_html_e( 'Next Step', 'pods' ); ?></button>
513 </div>
514 <div id="pods-wizard-finished">
515
516 </div>
517 </div>
518 </div>
519 </div>
520 </div>
521 </form>
522 </div>
523 <script type="text/javascript">
524 var pods_admin_submit_callback = function ( id ) {
525 id = parseInt( id );
526
527 if ( !isNaN( id ) ) {
528 document.location = 'admin.php?page=pods&action=edit&id=' + id + '&do=create';
529 }
530 else {
531 document.location = 'admin.php?page=pods&do=create';
532 }
533 };
534
535 var pods_admin_option_select_callback = function ( $opt ) {
536 jQuery( '#pods_create_extend' ).val( $opt.data( 'opt' ) );
537 };
538
539 jQuery( function ( $ ) {
540 var $document = $( document );
541
542 $document.Pods( 'validate' );
543 $document.Pods( 'submit' );
544 $document.Pods( 'wizard' );
545 $document.Pods( 'advanced' );
546 $document.Pods( 'confirm' );
547 $document.Pods( 'sluggable' );
548
549 const $quick_actions = $( '.pods-wizard-quick-action' );
550
551 if ( $quick_actions[0] ) {
552 $quick_actions.on( 'click', function( e ) {
553 e.preventDefault();
554
555 const $action = $( this );
556 const createExtend = $action.data( 'create-extend' );
557 const objectName = $action.data( 'object' );
558 const objectType = $action.data( 'type' );
559
560 jQuery( '#pods_create_extend' ).val( createExtend );
561 jQuery( '#pods-form-ui-' + createExtend + '-pod-type' ).val( objectType );
562 jQuery( '#pods-form-ui-' + createExtend + '-' + objectType.replace( '_', '-' ) ).val( objectName );
563
564 $action.closest( 'form' ).submit();
565 } );
566 }
567 } );
568 </script>
569