- setting for new FA and enqueue styles based on this option;

This commit is contained in:
Mykyta Synelnikov
2024-04-17 12:54:07 +03:00
parent e1fbd249ff
commit 9a4bf10df5
6 changed files with 41 additions and 3 deletions
+3 -1
View File
@@ -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 );
@@ -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] );
}
}
}
+8
View File
@@ -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();
+14 -1
View File
@@ -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 );
}
}
+2 -1
View File
@@ -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.
+1
View File
@@ -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**