| @@ -1,14 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Elementor; |
| 3 | 3 | |
| 4 | 4 | use Elementor\Core\Base\Document; |
| 5 | -use Elementor\TemplateLibrary\Forms\New_Template_Form; | |
| 6 | 5 | |
| 7 | 6 | if ( ! defined( 'ABSPATH' ) ) { |
| 8 | - exit; // Exit if accessed directly. | |
| 7 | + exit; // Exit if accessed directly | |
| 9 | 8 | } |
| 10 | -$new_template_control_form = new New_Template_Form( [ 'id' => 'form' ] ); | |
| 9 | + | |
| 11 | 10 | $document_types = Plugin::$instance->documents->get_document_types(); |
| 12 | 11 | |
| 13 | 12 | $types = []; |
| 14 | 13 | $lock_configs = []; |
| @@ -40,10 +39,8 @@ | ||
| 40 | 39 | * @param array $types Types data. |
| 41 | 40 | * @param Document $document_types Document types. |
| 42 | 41 | */ |
| 43 | 42 | $types = apply_filters( 'elementor/template-library/create_new_dialog_types', $types, $document_types ); |
| 44 | -ksort( $types ); | |
| 45 | - | |
| 46 | 43 | ?> |
| 47 | 44 | <script type="text/template" id="tmpl-elementor-new-template"> |
| 48 | 45 | <div id="elementor-new-template__description"> |
| 49 | 46 | <div id="elementor-new-template__description__title"><?php |
| @@ -54,8 +51,16 @@ | ||
| 54 | 51 | '</span>' |
| 55 | 52 | ); |
| 56 | 53 | ?></div> |
| 57 | 54 | <div id="elementor-new-template__description__content"><?php echo esc_html__( 'Use templates to create the different pieces of your site, and reuse them with one click whenever needed.', 'elementor' ); ?></div> |
| 55 | + <?php | |
| 56 | + /* | |
| 57 | + <div id="elementor-new-template__take_a_tour"> | |
| 58 | + <i class="eicon-play-o"></i> | |
| 59 | + <a href="#"><?php echo esc_html__( 'Take The Video Tour', 'elementor\' ); ?></a> | |
| 60 | + </div> | |
| 61 | + */ | |
| 62 | + ?> | |
| 58 | 63 | </div> |
| 59 | 64 | <form id="elementor-new-template__form" action="<?php esc_url( admin_url( '/edit.php' ) ); ?>"> |
| 60 | 65 | <input type="hidden" name="post_type" value="elementor_library"> |
| 61 | 66 | <input type="hidden" name="action" value="elementor_new_post"> |
| @@ -94,15 +99,9 @@ | ||
| 94 | 99 | * Fires after Elementor template library dialog fields are displayed. |
| 95 | 100 | * |
| 96 | 101 | * @since 2.0.0 |
| 97 | 102 | */ |
| 98 | - do_action( 'elementor/template-library/create_new_dialog_fields', $new_template_control_form ); | |
| 99 | - | |
| 100 | - $additional_controls = $new_template_control_form->get_controls(); | |
| 101 | - if ( $additional_controls ) { | |
| 102 | - wp_add_inline_script( 'elementor-admin', 'const elementor_new_template_form_controls = ' . wp_json_encode( $additional_controls ) . ';' ); | |
| 103 | - $new_template_control_form->render(); | |
| 104 | - } | |
| 103 | + do_action( 'elementor/template-library/create_new_dialog_fields' ); | |
| 105 | 104 | ?> |
| 106 | 105 | |
| 107 | 106 | <div id="elementor-new-template__form__post-title__wrapper" class="elementor-form-field"> |
| 108 | 107 | <label for="elementor-new-template__form__post-title" class="elementor-form-field__label"> |
| @@ -111,8 +110,8 @@ | ||
| 111 | 110 | <div class="elementor-form-field__text__wrapper"> |
| 112 | 111 | <input type="text" placeholder="<?php echo esc_attr__( 'Enter template name (optional)', 'elementor' ); ?>" id="elementor-new-template__form__post-title" class="elementor-form-field__text" name="post_data[post_title]"> |
| 113 | 112 | </div> |
| 114 | 113 | </div> |
| 115 | - <button id="elementor-new-template__form__submit" class="elementor-button e-primary"><?php echo esc_html__( 'Create Template', 'elementor' ); ?></button> | |
| 116 | - <a id="elementor-new-template__form__lock_button" class="elementor-button e-accent e-hidden" target="_blank"><?php // Will be filled from js. ?></a> | |
| 114 | + <button id="elementor-new-template__form__submit" class="elementor-button elementor-button-success"><?php echo esc_html__( 'Create Template', 'elementor' ); ?></button> | |
| 115 | + <a id="elementor-new-template__form__lock_button" class="elementor-button elementor-button-brand e-hidden" target="_blank"><?php // Will be filled from js. ?></a> | |
| 117 | 116 | </form> |
| 118 | 117 | </script> |