diff --git a/includes/admin/core/class-admin-forms.php b/includes/admin/core/class-admin-forms.php index 881f74d4..1a0c23e7 100644 --- a/includes/admin/core/class-admin-forms.php +++ b/includes/admin/core/class-admin-forms.php @@ -542,6 +542,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) { $html .= ''; + UM()->metabox()->init_icon = true; + return $html; } diff --git a/includes/admin/core/class-admin-metabox.php b/includes/admin/core/class-admin-metabox.php index 037f0ed3..063fcda0 100644 --- a/includes/admin/core/class-admin-metabox.php +++ b/includes/admin/core/class-admin-metabox.php @@ -34,6 +34,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) { private $custom_nonce_added = false; + var $init_icon = false; + + /** * Admin_Metabox constructor. */ @@ -43,7 +46,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) { $this->edit_array = []; add_action( 'admin_head', array( &$this, 'admin_head' ), 9); - add_action( 'admin_footer', array( &$this, 'load_modal_content' ), 9); + add_action( 'admin_footer', array( &$this, 'load_modal_content' ), 9 ); add_action( 'load-post.php', array( &$this, 'add_metabox' ), 9 ); add_action( 'load-post-new.php', array( &$this, 'add_metabox' ), 9 ); @@ -1198,14 +1201,18 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) { * Load modal content */ function load_modal_content() { - $screen = get_current_screen(); - if ( UM()->admin()->is_um_screen() ) { - foreach ( glob( um_path . 'includes/admin/templates/modal/*.php' ) as $modal_content ) { + + if ( isset( $screen->id ) && strstr( $screen->id, 'um_form' ) ) { + foreach ( glob( um_path . 'includes/admin/templates/modal/forms/*.php' ) as $modal_content ) { include_once $modal_content; } } + if ( $this->init_icon ) { + include_once um_path . 'includes/admin/templates/modal/forms/fonticons.php'; + } + // needed on forms only if ( ! isset( $this->is_loaded ) && isset( $screen->id ) && strstr( $screen->id, 'um_form' ) ) { $settings['textarea_rows'] = 8; diff --git a/includes/admin/templates/modal/dynamic_edit_field.php b/includes/admin/templates/modal/forms/dynamic_edit_field.php similarity index 100% rename from includes/admin/templates/modal/dynamic_edit_field.php rename to includes/admin/templates/modal/forms/dynamic_edit_field.php diff --git a/includes/admin/templates/modal/dynamic_edit_row.php b/includes/admin/templates/modal/forms/dynamic_edit_row.php similarity index 100% rename from includes/admin/templates/modal/dynamic_edit_row.php rename to includes/admin/templates/modal/forms/dynamic_edit_row.php diff --git a/includes/admin/templates/modal/dynamic_form_preview.php b/includes/admin/templates/modal/forms/dynamic_form_preview.php similarity index 100% rename from includes/admin/templates/modal/dynamic_form_preview.php rename to includes/admin/templates/modal/forms/dynamic_form_preview.php diff --git a/includes/admin/templates/modal/dynamic_new_divider.php b/includes/admin/templates/modal/forms/dynamic_new_divider.php similarity index 100% rename from includes/admin/templates/modal/dynamic_new_divider.php rename to includes/admin/templates/modal/forms/dynamic_new_divider.php diff --git a/includes/admin/templates/modal/dynamic_new_field.php b/includes/admin/templates/modal/forms/dynamic_new_field.php similarity index 100% rename from includes/admin/templates/modal/dynamic_new_field.php rename to includes/admin/templates/modal/forms/dynamic_new_field.php diff --git a/includes/admin/templates/modal/dynamic_new_group.php b/includes/admin/templates/modal/forms/dynamic_new_group.php similarity index 100% rename from includes/admin/templates/modal/dynamic_new_group.php rename to includes/admin/templates/modal/forms/dynamic_new_group.php diff --git a/includes/admin/templates/modal/dynamic_registration_preview.php b/includes/admin/templates/modal/forms/dynamic_registration_preview.php similarity index 100% rename from includes/admin/templates/modal/dynamic_registration_preview.php rename to includes/admin/templates/modal/forms/dynamic_registration_preview.php diff --git a/includes/admin/templates/modal/fields.php b/includes/admin/templates/modal/forms/fields.php similarity index 100% rename from includes/admin/templates/modal/fields.php rename to includes/admin/templates/modal/forms/fields.php diff --git a/includes/admin/templates/modal/fonticons.php b/includes/admin/templates/modal/forms/fonticons.php similarity index 100% rename from includes/admin/templates/modal/fonticons.php rename to includes/admin/templates/modal/forms/fonticons.php