diff --git a/includes/admin/class-enqueue.php b/includes/admin/class-enqueue.php index d17bfc88..c33d4c73 100644 --- a/includes/admin/class-enqueue.php +++ b/includes/admin/class-enqueue.php @@ -191,7 +191,9 @@ final class Enqueue extends \um\common\Enqueue { wp_style_add_data( 'um_members', 'suffix', $suffix ); } - wp_register_style( 'um_styles', $css_url . 'um-styles' . $suffix . '.css', array( 'um_ui', 'um_tipsy', 'um_raty', 'um_fonticons_ii', 'um_fonticons_fa', 'select2' ), UM_VERSION ); + $deps = array_merge( array( 'um_ui', 'um_tipsy', 'um_raty', 'select2' ), self::$fonticons_handlers ); + + wp_register_style( 'um_styles', $css_url . 'um-styles' . $suffix . '.css', $deps, UM_VERSION ); wp_register_style( 'um_profile', $css_url . 'um-profile' . $suffix . '.css', array(), UM_VERSION ); wp_register_style( 'um_responsive', $css_url . 'um-responsive' . $suffix . '.css', array( 'um_profile' ), UM_VERSION ); wp_register_style( 'um_account', $css_url . 'um-account' . $suffix . '.css', array(), UM_VERSION ); diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index 74af0edc..6d1c7464 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -2112,6 +2112,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { 'checkbox_label' => __( 'Enable Gutenberg Blocks', 'ultimate-member' ), 'description' => __( 'Check this box if you would like to use Ultimate Member blocks in Gutenberg editor. Important some themes have the conflicts with Gutenberg editor.', 'ultimate-member' ), ), + array( + 'id' => 'enable_new_fonticons', + 'type' => 'checkbox', + 'label' => __( 'New fonticons', 'ultimate-member' ), + 'checkbox_label' => __( 'Enable new fonticons', 'ultimate-member' ), + 'description' => __( 'Check this box if you would like to enable new Ultimate Member fonticons used latest version of FontAwesome library.', 'ultimate-member' ), + ), $same_page_update, ), ), @@ -2222,6 +2229,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { } else { unset( $this->settings_structure['advanced']['sections']['features']['form_sections']['beta_features'] ); + + $first_activation_date = get_option( 'um_first_activation_date', false ); + // @todo new version + if ( empty( $first_activation_date ) || $first_activation_date >= 1713342395 ) { + unset( $this->settings_structure['advanced']['sections']['features']['form_sections']['features']['fields'][1] ); + } } } diff --git a/includes/class-config.php b/includes/class-config.php index 3d3039a5..2bdb2257 100644 --- a/includes/class-config.php +++ b/includes/class-config.php @@ -600,8 +600,16 @@ if ( ! class_exists( 'um\Config' ) ) { 'secure_notify_admins_banned_accounts__interval' => 'instant', 'secure_allowed_redirect_hosts' => '', 'delete_comments' => false, + 'enable_new_fonticons' => false, ); + $first_activation_date = get_option( 'um_first_activation_date', false ); + // @todo new version + if ( empty( $first_activation_date ) || $first_activation_date >= 1713342395 ) { + // first install set this option to true by default + $this->settings_defaults['enable_new_fonticons'] = true; + } + add_filter( 'um_get_tabs_from_config', '__return_true' ); $tabs = UM()->profile()->tabs(); diff --git a/includes/common/class-enqueue.php b/includes/common/class-enqueue.php index df9aa407..03d57315 100644 --- a/includes/common/class-enqueue.php +++ b/includes/common/class-enqueue.php @@ -36,6 +36,8 @@ class Enqueue { */ public static $select2_handle = 'select2'; + public static $fonticons_handlers = array(); + /** * Enqueue constructor. * @@ -259,6 +261,16 @@ class Enqueue { // Legacy FontIcons. wp_register_style( 'um_fonticons_ii', $libs_url . 'legacy/fonticons/fonticons-ii' . $suffix . '.css', array(), UM_VERSION ); // Ionicons wp_register_style( 'um_fonticons_fa', $libs_url . 'legacy/fonticons/fonticons-fa' . $suffix . '.css', array(), UM_VERSION ); // FontAwesome + $fonticons_handlers = array( 'um_fonticons_ii', 'um_fonticons_fa' ); + // New FontIcons from FontAwesome. + $first_activation_date = get_option( 'um_first_activation_date', false ); + // @todo new version + if ( empty( $first_activation_date ) || $first_activation_date >= 1713342395 || UM()->options()->get( 'enable_new_fonticons' ) ) { + // First install set this option to true by default and use new FontAwesome icons + wp_register_style( 'um_fontawesome', $css_url . 'um-fontawesome' . $suffix . '.css', array(), '6.5.2' ); // New FontAwesome + $fonticons_handlers[] = 'um_fontawesome'; + } + self::$fonticons_handlers = $fonticons_handlers; // Select2 JS. $this->register_select2(); @@ -310,6 +322,7 @@ class Enqueue { $um_common_variables = apply_filters( 'um_common_js_variables', $um_common_variables ); wp_localize_script( 'um_common', 'um_common_variables', $um_common_variables ); - wp_register_style( 'um_common', $css_url . 'common' . $suffix . '.css', array( 'um_tipsy', 'um_datetime_date', 'um_datetime_time', 'um_fonticons_ii', 'um_fonticons_fa' ), UM_VERSION ); + $common_css_deps = array_merge( array( 'um_tipsy', 'um_datetime_date', 'um_datetime_time' ), self::$fonticons_handlers ); + wp_register_style( 'um_common', $css_url . 'common' . $suffix . '.css', $common_css_deps, UM_VERSION ); } } diff --git a/includes/frontend/class-enqueue.php b/includes/frontend/class-enqueue.php index 59e2740f..2a6393f2 100644 --- a/includes/frontend/class-enqueue.php +++ b/includes/frontend/class-enqueue.php @@ -191,7 +191,8 @@ final class Enqueue extends \um\common\Enqueue { // Workaround when select2 deregistered (e.g. Woo + Impreza theme activated). $this->register_select2(); - wp_register_style( 'um_styles', $css_url . 'um-styles' . $suffix . '.css', array( 'um_ui', 'um_tipsy', 'um_raty', 'um_fonticons_ii', 'um_fonticons_fa', 'select2', 'um_fileupload', 'um_common', 'um_responsive', 'um_modal' ), UM_VERSION ); + $deps = array_merge( array( 'um_ui', 'um_tipsy', 'um_raty', 'select2', 'um_fileupload', 'um_common', 'um_responsive', 'um_modal' ), self::$fonticons_handlers ); + wp_register_style( 'um_styles', $css_url . 'um-styles' . $suffix . '.css', $deps, UM_VERSION ); wp_register_style( 'um_members', $css_url . 'um-members' . $suffix . '.css', array( 'um_styles' ), UM_VERSION ); // RTL styles. diff --git a/readme.txt b/readme.txt index 517fbb3f..e1bb84a7 100644 --- a/readme.txt +++ b/readme.txt @@ -172,6 +172,7 @@ IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSI * Added: Member Directory > Admin Filtering supports datepicker and timepicker filter-types with only "From" or "To" filled value * Added: Ability to customize modal templates upload-single.php and view-photo.php +* Added: New FA. Find this string `1713342395` and change to the current time of the version release **Bugfixes**