secure-custom-fields
/
includes
/
admin
/
views
/
acf-ui-options-page
/
create-options-page-modal.php
advanced-settings.php
1 year ago
basic-settings.php
1 year ago
create-options-page-modal.php
1 year ago
list-empty.php
1 year ago
create-options-page-modal.php
77 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Create Options Page Modal |
| 4 | * |
| 5 | * Renders the modal form for creating a new options page. |
| 6 | * |
| 7 | * @package wordpress/secure-custom-fields |
| 8 | */ |
| 9 | |
| 10 | ?> |
| 11 | <form id="acf-create-options-page-form"> |
| 12 | <?php |
| 13 | |
| 14 | $acf_options_page_prefilled_title = ''; |
| 15 | |
| 16 | if ( ! empty( $field_group_title ) ) { |
| 17 | $acf_options_page_prefilled_title = (string) apply_filters( 'acf/options_page_modal/prefill_title', '%s' ); |
| 18 | $acf_options_page_prefilled_title = sprintf( |
| 19 | $acf_options_page_prefilled_title, |
| 20 | $field_group_title |
| 21 | ); |
| 22 | } |
| 23 | |
| 24 | acf_render_field_wrap( |
| 25 | array( |
| 26 | 'label' => __( 'Page Title', 'secure-custom-fields' ), |
| 27 | /* translators: example options page name */ |
| 28 | 'placeholder' => __( 'Site Settings', 'secure-custom-fields' ), |
| 29 | 'value' => $acf_options_page_prefilled_title, |
| 30 | 'type' => 'text', |
| 31 | 'name' => 'page_title', |
| 32 | 'key' => 'page_title', |
| 33 | 'class' => 'acf_options_page_title acf_slugify_to_key', |
| 34 | 'prefix' => 'acf_ui_options_page', |
| 35 | 'required' => true, |
| 36 | ), |
| 37 | 'div', |
| 38 | 'field' |
| 39 | ); |
| 40 | |
| 41 | acf_render_field_wrap( |
| 42 | array( |
| 43 | 'label' => __( 'Menu Slug', 'secure-custom-fields' ), |
| 44 | 'type' => 'text', |
| 45 | 'name' => 'menu_slug', |
| 46 | 'key' => 'menu_slug', |
| 47 | 'class' => 'acf-options-page-menu_slug acf_slugified_key', |
| 48 | 'prefix' => 'acf_ui_options_page', |
| 49 | 'required' => true, |
| 50 | ), |
| 51 | 'div', |
| 52 | 'field' |
| 53 | ); |
| 54 | |
| 55 | acf_render_field_wrap( |
| 56 | array( |
| 57 | 'label' => __( 'Parent Page', 'secure-custom-fields' ), |
| 58 | 'type' => 'select', |
| 59 | 'name' => 'parent_slug', |
| 60 | 'key' => 'parent_slug', |
| 61 | 'class' => 'acf-options-page-parent_slug', |
| 62 | 'prefix' => 'acf_ui_options_page', |
| 63 | 'choices' => $acf_parent_page_choices, |
| 64 | 'required' => true, |
| 65 | ), |
| 66 | 'div', |
| 67 | 'field' |
| 68 | ); |
| 69 | ?> |
| 70 | |
| 71 | <div class="acf-actions"> |
| 72 | <button type="button" class="acf-btn acf-btn-secondary acf-close-popup"><?php esc_html_e( 'Cancel', 'secure-custom-fields' ); ?></button> |
| 73 | <button type="submit" class="acf-btn acf-btn-primary"><?php esc_html_e( 'Done', 'secure-custom-fields' ); ?></button> |
| 74 | </div> |
| 75 | |
| 76 | </form> |
| 77 |