- added UM_DEV_MODE constant -> display Experimental features;

This commit is contained in:
Mykyta Synelnikov
2024-01-18 16:00:11 +02:00
parent 93c2989aa1
commit 328de82d60
4 changed files with 26 additions and 6 deletions
+1 -1
View File
@@ -555,7 +555,7 @@ final class Enqueue extends \um\common\Enqueue {
wp_enqueue_style( 'um_admin_common' );
if ( self::$um_cpt_form_screen ) {
if ( defined( 'UM_LEGACY_BUILDER_OFF' ) && UM_LEGACY_BUILDER_OFF ) {
if ( defined( 'UM_DEV_MODE' ) && UM_DEV_MODE && UM()->options()->get( 'enable_new_form_builder' ) ) {
// Do new assets.
} else {
$this->load_builder();
+1 -1
View File
@@ -1021,7 +1021,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
public function add_metabox_form() {
add_meta_box( 'submitdiv', __( 'Publish', 'ultimate-member' ), array( $this, 'custom_submitdiv' ), 'um_form', 'side', 'high' );
if ( defined( 'UM_LEGACY_BUILDER_OFF' ) && UM_LEGACY_BUILDER_OFF ) {
if ( defined( 'UM_DEV_MODE' ) && UM_DEV_MODE && UM()->options()->get( 'enable_new_form_builder' ) ) {
// Do new metabox.
} else {
add_meta_box( 'um-admin-form-mode', __( 'Select Form Type', 'ultimate-member' ), array( &$this, 'load_metabox_form' ), 'um_form', 'normal', 'default' );
+23 -3
View File
@@ -2025,11 +2025,25 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'description' => __( 'These features are either experimental or incomplete, enable them at your own risk!', 'ultimate-member' ),
'fields' => array(
array(
'id' => 'disable_legacy_fonicons',
'id' => 'enable_new_ui',
'type' => 'checkbox',
'label' => __( 'Design scheme', 'ultimate-member' ),
'checkbox_label' => __( 'Enable new UI (for developers only)', 'ultimate-member' ),
'description' => __( 'Check this box if you would like to enable new UI.', 'ultimate-member' ),
),
array(
'id' => 'enable_new_form_builder',
'type' => 'checkbox',
'label' => __( 'Form Builder', 'ultimate-member' ),
'checkbox_label' => __( 'Enable new Form Builder (for developers only)', 'ultimate-member' ),
'description' => __( 'Check this box if you would like to enable new Form Builder.', 'ultimate-member' ),
),
array(
'id' => 'enable_legacy_fonticons',
'type' => 'checkbox',
'label' => __( 'Legacy fonticons', 'ultimate-member' ),
'checkbox_label' => __( 'Disable legacy fonticons', 'ultimate-member' ),
'description' => __( 'Check this box if you would like to disable legacy Ultimate Member fonticons used outdated versions of FontAwesome and Ionicons libraries.', 'ultimate-member' ),
'checkbox_label' => __( 'Enable legacy fonticons', 'ultimate-member' ),
'description' => __( 'Check this box if you would like to enable legacy Ultimate Member fonticons used outdated versions of FontAwesome and Ionicons libraries.', 'ultimate-member' ),
),
),
),
@@ -2062,6 +2076,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
), // @todo remove since 2.9.0
)
);
if ( defined( 'UM_DEV_MODE' ) && UM_DEV_MODE ) {
} else {
unset( $this->settings_structure['advanced']['sections']['features']['form_sections']['beta_features'] );
}
}
/**