From 17c1b2a2500511bff8fec2ab0d2d93264718d847 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Wed, 14 Feb 2024 16:41:41 +0200 Subject: [PATCH] - added Advanced > Developers section in Settings; --- includes/admin/class-secure.php | 14 ++-- includes/admin/core/class-admin-settings.php | 67 ++++++++++++-------- 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/includes/admin/class-secure.php b/includes/admin/class-secure.php index 6395a98a..be3980c1 100644 --- a/includes/admin/class-secure.php +++ b/includes/admin/class-secure.php @@ -295,10 +295,16 @@ if ( ! class_exists( 'um\admin\Secure' ) ) { ) ); - $settings['advanced']['sections']['security'] = array( - 'title' => __( 'Security', 'ultimate-member' ), - 'description' => __( 'This feature scans for suspicious registered accounts, bans the usage of administrative capabilities to site subscribers/members, allows the website administrators to force all users to reset their passwords, preventing users from logging-in using their old passwords that may have been exposed.', 'ultimate-member' ), - 'fields' => $secure_fields, + $settings['advanced']['sections'] = UM()->array_insert_before( + $settings['advanced']['sections'], + 'developers', + array( + 'security' => array( + 'title' => __( 'Security', 'ultimate-member' ), + 'description' => __( 'This feature scans for suspicious registered accounts, bans the usage of administrative capabilities to site subscribers/members, allows the website administrators to force all users to reset their passwords, preventing users from logging-in using their old passwords that may have been exposed.', 'ultimate-member' ), + 'fields' => $secure_fields, + ), + ) ); return $settings; diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index c5aa7005..d1c17966 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -1562,28 +1562,16 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { 'description' => __( 'Allows to manage blocked data of signed up user.', 'ultimate-member' ), 'fields' => array( array( - 'id' => 'blocked_emails', - 'type' => 'textarea', - 'label' => __( 'Blocked Email Addresses (Enter one email per line)', 'ultimate-member' ), + 'id' => 'blocked_emails', + 'type' => 'textarea', + 'label' => __( 'Blocked Email Addresses (Enter one email per line)', 'ultimate-member' ), 'description' => __( 'This will block the specified e-mail addresses from being able to sign up or sign in to your site. To block an entire domain, use something like `*@domain.com`.', 'ultimate-member' ), ), array( - 'id' => 'blocked_words', - 'type' => 'textarea', - 'label' => __( 'Blacklist Words (Enter one word per line)', 'ultimate-member' ), - 'description' => __( 'This option lets you specify blacklist of words to prevent anyone from signing up with such a word as their username.', 'ultimate-member' ), - ), - ), - ), - 'fields' => array( - 'title' => __( 'Fields', 'ultimate-member' ), - 'description' => __( 'Allows to manage fields settings.', 'ultimate-member' ), - 'fields' => array( - array( - 'id' => 'allowed_choice_callbacks', + 'id' => 'blocked_words', 'type' => 'textarea', - 'label' => __( 'Allowed Choice Callbacks (Enter one PHP function per line)', 'ultimate-member' ), - 'description' => __( 'This option lets you specify the choice callback functions to prevent anyone from using 3rd-party functions that may put your site at risk.', 'ultimate-member' ), + 'label' => __( 'Blacklist Words (Enter one word per line)', 'ultimate-member' ), + 'description' => __( 'This option lets you specify blacklist of words to prevent anyone from signing up with such a word as their username.', 'ultimate-member' ), ), ), ), @@ -2130,16 +2118,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { 'checkbox_label' => __( 'Disable user data cache', 'ultimate-member' ), 'description' => __( 'Check this box if you would like to disable Ultimate Member user\'s cache.', 'ultimate-member' ), ), - array( - 'id' => 'rest_api_version', - 'type' => 'select', - 'label' => __( 'REST API version', 'ultimate-member' ), - 'description' => __( 'This controls the REST API version, we recommend to use the last version.', 'ultimate-member' ), - 'options' => array( - '1.0' => __( '1.0 version', 'ultimate-member' ), - '2.0' => __( '2.0 version', 'ultimate-member' ), - ), - ), array( 'id' => 'uninstall_on_delete', 'type' => 'checkbox', @@ -2226,6 +2204,39 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { ), ), ), + 'developers' => array( + 'title' => __( 'Developers', 'ultimate-member' ), + 'form_sections' => array( + 'fields' => array( + 'title' => __( 'Fields', 'ultimate-member' ), + 'description' => __( 'Allows to manage fields settings.', 'ultimate-member' ), + 'fields' => array( + array( + 'id' => 'allowed_choice_callbacks', + 'type' => 'textarea', + 'label' => __( 'Allowed Choice Callbacks (Enter one PHP function per line)', 'ultimate-member' ), + 'description' => __( 'This option lets you specify the choice callback functions to prevent anyone from using 3rd-party functions that may put your site at risk.', 'ultimate-member' ), + ), + ), + ), + 'rest_api' => array( + 'title' => __( 'REST API', 'ultimate-member' ), + 'description' => '', + 'fields' => array( + array( + 'id' => 'rest_api_version', + 'type' => 'select', + 'label' => __( 'Version', 'ultimate-member' ), + 'description' => __( 'This controls the REST API version, we recommend to use the last version.', 'ultimate-member' ), + 'options' => array( + '1.0' => __( '1.0 version', 'ultimate-member' ), + '2.0' => __( '2.0 version', 'ultimate-member' ), + ), + ), + ), + ), + ), + ), ), ), 'install_info' => array(