mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Merge pull request #1509 from ultimatemember/feature/new_fa
Include FontAwesome 6.5.2
This commit is contained in:
@@ -140,6 +140,13 @@
|
||||
width: 33%;
|
||||
position: relative;
|
||||
}
|
||||
.um-admin-tri[data-select2-id] {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
._heading_text[data-select2-id] {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.um-admin-error-block,
|
||||
.um-admin-success-block {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -98,7 +98,12 @@
|
||||
float: left
|
||||
width: 33%
|
||||
position: relative
|
||||
&[data-select2-id]
|
||||
position: relative
|
||||
|
||||
._heading_text
|
||||
&[data-select2-id]
|
||||
position: relative
|
||||
|
||||
.#{$prefix}admin-error-block,
|
||||
.#{$prefix}admin-success-block
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Vendored
+21
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
|
||||
$fa-font-path: "../libs/fontawesome/webfonts"
|
||||
|
||||
.um,
|
||||
.um-icon-within
|
||||
@import "../libs/fontawesome/scss/fontawesome.scss"
|
||||
@import "../libs/fontawesome/scss/brands.scss"
|
||||
@import "../libs/fontawesome/scss/regular.scss"
|
||||
@import "../libs/fontawesome/scss/solid.scss"
|
||||
@import "../libs/fontawesome/scss/v4-shims.scss"
|
||||
@@ -188,6 +188,7 @@ wp.hooks.addAction( 'um_admin_modal_success_result', 'um_admin_builder', functio
|
||||
|
||||
UM.admin.colorPicker.init();
|
||||
UM.common.datetimePicker.init();
|
||||
UM.admin.iconSelector.init();
|
||||
});
|
||||
|
||||
wp.hooks.addAction( 'um_admin_modal_resize', 'um_admin_builder', function() {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -33,10 +33,83 @@ UM.admin = {
|
||||
$colorPicker.wpColorPicker();
|
||||
}
|
||||
}
|
||||
},
|
||||
iconSelector: {
|
||||
init: function () {
|
||||
let $iconSelector = jQuery('.um-icon-select-field');
|
||||
if ( $iconSelector.length ) {
|
||||
|
||||
function iformat( icon ) {
|
||||
let originalOption = icon.element;
|
||||
if ( 'undefined' !== typeof originalOption ) {
|
||||
return jQuery('<span><i class="' + jQuery( originalOption ).val() + '"></i> ' + icon.text + '</span>');
|
||||
} else {
|
||||
return jQuery('<span><i class="' + icon.id + '"></i> ' + icon.text + '</span>');
|
||||
}
|
||||
}
|
||||
|
||||
let select2_atts = {
|
||||
ajax: {
|
||||
url: wp.ajax.settings.url,
|
||||
dataType: 'json',
|
||||
delay: 250, // delay in ms while typing when to perform a AJAX search
|
||||
data: function( params ) {
|
||||
return {
|
||||
search: params.term, // search query
|
||||
action: 'um_get_icons', // AJAX action for admin-ajax.php
|
||||
page: params.page || 1, // infinite scroll pagination
|
||||
nonce: um_admin_scripts.nonce
|
||||
};
|
||||
},
|
||||
processResults: function( response, params ) {
|
||||
params.page = params.page || 1;
|
||||
var options = [];
|
||||
|
||||
if ( response.data.icons ) {
|
||||
// data is the array of arrays, and each of them contains ID and the Label of the option
|
||||
jQuery.each( response.data.icons, function( index, text ) {
|
||||
options.push( { id: index, text: text.label } );
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
results: options,
|
||||
pagination: {
|
||||
more: ( params.page * 50 ) < response.data.total_count
|
||||
}
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
},
|
||||
minimumInputLength: 0, // the minimum of symbols to input before perform a search
|
||||
allowClear: true,
|
||||
width: "100%",
|
||||
allowHtml: true,
|
||||
templateSelection: iformat,
|
||||
templateResult: iformat,
|
||||
dropdownCssClass: 'um-select2-icon-dropdown',
|
||||
containerCssClass : 'um-select2-icon-container'
|
||||
};
|
||||
|
||||
if ( $iconSelector.parents('.um-icon-select-field-wrapper').length ) {
|
||||
select2_atts.dropdownParent = $iconSelector.parents('.um-icon-select-field-wrapper');
|
||||
}
|
||||
|
||||
$iconSelector.select2( select2_atts ).on( 'change', function () {
|
||||
// handle outdated icons and remove them after select new one.
|
||||
let oldWrapper = $iconSelector.siblings('.um_admin_fonticon_wrapper');
|
||||
if ( oldWrapper.length > 0 ) {
|
||||
oldWrapper.find('.um_old_icon_field_value').val( $iconSelector.val() );
|
||||
oldWrapper.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
UM.admin.tooltip.init();
|
||||
UM.admin.colorPicker.init();
|
||||
UM.admin.iconSelector.init();
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof window.UM.admin&&(window.UM.admin={}),UM.admin={tooltip:{all:null,init:function(){var o=jQuery(".um_tooltip");0<o.length&&(UM.admin.tooltip.all=o.tooltip({tooltipClass:"um_tooltip",content:function(){return jQuery(this).attr("title")}}))},close:function(){null!==UM.admin.tooltip.all&&0<UM.admin.tooltip.all&&"function"==typeof UM.admin.tooltip.all.tooltip&&UM.admin.tooltip.all.tooltip("close")}},colorPicker:{init:function(){var o=jQuery(".um-admin-colorpicker");o.length&&o.wpColorPicker()}}},jQuery(document).ready(function(){UM.admin.tooltip.init(),UM.admin.colorPicker.init()});
|
||||
"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof window.UM.admin&&(window.UM.admin={}),UM.admin={tooltip:{all:null,init:function(){var t=jQuery(".um_tooltip");0<t.length&&(UM.admin.tooltip.all=t.tooltip({tooltipClass:"um_tooltip",content:function(){return jQuery(this).attr("title")}}))},close:function(){null!==UM.admin.tooltip.all&&0<UM.admin.tooltip.all&&"function"==typeof UM.admin.tooltip.all.tooltip&&UM.admin.tooltip.all.tooltip("close")}},colorPicker:{init:function(){var t=jQuery(".um-admin-colorpicker");t.length&&t.wpColorPicker()}},iconSelector:{init:function(){let n=jQuery(".um-icon-select-field");function t(t){var n=t.element;return void 0!==n?jQuery('<span><i class="'+jQuery(n).val()+'"></i> '+t.text+"</span>"):jQuery('<span><i class="'+t.id+'"></i> '+t.text+"</span>")}var e;n.length&&(e={ajax:{url:wp.ajax.settings.url,dataType:"json",delay:250,data:function(t){return{search:t.term,action:"um_get_icons",page:t.page||1,nonce:um_admin_scripts.nonce}},processResults:function(t,n){n.page=n.page||1;var e=[];return t.data.icons&&jQuery.each(t.data.icons,function(t,n){e.push({id:t,text:n.label})}),{results:e,pagination:{more:50*n.page<t.data.total_count}}},cache:!0},minimumInputLength:0,allowClear:!0,width:"100%",allowHtml:!0,templateSelection:t,templateResult:t,dropdownCssClass:"um-select2-icon-dropdown",containerCssClass:"um-select2-icon-container"},n.parents(".um-icon-select-field-wrapper").length&&(e.dropdownParent=n.parents(".um-icon-select-field-wrapper")),n.select2(e).on("change",function(){var t=n.siblings(".um_admin_fonticon_wrapper");0<t.length&&(t.find(".um_old_icon_field_value").val(n.val()),t.hide())}))}}},jQuery(document).ready(function(){UM.admin.tooltip.init(),UM.admin.colorPicker.init(),UM.admin.iconSelector.init()});
|
||||
@@ -30,7 +30,12 @@ UM.admin.modal = {
|
||||
UM.common.tipsy.hide();
|
||||
|
||||
jQuery('body').removeClass('um-admin-modal-open');
|
||||
jQuery('.um-admin-modal div[id^="UM_"]').hide().appendTo('body');
|
||||
|
||||
let $modalBlock = jQuery('.um-admin-modal div[id^="UM_"]');
|
||||
let $modalInner = $modalBlock.find( '.um-admin-modal-body.um-admin-metabox' );
|
||||
$modalInner.html('').attr('data-select2-id', null);
|
||||
$modalBlock.hide().appendTo('body');
|
||||
|
||||
jQuery('.um-admin-modal,.um-admin-overlay').remove();
|
||||
},
|
||||
resize: function () {
|
||||
@@ -181,16 +186,30 @@ jQuery(document).ready(function() {
|
||||
/**
|
||||
restore font icon
|
||||
**/
|
||||
// jQuery(document.body).on('click', 'span.um-admin-icon-clear', function(){
|
||||
// var element = jQuery(this).parents('p');
|
||||
// jQuery('#UM_fonticons a.um-admin-modal-back').attr('data-code', '');
|
||||
// element.find('input[type="hidden"]').val('');
|
||||
// element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
//
|
||||
// element = jQuery(this).parents('td');
|
||||
// element.find('input[type="hidden"]').val('');
|
||||
// element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
// jQuery(this).removeClass('show');
|
||||
// });
|
||||
|
||||
jQuery(document.body).on('click', 'span.um-admin-icon-clear', function(){
|
||||
var element = jQuery(this).parents('p');
|
||||
jQuery('#UM_fonticons a.um-admin-modal-back').attr('data-code', '');
|
||||
element.find('input[type="hidden"]').val('');
|
||||
element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
element.find('.um_admin_fonticon_wrapper').hide();
|
||||
// element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
|
||||
element = jQuery(this).parents('td');
|
||||
element.find('input[type="hidden"]').val('');
|
||||
element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
jQuery(this).removeClass('show');
|
||||
element.find('.um_admin_fonticon_wrapper').hide();
|
||||
//element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
//jQuery(this).removeClass('show');
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+152
@@ -0,0 +1,152 @@
|
||||
// animating icons
|
||||
// --------------------------
|
||||
|
||||
.#{$fa-css-prefix}-beat {
|
||||
animation-name: #{$fa-css-prefix}-beat;
|
||||
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
||||
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
||||
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
||||
animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
|
||||
animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, ease-in-out);
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-bounce {
|
||||
animation-name: #{$fa-css-prefix}-bounce;
|
||||
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
||||
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
||||
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
||||
animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
|
||||
animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, cubic-bezier(0.280, 0.840, 0.420, 1));
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-fade {
|
||||
animation-name: #{$fa-css-prefix}-fade;
|
||||
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
||||
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
||||
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
||||
animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
|
||||
animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, cubic-bezier(.4,0,.6,1));
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-beat-fade {
|
||||
animation-name: #{$fa-css-prefix}-beat-fade;
|
||||
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
||||
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
||||
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
||||
animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
|
||||
animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, cubic-bezier(.4,0,.6,1));
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-flip {
|
||||
animation-name: #{$fa-css-prefix}-flip;
|
||||
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
||||
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
||||
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
||||
animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
|
||||
animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, ease-in-out);
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-shake {
|
||||
animation-name: #{$fa-css-prefix}-shake;
|
||||
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
||||
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
||||
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
||||
animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
|
||||
animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, linear);
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-spin {
|
||||
animation-name: #{$fa-css-prefix}-spin;
|
||||
animation-delay: var(--#{$fa-css-prefix}-animation-delay, 0s);
|
||||
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
||||
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 2s);
|
||||
animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
|
||||
animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, linear);
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-spin-reverse {
|
||||
--#{$fa-css-prefix}-animation-direction: reverse;
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-pulse,
|
||||
.#{$fa-css-prefix}-spin-pulse {
|
||||
animation-name: #{$fa-css-prefix}-spin;
|
||||
animation-direction: var(--#{$fa-css-prefix}-animation-direction, normal);
|
||||
animation-duration: var(--#{$fa-css-prefix}-animation-duration, 1s);
|
||||
animation-iteration-count: var(--#{$fa-css-prefix}-animation-iteration-count, infinite);
|
||||
animation-timing-function: var(--#{$fa-css-prefix}-animation-timing, steps(8));
|
||||
}
|
||||
|
||||
// if agent or operating system prefers reduced motion, disable animations
|
||||
// see: https://www.smashingmagazine.com/2020/09/design-reduced-motion-sensitivities/
|
||||
// see: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.#{$fa-css-prefix}-beat,
|
||||
.#{$fa-css-prefix}-bounce,
|
||||
.#{$fa-css-prefix}-fade,
|
||||
.#{$fa-css-prefix}-beat-fade,
|
||||
.#{$fa-css-prefix}-flip,
|
||||
.#{$fa-css-prefix}-pulse,
|
||||
.#{$fa-css-prefix}-shake,
|
||||
.#{$fa-css-prefix}-spin,
|
||||
.#{$fa-css-prefix}-spin-pulse {
|
||||
animation-delay: -1ms;
|
||||
animation-duration: 1ms;
|
||||
animation-iteration-count: 1;
|
||||
transition-delay: 0s;
|
||||
transition-duration: 0s;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes #{$fa-css-prefix}-beat {
|
||||
0%, 90% { transform: scale(1); }
|
||||
45% { transform: scale(var(--#{$fa-css-prefix}-beat-scale, 1.25)); }
|
||||
}
|
||||
|
||||
@keyframes #{$fa-css-prefix}-bounce {
|
||||
0% { transform: scale(1,1) translateY(0); }
|
||||
10% { transform: scale(var(--#{$fa-css-prefix}-bounce-start-scale-x, 1.1),var(--#{$fa-css-prefix}-bounce-start-scale-y, 0.9)) translateY(0); }
|
||||
30% { transform: scale(var(--#{$fa-css-prefix}-bounce-jump-scale-x, 0.9),var(--#{$fa-css-prefix}-bounce-jump-scale-y, 1.1)) translateY(var(--#{$fa-css-prefix}-bounce-height, -0.5em)); }
|
||||
50% { transform: scale(var(--#{$fa-css-prefix}-bounce-land-scale-x, 1.05),var(--#{$fa-css-prefix}-bounce-land-scale-y, 0.95)) translateY(0); }
|
||||
57% { transform: scale(1,1) translateY(var(--#{$fa-css-prefix}-bounce-rebound, -0.125em)); }
|
||||
64% { transform: scale(1,1) translateY(0); }
|
||||
100% { transform: scale(1,1) translateY(0); }
|
||||
}
|
||||
|
||||
@keyframes #{$fa-css-prefix}-fade {
|
||||
50% { opacity: var(--#{$fa-css-prefix}-fade-opacity, 0.4); }
|
||||
}
|
||||
|
||||
@keyframes #{$fa-css-prefix}-beat-fade {
|
||||
0%, 100% {
|
||||
opacity: var(--#{$fa-css-prefix}-beat-fade-opacity, 0.4);
|
||||
transform: scale(1);
|
||||
}
|
||||
50% {
|
||||
opacity: 1;
|
||||
transform: scale(var(--#{$fa-css-prefix}-beat-fade-scale, 1.125));
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes #{$fa-css-prefix}-flip {
|
||||
50% {
|
||||
transform: rotate3d(var(--#{$fa-css-prefix}-flip-x, 0), var(--#{$fa-css-prefix}-flip-y, 1), var(--#{$fa-css-prefix}-flip-z, 0), var(--#{$fa-css-prefix}-flip-angle, -180deg));
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes #{$fa-css-prefix}-shake {
|
||||
0% { transform: rotate(-15deg); }
|
||||
4% { transform: rotate(15deg); }
|
||||
8%, 24% { transform: rotate(-18deg); }
|
||||
12%, 28% { transform: rotate(18deg); }
|
||||
16% { transform: rotate(-22deg); }
|
||||
20% { transform: rotate(22deg); }
|
||||
32% { transform: rotate(-12deg); }
|
||||
36% { transform: rotate(12deg); }
|
||||
40%, 100% { transform: rotate(0deg); }
|
||||
}
|
||||
|
||||
@keyframes #{$fa-css-prefix}-spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// bordered + pulled icons
|
||||
// -------------------------
|
||||
|
||||
.#{$fa-css-prefix}-border {
|
||||
border-color: var(--#{$fa-css-prefix}-border-color, #{$fa-border-color});
|
||||
border-radius: var(--#{$fa-css-prefix}-border-radius, #{$fa-border-radius});
|
||||
border-style: var(--#{$fa-css-prefix}-border-style, #{$fa-border-style});
|
||||
border-width: var(--#{$fa-css-prefix}-border-width, #{$fa-border-width});
|
||||
padding: var(--#{$fa-css-prefix}-border-padding, #{$fa-border-padding});
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-pull-left {
|
||||
float: left;
|
||||
margin-right: var(--#{$fa-css-prefix}-pull-margin, #{$fa-pull-margin});
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-pull-right {
|
||||
float: right;
|
||||
margin-left: var(--#{$fa-css-prefix}-pull-margin, #{$fa-pull-margin});
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
// base icon class definition
|
||||
// -------------------------
|
||||
|
||||
.#{$fa-css-prefix} {
|
||||
font-family: var(--#{$fa-css-prefix}-style-family, '#{$fa-style-family}');
|
||||
font-weight: var(--#{$fa-css-prefix}-style, #{$fa-style});
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix},
|
||||
.#{$fa-css-prefix}-classic,
|
||||
.#{$fa-css-prefix}-sharp,
|
||||
.fas,
|
||||
.#{$fa-css-prefix}-solid,
|
||||
.far,
|
||||
.#{$fa-css-prefix}-regular,
|
||||
.fab,
|
||||
.#{$fa-css-prefix}-brands {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
display: var(--#{$fa-css-prefix}-display, #{$fa-display});
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
line-height: 1;
|
||||
text-rendering: auto;
|
||||
}
|
||||
|
||||
.fas,
|
||||
.#{$fa-css-prefix}-classic,
|
||||
.#{$fa-css-prefix}-solid,
|
||||
.far,
|
||||
.#{$fa-css-prefix}-regular {
|
||||
font-family: 'Font Awesome 6 Free';
|
||||
}
|
||||
|
||||
.fab,
|
||||
.#{$fa-css-prefix}-brands {
|
||||
font-family: 'Font Awesome 6 Brands';
|
||||
}
|
||||
|
||||
|
||||
%fa-icon {
|
||||
@include fa-icon;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// fixed-width icons
|
||||
// -------------------------
|
||||
|
||||
.#{$fa-css-prefix}-fw {
|
||||
text-align: center;
|
||||
width: $fa-fw-width;
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
// functions
|
||||
// --------------------------
|
||||
|
||||
// fa-content: convenience function used to set content property
|
||||
@function fa-content($fa-var) {
|
||||
@return unquote("\"#{ $fa-var }\"");
|
||||
}
|
||||
|
||||
// fa-divide: Originally obtained from the Bootstrap https://github.com/twbs/bootstrap
|
||||
//
|
||||
// Licensed under: The MIT License (MIT)
|
||||
//
|
||||
// Copyright (c) 2011-2021 Twitter, Inc.
|
||||
// Copyright (c) 2011-2021 The Bootstrap Authors
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
@function fa-divide($dividend, $divisor, $precision: 10) {
|
||||
$sign: if($dividend > 0 and $divisor > 0, 1, -1);
|
||||
$dividend: abs($dividend);
|
||||
$divisor: abs($divisor);
|
||||
$quotient: 0;
|
||||
$remainder: $dividend;
|
||||
@if $dividend == 0 {
|
||||
@return 0;
|
||||
}
|
||||
@if $divisor == 0 {
|
||||
@error "Cannot divide by 0";
|
||||
}
|
||||
@if $divisor == 1 {
|
||||
@return $dividend;
|
||||
}
|
||||
@while $remainder >= $divisor {
|
||||
$quotient: $quotient + 1;
|
||||
$remainder: $remainder - $divisor;
|
||||
}
|
||||
@if $remainder > 0 and $precision > 0 {
|
||||
$remainder: fa-divide($remainder * 10, $divisor, $precision - 1) * .1;
|
||||
}
|
||||
@return ($quotient + $remainder) * $sign;
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// specific icon class definition
|
||||
// -------------------------
|
||||
|
||||
/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
|
||||
readers do not read off random characters that represent icons */
|
||||
|
||||
@each $name, $icon in $fa-icons {
|
||||
.#{$fa-css-prefix}-#{$name}::before { content: unquote("\"#{ $icon }\""); }
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// icons in a list
|
||||
// -------------------------
|
||||
|
||||
.#{$fa-css-prefix}-ul {
|
||||
list-style-type: none;
|
||||
margin-left: var(--#{$fa-css-prefix}-li-margin, #{$fa-li-margin});
|
||||
padding-left: 0;
|
||||
|
||||
> li { position: relative; }
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-li {
|
||||
left: calc(var(--#{$fa-css-prefix}-li-width, #{$fa-li-width}) * -1);
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
width: var(--#{$fa-css-prefix}-li-width, #{$fa-li-width});
|
||||
line-height: inherit;
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
// mixins
|
||||
// --------------------------
|
||||
|
||||
// base rendering for an icon
|
||||
@mixin fa-icon {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
display: inline-block;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
// sets relative font-sizing and alignment (in _sizing)
|
||||
@mixin fa-size ($font-size) {
|
||||
font-size: fa-divide($font-size, $fa-size-scale-base) * 1em; // converts step in sizing scale into an em-based value that's relative to the scale's base
|
||||
line-height: fa-divide(1, $font-size) * 1em; // sets the line-height of the icon back to that of it's parent
|
||||
vertical-align: (fa-divide(6, $font-size) - fa-divide(3, 8)) * 1em; // vertically centers the icon taking into account the surrounding text's descender
|
||||
}
|
||||
|
||||
// only display content to screen readers
|
||||
// see: https://www.a11yproject.com/posts/2013-01-11-how-to-hide-content/
|
||||
// see: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
|
||||
@mixin fa-sr-only() {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
// use in conjunction with .sr-only to only display content when it's focused
|
||||
@mixin fa-sr-only-focusable() {
|
||||
&:not(:focus) {
|
||||
@include fa-sr-only();
|
||||
}
|
||||
}
|
||||
|
||||
// sets a specific icon family to use alongside style + icon mixins
|
||||
|
||||
// convenience mixins for declaring pseudo-elements by CSS variable,
|
||||
// including all style-specific font properties, and both the ::before
|
||||
// and ::after elements in the duotone case.
|
||||
@mixin fa-icon-solid($fa-var) {
|
||||
@extend %fa-icon;
|
||||
@extend .fa-solid;
|
||||
|
||||
&::before {
|
||||
content: unquote("\"#{ $fa-var }\"");
|
||||
}
|
||||
}
|
||||
@mixin fa-icon-regular($fa-var) {
|
||||
@extend %fa-icon;
|
||||
@extend .fa-regular;
|
||||
|
||||
&::before {
|
||||
content: unquote("\"#{ $fa-var }\"");
|
||||
}
|
||||
}
|
||||
@mixin fa-icon-brands($fa-var) {
|
||||
@extend %fa-icon;
|
||||
@extend .fa-brands;
|
||||
|
||||
&::before {
|
||||
content: unquote("\"#{ $fa-var }\"");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// rotating + flipping icons
|
||||
// -------------------------
|
||||
|
||||
.#{$fa-css-prefix}-rotate-90 {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-rotate-180 {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-rotate-270 {
|
||||
transform: rotate(270deg);
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-flip-horizontal {
|
||||
transform: scale(-1, 1);
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-flip-vertical {
|
||||
transform: scale(1, -1);
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-flip-both,
|
||||
.#{$fa-css-prefix}-flip-horizontal.#{$fa-css-prefix}-flip-vertical {
|
||||
transform: scale(-1, -1);
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-rotate-by {
|
||||
transform: rotate(var(--#{$fa-css-prefix}-rotate-angle, 0));
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// screen-reader utilities
|
||||
// -------------------------
|
||||
|
||||
// only display content to screen readers
|
||||
.sr-only,
|
||||
.#{$fa-css-prefix}-sr-only {
|
||||
@include fa-sr-only;
|
||||
}
|
||||
|
||||
// use in conjunction with .sr-only to only display content when it's focused
|
||||
.sr-only-focusable,
|
||||
.#{$fa-css-prefix}-sr-only-focusable {
|
||||
@include fa-sr-only-focusable;
|
||||
}
|
||||
+1578
File diff suppressed because it is too large
Load Diff
+16
@@ -0,0 +1,16 @@
|
||||
// sizing icons
|
||||
// -------------------------
|
||||
|
||||
// literal magnification scale
|
||||
@for $i from 1 through 10 {
|
||||
.#{$fa-css-prefix}-#{$i}x {
|
||||
font-size: $i * 1em;
|
||||
}
|
||||
}
|
||||
|
||||
// step-based scale (with alignment)
|
||||
@each $size, $value in $fa-sizes {
|
||||
.#{$fa-css-prefix}-#{$size} {
|
||||
@include fa-size($value);
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// stacking icons
|
||||
// -------------------------
|
||||
|
||||
.#{$fa-css-prefix}-stack {
|
||||
display: inline-block;
|
||||
height: 2em;
|
||||
line-height: 2em;
|
||||
position: relative;
|
||||
vertical-align: $fa-stack-vertical-align;
|
||||
width: $fa-stack-width;
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-stack-1x,
|
||||
.#{$fa-css-prefix}-stack-2x {
|
||||
left: 0;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
z-index: var(--#{$fa-css-prefix}-stack-z-index, #{$fa-stack-z-index});
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-stack-1x {
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-stack-2x {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
.#{$fa-css-prefix}-inverse {
|
||||
color: var(--#{$fa-css-prefix}-inverse, #{$fa-inverse});
|
||||
}
|
||||
+5011
File diff suppressed because it is too large
Load Diff
+30
@@ -0,0 +1,30 @@
|
||||
/*!
|
||||
* Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
* Copyright 2024 Fonticons, Inc.
|
||||
*/
|
||||
@import 'functions';
|
||||
@import 'variables';
|
||||
|
||||
:root, :host {
|
||||
--#{$fa-css-prefix}-style-family-brands: 'Font Awesome 6 Brands';
|
||||
--#{$fa-css-prefix}-font-brands: normal 400 1em/1 'Font Awesome 6 Brands';
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Font Awesome 6 Brands';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: $fa-font-display;
|
||||
src: url('#{$fa-font-path}/fa-brands-400.woff2') format('woff2'),
|
||||
url('#{$fa-font-path}/fa-brands-400.ttf') format('truetype');
|
||||
}
|
||||
|
||||
.fab,
|
||||
.#{$fa-css-prefix}-brands {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
@each $name, $icon in $fa-brand-icons {
|
||||
.#{$fa-css-prefix}-#{$name}:before { content: unquote("\"#{ $icon }\""); }
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
/*!
|
||||
* Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
* Copyright 2024 Fonticons, Inc.
|
||||
*/
|
||||
// Font Awesome core compile (Web Fonts-based)
|
||||
// -------------------------
|
||||
|
||||
@import 'functions';
|
||||
@import 'variables';
|
||||
@import 'mixins';
|
||||
@import 'core';
|
||||
@import 'sizing';
|
||||
@import 'fixed-width';
|
||||
@import 'list';
|
||||
@import 'bordered-pulled';
|
||||
@import 'animated';
|
||||
@import 'rotated-flipped';
|
||||
@import 'stacked';
|
||||
@import 'icons';
|
||||
@import 'screen-reader';
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
/*!
|
||||
* Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
* Copyright 2024 Fonticons, Inc.
|
||||
*/
|
||||
@import 'functions';
|
||||
@import 'variables';
|
||||
|
||||
:root, :host {
|
||||
--#{$fa-css-prefix}-style-family-classic: '#{ $fa-style-family }';
|
||||
--#{$fa-css-prefix}-font-regular: normal 400 1em/1 '#{ $fa-style-family }';
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Font Awesome 6 Free';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: $fa-font-display;
|
||||
src: url('#{$fa-font-path}/fa-regular-400.woff2') format('woff2'),
|
||||
url('#{$fa-font-path}/fa-regular-400.ttf') format('truetype');
|
||||
}
|
||||
|
||||
.far,
|
||||
.#{$fa-css-prefix}-regular {
|
||||
font-weight: 400;
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
/*!
|
||||
* Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
* Copyright 2024 Fonticons, Inc.
|
||||
*/
|
||||
@import 'functions';
|
||||
@import 'variables';
|
||||
|
||||
:root, :host {
|
||||
--#{$fa-css-prefix}-style-family-classic: '#{ $fa-style-family }';
|
||||
--#{$fa-css-prefix}-font-solid: normal 900 1em/1 '#{ $fa-style-family }';
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Font Awesome 6 Free';
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
font-display: $fa-font-display;
|
||||
src: url('#{$fa-font-path}/fa-solid-900.woff2') format('woff2'),
|
||||
url('#{$fa-font-path}/fa-solid-900.ttf') format('truetype');
|
||||
}
|
||||
|
||||
.fas,
|
||||
.#{$fa-css-prefix}-solid {
|
||||
font-weight: 900;
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
/*!
|
||||
* Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
* Copyright 2024 Fonticons, Inc.
|
||||
*/
|
||||
// V4 shims compile (Web Fonts-based)
|
||||
// -------------------------
|
||||
|
||||
@import 'functions';
|
||||
@import 'variables';
|
||||
@import 'shims';
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -624,7 +624,7 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'_icon' => array(
|
||||
'sanitize' => 'key',
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'_css_class' => array(
|
||||
'sanitize' => 'text',
|
||||
|
||||
@@ -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 );
|
||||
@@ -390,7 +392,8 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
wp_localize_script( 'um_admin_forms', 'um_forms_data', $forms_data );
|
||||
wp_enqueue_script( 'um_admin_forms' );
|
||||
|
||||
wp_register_style( 'um_admin_forms', $css_url . 'admin/forms' . $suffix . '.css', array( 'wp-color-picker', 'um_ui', 'select2' ), UM_VERSION );
|
||||
$deps = array_merge( array( 'wp-color-picker', 'um_ui', 'select2' ), self::$fonticons_handlers );
|
||||
wp_register_style( 'um_admin_forms', $css_url . 'admin/forms' . $suffix . '.css', $deps, UM_VERSION );
|
||||
// RTL styles.
|
||||
if ( is_rtl() ) {
|
||||
wp_style_add_data( 'um_admin_forms', 'rtl', true );
|
||||
|
||||
@@ -40,6 +40,14 @@ class Site_Health {
|
||||
);
|
||||
}
|
||||
|
||||
$first_activation_date = get_option( 'um_first_activation_date', false );
|
||||
if ( ! empty( $first_activation_date ) && $first_activation_date < 1713342395 ) {
|
||||
$tests['direct']['um_outdated_icons'] = array(
|
||||
'label' => esc_html__( 'Are the icons in Ultimate Member Forms and Settings out of date?', 'ultimate-member' ),
|
||||
'test' => array( $this, 'outdated_icons_test' ),
|
||||
);
|
||||
}
|
||||
|
||||
return $tests;
|
||||
}
|
||||
|
||||
@@ -77,6 +85,131 @@ class Site_Health {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool|array
|
||||
*/
|
||||
private function get_outdated_icons() {
|
||||
$result = array(
|
||||
'description' => '',
|
||||
'actions' => '',
|
||||
);
|
||||
|
||||
$old_icons = UM()->fonticons()->all;
|
||||
|
||||
$forms = get_posts(
|
||||
array(
|
||||
'post_type' => 'um_form',
|
||||
'posts_per_page' => -1,
|
||||
'fields' => 'ids',
|
||||
)
|
||||
);
|
||||
|
||||
$forms_count = 0;
|
||||
$break_forms = array();
|
||||
if ( ! empty( $forms ) ) {
|
||||
foreach ( $forms as $form_id ) {
|
||||
$fields = UM()->query()->get_attr( 'custom_fields', $form_id );
|
||||
if ( empty( $fields ) ) {
|
||||
continue;
|
||||
}
|
||||
foreach ( $fields as $field ) {
|
||||
if ( empty( $field['icon'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( in_array( $field['icon'], $old_icons, true ) ) {
|
||||
$break_forms[] = array(
|
||||
'id' => $form_id,
|
||||
'title' => get_the_title( $form_id ),
|
||||
'link' => get_edit_post_link( $form_id ),
|
||||
);
|
||||
$forms_count++;
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( 0 < $forms_count ) {
|
||||
$result['description'] .= sprintf(
|
||||
'<p>%s</p>',
|
||||
__( 'Your fields\' icons in the Ultimate Member Forms are out of date.', 'ultimate-member' )
|
||||
);
|
||||
|
||||
if ( ! empty( $break_forms ) ) {
|
||||
$result['description'] .= sprintf(
|
||||
'<p>%s',
|
||||
__( 'Related to Ultimate Member Forms: ', 'ultimate-member' )
|
||||
);
|
||||
|
||||
$form_links = array();
|
||||
foreach ( $break_forms as $break_form ) {
|
||||
$form_links[] = sprintf(
|
||||
'<a href="%s" target="_blank">%s (#ID: %s)</a>',
|
||||
esc_url( $break_form['link'] ),
|
||||
esc_html( $break_form['title'] ),
|
||||
esc_html( $break_form['id'] )
|
||||
);
|
||||
}
|
||||
|
||||
$result['description'] .= sprintf(
|
||||
'%s</p><hr />',
|
||||
implode( ', ', $form_links )
|
||||
);
|
||||
}
|
||||
|
||||
$result['actions'] .= sprintf(
|
||||
'<p><a href="%s">%s</a></p>',
|
||||
admin_url( 'edit.php?post_type=um_form' ),
|
||||
esc_html__( 'Edit form fields and update', 'ultimate-member' )
|
||||
);
|
||||
}
|
||||
|
||||
$result = apply_filters( 'um_get_outdated_icons_result', $result, $old_icons );
|
||||
|
||||
if ( ! empty( $result['description'] ) ) {
|
||||
$result['description'] .= sprintf(
|
||||
'<p>%s</p>',
|
||||
__( 'As soon as legacy icons will be removed old icons may break the website\'s functionality.', 'ultimate-member' )
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! empty( $result['description'] ) && ! empty( $result['actions'] ) ) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function outdated_icons_test() {
|
||||
$result = array(
|
||||
'label' => __( 'You have the most recent version of icons in Ultimate Member forms and settings', 'ultimate-member' ),
|
||||
'status' => 'good',
|
||||
'badge' => array(
|
||||
'label' => UM_PLUGIN_NAME,
|
||||
'color' => self::BADGE_COLOR,
|
||||
),
|
||||
'description' => sprintf(
|
||||
'<p>%s</p>',
|
||||
__( 'Your fields in the Ultimate Member Forms and settings have the most recent version and are ready to use.', 'ultimate-member' )
|
||||
),
|
||||
'actions' => '',
|
||||
'test' => 'um_outdated_icons',
|
||||
);
|
||||
|
||||
$outdated_icons = $this->get_outdated_icons();
|
||||
|
||||
if ( false !== $outdated_icons ) {
|
||||
$result['label'] = __( 'Some field icons and (or) Ultimate Member settings icons are out of date', 'ultimate-member' );
|
||||
$result['status'] = 'recommended';
|
||||
$result['badge']['color'] = 'orange';
|
||||
$result['description'] = $outdated_icons['description'];
|
||||
$result['actions'] = $outdated_icons['actions'];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function get_roles() {
|
||||
return UM()->roles()->get_roles();
|
||||
}
|
||||
|
||||
@@ -541,9 +541,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
|
||||
if ( empty( $field_data['id'] ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Required modal scripts for proper functioning
|
||||
UM()->admin()->enqueue()->load_modal();
|
||||
$html = '';
|
||||
|
||||
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
|
||||
$id_attr = ' id="' . esc_attr( $id ) . '" ';
|
||||
@@ -555,28 +553,37 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
|
||||
$value = $this->get_field_value( $field_data );
|
||||
$value_attr = ' value="' . esc_attr( $value ) . '" ';
|
||||
|
||||
$html = '<span class="um_admin_fonticon_wrapper"><a href="javascript:void(0);" class="button" data-modal="UM_fonticons" data-modal-size="normal" data-dynamic-content="um_admin_fonticon_selector" data-arg1="" data-arg2="" data-back="" data-icon_field="' . esc_attr( $id ) . '">' . esc_html__( 'Choose Icon', 'ultimate-member' ) . '</a>
|
||||
<span class="um-admin-icon-value">';
|
||||
UM()->setup()->set_icons_options();
|
||||
$um_icons_list = get_option( 'um_icons_list' );
|
||||
|
||||
$first_activation_date = get_option( 'um_first_activation_date', false );
|
||||
|
||||
// @todo new version
|
||||
if ( empty( $first_activation_date ) || $first_activation_date >= 1713342395 || empty( $value ) || array_key_exists( $value, $um_icons_list ) ) {
|
||||
$html .= '<select ' . $name_attr . ' ' . $id_attr . ' class="um-icon-select-field" data-placeholder="' . esc_attr__( 'Select Icon', 'ultimate-member' ) . '" ><option value="">' . esc_html__( 'Select Icon', 'ultimate-member' ) . '</option>';
|
||||
if ( ! empty( $value ) && array_key_exists( $value, $um_icons_list ) ) {
|
||||
$html .= '<option ' . $value_attr . ' selected>' . esc_html( $um_icons_list[ $value ]['label'] ) . '</option>';
|
||||
}
|
||||
$html .= '</select>';
|
||||
} else {
|
||||
// Required modal scripts for proper functioning
|
||||
UM()->admin()->enqueue()->load_modal();
|
||||
|
||||
$html .= '<select name="um_ui_icon_new" id="um_ui_icon_new" class="um-icon-select-field" data-placeholder="' . esc_attr__( 'Select Icon', 'ultimate-member' ) . '" ><option value="">' . esc_html__( 'Select Icon', 'ultimate-member' ) . '</option>';
|
||||
$html .= '</select>';
|
||||
|
||||
$html .= '<span class="um_admin_fonticon_wrapper"><span>' . esc_html__( 'The selected icon is using an outdated version. Please select the icon above to use latest version.', 'ultimate-member' ) . '</span>
|
||||
<span class="um-admin-icon-value">';
|
||||
|
||||
if ( ! empty( $value ) ) {
|
||||
$html .= '<i class="' . esc_attr( $value ) . '"></i>';
|
||||
} else {
|
||||
$html .= esc_html__( 'No Icon', 'ultimate-member' );
|
||||
}
|
||||
|
||||
$html .= '</span><input type="hidden" ' . $name_attr . ' ' . $id_attr . ' ' . $value_attr . ' />';
|
||||
|
||||
if ( ! empty( $value ) ) {
|
||||
$html .= '</span><input type="hidden" ' . $name_attr . ' ' . $id_attr . ' ' . $value_attr . ' class="um_old_icon_field_value"/>';
|
||||
$html .= '<span class="um-admin-icon-clear show"><i class="um-icon-android-cancel"></i></span>';
|
||||
} else {
|
||||
$html .= '<span class="um-admin-icon-clear"><i class="um-icon-android-cancel"></i></span>';
|
||||
$html .= '</span></span>';
|
||||
|
||||
// Required include the fonticons modal *.php file.
|
||||
UM()->metabox()->init_icon = true;
|
||||
}
|
||||
|
||||
$html .= '</span></span>';
|
||||
|
||||
// Required include the fonticons modal *.php file.
|
||||
UM()->metabox()->init_icon = true;
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
@@ -1320,6 +1320,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
// Old interface for icon selector in UM admin forms field-type 'icon'.
|
||||
if ( $this->init_icon ) {
|
||||
include_once UM_PATH . 'includes/admin/templates/modal/forms/fonticons.php';
|
||||
}
|
||||
@@ -1554,52 +1555,45 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
break;
|
||||
|
||||
case '_icon':
|
||||
UM()->setup()->set_icons_options();
|
||||
$um_icons_list = get_option( 'um_icons_list' );
|
||||
|
||||
$first_activation_date = get_option( 'um_first_activation_date', false );
|
||||
|
||||
$wrapper_classes = array(
|
||||
'um-icon-select-field-wrapper',
|
||||
);
|
||||
if ( 'row' === $this->set_field_type ) {
|
||||
$back = 'UM_edit_row';
|
||||
$wrapper_classes[] = '_heading_text';
|
||||
}
|
||||
$wrapper_classes = implode( ' ', $wrapper_classes );
|
||||
|
||||
// @todo new version
|
||||
if ( empty( $first_activation_date ) || $first_activation_date >= 1713342395 || empty( $this->edit_mode_value ) || array_key_exists( $this->edit_mode_value, $um_icons_list ) ) {
|
||||
?>
|
||||
<p class="_heading_text">
|
||||
<p class="<?php echo esc_attr( $wrapper_classes ); ?>">
|
||||
<label for="_icon"><?php esc_html_e( 'Icon', 'ultimate-member' ); ?> <?php UM()->tooltip( __( 'Select an icon to appear in the field. Leave blank if you do not want an icon to show in the field.', 'ultimate-member' ) ); ?></label>
|
||||
<span class="um_admin_fonticon_wrapper">
|
||||
<a href="javascript:void(0);" class="button" data-modal="UM_fonticons" data-modal-size="normal" data-dynamic-content="um_admin_fonticon_selector" data-arg1="" data-arg2="" data-back="<?php echo esc_attr( $back ); ?>"><?php esc_html_e( 'Choose Icon', 'ultimate-member' ); ?></a>
|
||||
|
||||
<span class="um-admin-icon-value"><?php if ( ! empty( $this->edit_mode_value ) ) { ?><i class="<?php echo esc_attr( $this->edit_mode_value ); ?>"></i><?php } else { ?><?php esc_html_e( 'No Icon', 'ultimate-member' ); ?><?php } ?></span>
|
||||
|
||||
<input type="hidden" name="_icon" id="_icon" value="<?php echo ! empty( $this->edit_mode_value ) ? esc_attr( $this->edit_mode_value ) : ''; ?>" />
|
||||
|
||||
<?php if ( ! empty( $this->edit_mode_value ) ) { ?>
|
||||
<span class="um-admin-icon-clear show"><i class="um-icon-android-cancel"></i></span>
|
||||
<?php } else { ?>
|
||||
<span class="um-admin-icon-clear"><i class="um-icon-android-cancel"></i></span>
|
||||
<select name="_icon" id="_icon" class="um-icon-select-field" data-placeholder="<?php esc_attr_e( 'Select Icon', 'ultimate-member' ); ?>" >
|
||||
<option value=""><?php esc_html_e( 'Select Icon', 'ultimate-member' ); ?></option>
|
||||
<?php if ( ! empty( $this->edit_mode_value ) && array_key_exists( $this->edit_mode_value, $um_icons_list ) ) { ?>
|
||||
<option value="<?php echo esc_attr( $this->edit_mode_value ); ?>" selected><?php echo esc_html( $um_icons_list[ $this->edit_mode_value ]['label'] ); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</p>
|
||||
<?php } else { ?>
|
||||
<p class="<?php echo esc_attr( $wrapper_classes ); ?>">
|
||||
<label for="um_ui_icon_new"><?php esc_html_e( 'Icon', 'ultimate-member' ); ?> <?php UM()->tooltip( __( 'Select an icon to appear in the field. Leave blank if you do not want an icon to show in the field.', 'ultimate-member' ) ); ?></label>
|
||||
<select name="um_ui_icon_new" id="um_ui_icon_new" class="um-icon-select-field" data-placeholder="<?php esc_attr_e( 'Select Icon', 'ultimate-member' ); ?>" >
|
||||
<option value=""><?php esc_html_e( 'Select Icon', 'ultimate-member' ); ?></option>
|
||||
</select>
|
||||
<span class="um_admin_fonticon_wrapper">
|
||||
<span><?php esc_html_e( 'The selected icon is using an outdated version. Please select the icon above to use latest version.', 'ultimate-member' ); ?></span>
|
||||
<input type="hidden" name="_icon" id="_icon" class="um_old_icon_field_value" value="<?php echo esc_attr( $this->edit_mode_value ); ?>" />
|
||||
<span class="um-admin-icon-value"><i class="<?php echo esc_attr( $this->edit_mode_value ); ?>"></i></span>
|
||||
<span class="um-admin-icon-clear show"><i class="um-icon-android-cancel"></i></span>
|
||||
</span>
|
||||
</p>
|
||||
<?php
|
||||
} else {
|
||||
if ( $this->in_edit ) {
|
||||
$back = 'UM_edit_field';
|
||||
} else {
|
||||
$back = 'UM_add_field';
|
||||
}
|
||||
?>
|
||||
<div class="um-admin-tri">
|
||||
<p>
|
||||
<label for="_icon"><?php esc_html_e( 'Icon', 'ultimate-member' ); ?> <?php UM()->tooltip( __( 'Select an icon to appear in the field. Leave blank if you do not want an icon to show in the field.', 'ultimate-member' ) ); ?></label>
|
||||
<span class="um_admin_fonticon_wrapper">
|
||||
<a href="javascript:void(0);" class="button" data-modal="UM_fonticons" data-modal-size="normal" data-dynamic-content="um_admin_fonticon_selector" data-arg1="" data-arg2="" data-back="<?php echo esc_attr( $back ); ?>"><?php esc_html_e( 'Choose Icon', 'ultimate-member' ); ?></a>
|
||||
|
||||
<span class="um-admin-icon-value"><?php if ( ! empty( $this->edit_mode_value ) ) { ?><i class="<?php echo esc_attr( $this->edit_mode_value ); ?>"></i><?php } else { ?><?php esc_html_e( 'No Icon', 'ultimate-member' ) ?><?php } ?></span>
|
||||
|
||||
<input type="hidden" name="_icon" id="_icon" value="<?php echo ! empty( $this->edit_mode_value ) ? esc_attr( $this->edit_mode_value ) : ''; ?>" />
|
||||
|
||||
<?php if ( ! empty( $this->edit_mode_value ) ) { ?>
|
||||
<span class="um-admin-icon-clear show"><i class="um-icon-android-cancel"></i></span>
|
||||
<?php } else { ?>
|
||||
<span class="um-admin-icon-clear"><i class="um-icon-android-cancel"></i></span>
|
||||
<?php } ?>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -1,23 +1,31 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) {
|
||||
<?php
|
||||
// @todo deprecate this way to select the icon as soon as possible.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} ?>
|
||||
}
|
||||
|
||||
<div id="UM_fonticons" style="display:none">
|
||||
$first_activation_date = get_option( 'um_first_activation_date', false );
|
||||
// @todo new version
|
||||
if ( ! empty( $first_activation_date ) && $first_activation_date < 1713342395 ) {
|
||||
?>
|
||||
<div id="UM_fonticons" style="display:none">
|
||||
|
||||
<div class="um-admin-modal-head">
|
||||
<h3>
|
||||
<?php
|
||||
// translators: %s: icons nubber.
|
||||
echo wp_kses( sprintf( __( 'Choose from %s available icons', 'ultimate-member' ), count( UM()->fonticons()->all ) ), UM()->get_allowed_html( 'admin_notice' ) );
|
||||
?>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="um-admin-modal-body"></div>
|
||||
|
||||
<div class="um-admin-modal-foot">
|
||||
<a href="javascript:void(0);" class="button-primary um-admin-modal-back" data-code=""><?php _e( 'Finish', 'ultimate-member' ) ?></a>
|
||||
<a href="javascript:void(0);" class="button um-admin-modal-back um-admin-modal-cancel" data-action="UM_remove_modal"><?php _e( 'Cancel', 'ultimate-member' ) ?></a>
|
||||
</div>
|
||||
|
||||
<div class="um-admin-modal-head">
|
||||
<h3>
|
||||
<?php
|
||||
// translators: %s: icons nubber.
|
||||
echo wp_kses( sprintf( __( 'Choose from %s available icons', 'ultimate-member' ), count( UM()->fonticons()->all ) ), UM()->get_allowed_html( 'admin_notice' ) );
|
||||
?>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="um-admin-modal-body"></div>
|
||||
|
||||
<div class="um-admin-modal-foot">
|
||||
<a href="javascript:void(0);" class="button-primary um-admin-modal-back" data-code=""><?php _e( 'Finish', 'ultimate-member' ) ?></a>
|
||||
<a href="javascript:void(0);" class="button um-admin-modal-back um-admin-modal-cancel" data-action="UM_remove_modal"><?php _e( 'Cancel', 'ultimate-member' ) ?></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
namespace um\ajax;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Forms
|
||||
*
|
||||
* @package um\ajax
|
||||
*/
|
||||
class Forms {
|
||||
|
||||
/**
|
||||
* Forms constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
add_action( 'wp_ajax_um_get_icons', array( $this, 'get_icons' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of the icons.
|
||||
*/
|
||||
public function get_icons() {
|
||||
UM()->admin()->check_ajax_nonce();
|
||||
|
||||
$search_request = ! empty( $_REQUEST['search'] ) ? sanitize_text_field( $_REQUEST['search'] ) : '';
|
||||
$page = ! empty( $_REQUEST['page'] ) ? absint( $_REQUEST['page'] ) : 1;
|
||||
$per_page = 50;
|
||||
|
||||
UM()->setup()->set_icons_options();
|
||||
|
||||
$um_icons_list = get_option( 'um_icons_list' );
|
||||
if ( ! empty( $search_request ) ) {
|
||||
$um_icons_list = array_filter(
|
||||
$um_icons_list,
|
||||
function( $item ) use ( $search_request ) {
|
||||
$result = array_filter(
|
||||
$item['search'],
|
||||
function( $search_item ) use ( $search_request ) {
|
||||
return stripos( $search_item, $search_request ) !== false;
|
||||
}
|
||||
);
|
||||
return count( $result ) > 0;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$total_count = count( $um_icons_list );
|
||||
|
||||
$um_icons_list = array_slice( $um_icons_list, $per_page * ( $page - 1 ), $per_page );
|
||||
|
||||
wp_send_json_success(
|
||||
array(
|
||||
'icons' => $um_icons_list,
|
||||
'total_count' => $total_count,
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -20,10 +20,23 @@ if ( ! class_exists( 'um\ajax\Init' ) ) {
|
||||
* @used-by \UM::includes()
|
||||
*/
|
||||
public function includes() {
|
||||
$this->forms();
|
||||
$this->pages();
|
||||
$this->secure();
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.8.6
|
||||
*
|
||||
* @return Forms
|
||||
*/
|
||||
public function forms() {
|
||||
if ( empty( UM()->classes['um\ajax\forms'] ) ) {
|
||||
UM()->classes['um\ajax\forms'] = new Forms();
|
||||
}
|
||||
return UM()->classes['um\ajax\forms'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.8.3
|
||||
*
|
||||
|
||||
@@ -36,6 +36,15 @@ class Enqueue {
|
||||
*/
|
||||
public static $select2_handle = 'select2';
|
||||
|
||||
public static $fonticons_handlers = array();
|
||||
|
||||
/**
|
||||
* FontAwesome version.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public static $fa_version = '6.5.2';
|
||||
|
||||
/**
|
||||
* Enqueue constructor.
|
||||
*
|
||||
@@ -259,6 +268,13 @@ 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.
|
||||
// @todo new version
|
||||
// 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(), self::$fa_version ); // New FontAwesome
|
||||
$fonticons_handlers[] = 'um_fontawesome';
|
||||
self::$fonticons_handlers = $fonticons_handlers;
|
||||
|
||||
// Select2 JS.
|
||||
$this->register_select2();
|
||||
@@ -310,6 +326,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 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'in_fields' => false,
|
||||
'form_only' => true,
|
||||
'conditional_support' => 0,
|
||||
'icon' => 'um-faicon-pencil',
|
||||
'icon' => 'fas fa-pencil',
|
||||
'col1' => array('_id','_background','_text_color','_padding','_margin','_border','_borderradius','_borderstyle','_bordercolor'),
|
||||
'col2' => array('_heading','_heading_text','_heading_background_color','_heading_text_color','_icon','_icon_color','_css_class'),
|
||||
),
|
||||
@@ -259,8 +259,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'text' => array(
|
||||
'name' => 'Text Box',
|
||||
'col1' => array('_title','_metakey','_help','_default','_min_chars','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_public','_roles','_validate','_custom_validate','_max_chars'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_public','_roles','_validate','_custom_validate','_max_chars'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -275,8 +275,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'tel' => array(
|
||||
'name' => __( 'Telephone', 'ultimate-member' ),
|
||||
'col1' => array('_title','_metakey','_help','_default','_min_chars','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_public','_roles','_validate','_custom_validate','_max_chars'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_public','_roles','_validate','_custom_validate','_max_chars'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -291,8 +291,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'number' => array(
|
||||
'name' => __('Number','ultimate-member'),
|
||||
'col1' => array('_title','_metakey','_help','_default','_min','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_public','_roles','_validate','_custom_validate','_max'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_public','_roles','_validate','_custom_validate','_max'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -307,8 +307,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'textarea' => array(
|
||||
'name' => 'Textarea',
|
||||
'col1' => array('_title','_metakey','_help','_height','_max_chars','_max_words','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_public','_roles','_default','_html'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_public','_roles','_default','_html'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -323,8 +323,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'select' => array(
|
||||
'name' => 'Dropdown',
|
||||
'col1' => array('_title','_metakey','_help','_default','_options','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_public','_roles','_custom_dropdown_options_source','_parent_dropdown_relationship'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_public','_roles','_custom_dropdown_options_source','_parent_dropdown_relationship'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -343,8 +343,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'multiselect' => array(
|
||||
'name' => 'Multi-Select',
|
||||
'col1' => array('_title','_metakey','_help','_default','_options','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_public','_roles','_min_selections','_max_selections','_custom_dropdown_options_source'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_public','_roles','_min_selections','_max_selections','_custom_dropdown_options_source'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -363,8 +363,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'radio' => array(
|
||||
'name' => 'Radio',
|
||||
'col1' => array('_title','_metakey','_help','_default','_options','_visibility'),
|
||||
'col2' => array('_label','_public','_roles'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_public','_roles'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -383,8 +383,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'checkbox' => array(
|
||||
'name' => 'Checkbox',
|
||||
'col1' => array('_title','_metakey','_help','_default','_options','_visibility'),
|
||||
'col2' => array('_label','_public','_roles','_max_selections'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_public','_roles','_max_selections'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -403,8 +403,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'url' => array(
|
||||
'name' => 'URL',
|
||||
'col1' => array('_title','_metakey','_help','_default','_url_text','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_url_target','_url_rel','_public','_roles','_validate','_custom_validate'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_url_target','_url_rel','_public','_roles','_validate','_custom_validate'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -419,8 +419,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'password' => array(
|
||||
'name' => 'Password',
|
||||
'col1' => array('_title','_metakey','_help','_min_chars','_max_chars','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_public','_roles','_force_good_pass','_force_confirm_pass','_label_confirm_pass'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_public','_roles','_force_good_pass','_force_confirm_pass','_label_confirm_pass'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -435,8 +435,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'image' => array(
|
||||
'name' => 'Image Upload',
|
||||
'col1' => array('_title','_metakey','_help','_allowed_types','_max_size','_crop','_visibility'),
|
||||
'col2' => array('_label','_public','_roles','_upload_text','_upload_help_text','_button_text'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_public','_roles','_upload_text','_upload_help_text','_button_text'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -455,8 +455,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'file' => array(
|
||||
'name' => 'File Upload',
|
||||
'col1' => array('_title','_metakey','_help','_allowed_types','_max_size','_visibility'),
|
||||
'col2' => array('_label','_public','_roles','_upload_text','_upload_help_text','_button_text'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_public','_roles','_upload_text','_upload_help_text','_button_text'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -475,8 +475,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'date' => array(
|
||||
'name' => 'Date Picker',
|
||||
'col1' => array( '_title', '_metakey', '_help', '_default', '_range', '_years', '_years_x', '_range_start', '_range_end', '_visibility' ),
|
||||
'col2' => array( '_label', '_placeholder', '_public', '_roles', '_format', '_format_custom', '_pretty_format', '_disabled_weekdays' ),
|
||||
'col3' => array( '_required', '_editable', '_icon' ),
|
||||
'col2' => array( '_label', '_icon', '_placeholder', '_public', '_roles', '_format', '_format_custom', '_pretty_format', '_disabled_weekdays' ),
|
||||
'col3' => array( '_required', '_editable' ),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -501,8 +501,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'time' => array(
|
||||
'name' => 'Time Picker',
|
||||
'col1' => array('_title','_metakey','_help','_format','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_default','_public','_roles','_intervals'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_default','_public','_roles','_intervals'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -517,8 +517,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'rating' => array(
|
||||
'name' => 'Rating',
|
||||
'col1' => array('_title','_metakey','_help','_visibility'),
|
||||
'col2' => array('_label','_public','_roles','_number','_default'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_public','_roles','_number','_default'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -590,8 +590,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'googlemap' => array(
|
||||
'name' => 'Google Map',
|
||||
'col1' => array('_title','_metakey','_help','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_public','_roles','_validate','_custom_validate'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_public','_roles','_validate','_custom_validate'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -606,8 +606,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'youtube_video' => array(
|
||||
'name' => 'YouTube Video',
|
||||
'col1' => array('_title','_metakey','_help','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_public','_roles','_validate','_custom_validate'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_public','_roles','_validate','_custom_validate'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -622,8 +622,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'vimeo_video' => array(
|
||||
'name' => 'Vimeo Video',
|
||||
'col1' => array('_title','_metakey','_help','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_public','_roles','_validate','_custom_validate'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_public','_roles','_validate','_custom_validate'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -638,8 +638,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'soundcloud_track' => array(
|
||||
'name' => 'SoundCloud Track',
|
||||
'col1' => array('_title','_metakey','_help','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_public','_roles','_validate','_custom_validate'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_public','_roles','_validate','_custom_validate'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -653,8 +653,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'spotify' => array(
|
||||
'name' => __( 'Spotify URL', 'ultimate-member' ),
|
||||
'col1' => array('_title','_metakey','_help','_visibility'),
|
||||
'col2' => array('_label','_placeholder','_public','_roles','_validate','_custom_validate'),
|
||||
'col3' => array('_required','_editable','_icon'),
|
||||
'col2' => array('_label','_icon','_placeholder','_public','_roles','_validate','_custom_validate'),
|
||||
'col3' => array('_required','_editable'),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -668,8 +668,8 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'oembed' => array(
|
||||
'name' => __( 'oEmbed', 'ultimate-member' ),
|
||||
'col1' => array( '_title', '_metakey', '_help', '_default', '_visibility' ),
|
||||
'col2' => array( '_label', '_placeholder', '_public', '_roles', '_validate', '_custom_validate' ),
|
||||
'col3' => array( '_required', '_editable', '_icon' ),
|
||||
'col2' => array( '_label', '_icon', '_placeholder', '_public', '_roles', '_validate', '_custom_validate' ),
|
||||
'col3' => array( '_required', '_editable' ),
|
||||
'validate' => array(
|
||||
'_title' => array(
|
||||
'mode' => 'required',
|
||||
@@ -917,7 +917,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'pretty_format' => 1,
|
||||
'years' => 115,
|
||||
'years_x' => 'past',
|
||||
'icon' => 'um-faicon-calendar',
|
||||
'icon' => 'far fa-calendar-days',
|
||||
),
|
||||
|
||||
'gender' => array(
|
||||
@@ -956,7 +956,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'editable' => true,
|
||||
'url_target' => '_blank',
|
||||
'url_rel' => 'nofollow',
|
||||
'icon' => 'um-faicon-facebook',
|
||||
'icon' => 'fab fa-facebook-f',
|
||||
'validate' => 'facebook_url',
|
||||
'url_text' => 'Facebook',
|
||||
'advanced' => 'social',
|
||||
@@ -974,11 +974,11 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'editable' => true,
|
||||
'url_target' => '_blank',
|
||||
'url_rel' => 'nofollow',
|
||||
'icon' => 'um-faicon-twitter', // 'fa-brands fa-x-twitter' for new FA styles
|
||||
'icon' => 'fab fa-square-x-twitter',
|
||||
'validate' => 'twitter_url',
|
||||
'url_text' => 'X',
|
||||
'advanced' => 'social',
|
||||
'color' => '#4099FF', // #0f1419 for X symbol
|
||||
'color' => '#0f1419',
|
||||
'match' => 'https://twitter.com/',
|
||||
),
|
||||
|
||||
@@ -992,7 +992,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'editable' => true,
|
||||
'url_target' => '_blank',
|
||||
'url_rel' => 'nofollow',
|
||||
'icon' => 'um-faicon-linkedin',
|
||||
'icon' => 'fab fa-linkedin-in',
|
||||
'validate' => 'linkedin_url',
|
||||
'url_text' => 'LinkedIn',
|
||||
'advanced' => 'social',
|
||||
@@ -1010,7 +1010,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'editable' => true,
|
||||
'url_target' => '_blank',
|
||||
'url_rel' => 'nofollow',
|
||||
'icon' => 'um-faicon-instagram',
|
||||
'icon' => 'fab fa-instagram',
|
||||
'validate' => 'instagram_url',
|
||||
'url_text' => 'Instagram',
|
||||
'advanced' => 'social',
|
||||
@@ -1028,7 +1028,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'editable' => true,
|
||||
'url_target' => '_blank',
|
||||
'url_rel' => 'nofollow',
|
||||
'icon' => 'um-faicon-skype',
|
||||
'icon' => 'fab fa-skype',
|
||||
'validate' => 'skype',
|
||||
'url_text' => __( 'Join chat', 'ultimate-member' ),
|
||||
),
|
||||
@@ -1043,7 +1043,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'editable' => true,
|
||||
'url_target' => '_blank',
|
||||
'url_rel' => 'nofollow',
|
||||
'icon' => 'um-icon-ios-telephone',
|
||||
'icon' => 'fab fa-viber',
|
||||
'validate' => 'phone_number',
|
||||
),
|
||||
|
||||
@@ -1057,7 +1057,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'editable' => true,
|
||||
'url_target' => '_blank',
|
||||
'url_rel' => 'nofollow',
|
||||
'icon' => 'um-icon-social-whatsapp',
|
||||
'icon' => 'fab fa-whatsapp',
|
||||
'validate' => 'phone_number',
|
||||
),
|
||||
|
||||
@@ -1071,7 +1071,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'editable' => true,
|
||||
'url_target' => '_blank',
|
||||
'url_rel' => 'nofollow',
|
||||
'icon' => 'um-faicon-paper-plane',
|
||||
'icon' => 'fab fa-telegram',
|
||||
'validate' => 'telegram_url',
|
||||
'url_text' => 'Telegram',
|
||||
'match' => 'https://t.me/',
|
||||
@@ -1085,9 +1085,12 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => true,
|
||||
'icon' => 'fab fa-discord',
|
||||
'url_target' => '_blank',
|
||||
'url_text' => __( 'Discord', 'ultimate-member' ),
|
||||
'url_rel' => 'nofollow',
|
||||
'validate' => 'discord',
|
||||
'color' => '#7289da',
|
||||
),
|
||||
|
||||
'tiktok' => array(
|
||||
@@ -1100,7 +1103,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'editable' => true,
|
||||
'url_target' => '_blank',
|
||||
'url_rel' => 'nofollow',
|
||||
'icon' => 'um-icon-ios-musical-note',
|
||||
'icon' => 'fab fa-tiktok',
|
||||
'validate' => 'tiktok_url',
|
||||
'url_text' => 'TikTok',
|
||||
'advanced' => 'social',
|
||||
@@ -1116,7 +1119,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => true,
|
||||
'icon' => 'um-faicon-twitch',
|
||||
'icon' => 'fab fa-twitch',
|
||||
'url_target' => '_blank',
|
||||
'url_rel' => 'nofollow',
|
||||
'validate' => 'twitch_url',
|
||||
@@ -1134,7 +1137,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'required' => 0,
|
||||
'public' => 1,
|
||||
'editable' => true,
|
||||
'icon' => 'um-icon-social-reddit',
|
||||
'icon' => 'fab fa-reddit-alien',
|
||||
'url_target' => '_blank',
|
||||
'url_rel' => 'nofollow',
|
||||
'validate' => 'reddit_url',
|
||||
@@ -1154,7 +1157,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'editable' => true,
|
||||
'url_target' => '_blank',
|
||||
'url_rel' => 'nofollow',
|
||||
'icon' => 'um-faicon-youtube',
|
||||
'icon' => 'fab fa-youtube',
|
||||
'validate' => 'youtube_url',
|
||||
'url_text' => __( 'YouTube', 'ultimate-member' ),
|
||||
'advanced' => 'social',
|
||||
@@ -1175,7 +1178,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'editable' => true,
|
||||
'url_target' => '_blank',
|
||||
'url_rel' => 'nofollow',
|
||||
'icon' => 'um-faicon-soundcloud',
|
||||
'icon' => 'fab fa-soundcloud',
|
||||
'validate' => 'soundcloud_url',
|
||||
'url_text' => 'SoundCloud',
|
||||
'advanced' => 'social',
|
||||
@@ -1227,7 +1230,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'public' => 1,
|
||||
'editable' => true,
|
||||
'validate' => 'phone_number',
|
||||
'icon' => 'um-faicon-phone',
|
||||
'icon' => 'fas fa-phone',
|
||||
),
|
||||
|
||||
'mobile_number' => array(
|
||||
@@ -1239,7 +1242,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'public' => 1,
|
||||
'editable' => true,
|
||||
'validate' => 'phone_number',
|
||||
'icon' => 'um-faicon-mobile',
|
||||
'icon' => 'fas fa-mobile-screen',
|
||||
),
|
||||
|
||||
// private use ( not public list )
|
||||
@@ -1250,7 +1253,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'type' => 'image',
|
||||
'label' => __('Change your profile photo','ultimate-member'),
|
||||
'upload_text' => __('Upload your photo here','ultimate-member'),
|
||||
'icon' => 'um-faicon-camera',
|
||||
'icon' => 'fas fa-camera',
|
||||
'crop' => 1,
|
||||
'max_size' => ( UM()->options()->get('profile_photo_max_size') ) ? UM()->options()->get('profile_photo_max_size') : 999999999,
|
||||
'min_width' => str_replace('px','',UM()->options()->get('profile_photosize')),
|
||||
@@ -1264,7 +1267,7 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
'type' => 'image',
|
||||
'label' => __('Change your cover photo','ultimate-member'),
|
||||
'upload_text' => __('Upload profile cover here','ultimate-member'),
|
||||
'icon' => 'um-faicon-picture-o',
|
||||
'icon' => 'far fa-image',
|
||||
'crop' => 2,
|
||||
'max_size' => ( UM()->options()->get('cover_photo_max_size') ) ? UM()->options()->get('cover_photo_max_size') : 999999999,
|
||||
'modal_size' => 'large',
|
||||
|
||||
@@ -342,5 +342,49 @@ KEY meta_value_indx (um_value(191))
|
||||
update_user_meta( $user_id, 'account_status', 'approved' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function set_icons_options() {
|
||||
$fa_version = get_option( 'um_fa_version' );
|
||||
$um_icons_list = get_option( 'um_icons_list' );
|
||||
|
||||
if ( empty( $um_icons_list ) || UM()->admin()->enqueue()::$fa_version !== $fa_version ) {
|
||||
update_option( 'um_fa_version', UM()->admin()->enqueue()::$fa_version, false );
|
||||
|
||||
$common_icons = array();
|
||||
|
||||
$icons = file_get_contents( UM_PATH . 'assets/libs/fontawesome/metadata/icons.json' );
|
||||
$icons = json_decode( $icons );
|
||||
|
||||
foreach ( $icons as $key => $data ) {
|
||||
if ( ! isset( $data->styles ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ( $data->styles as $style ) {
|
||||
$style_class = '';
|
||||
if ( 'solid' === $style ) {
|
||||
$style_class = 'fas fa-';
|
||||
} elseif ( 'regular' === $style ) {
|
||||
$style_class = 'far fa-';
|
||||
} elseif ( 'brands' === $style ) {
|
||||
$style_class = 'fab fa-';
|
||||
}
|
||||
|
||||
$label = count( $data->styles ) > 1 ? $data->label . ' (' . $style . ')' : $data->label;
|
||||
$search = array_unique( array_merge( $data->search->terms, array( $key, strtolower( $data->label ) ) ) );
|
||||
|
||||
$common_icons[ $style_class . $key ] = array(
|
||||
'label' => $label,
|
||||
'search' => $search,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
update_option( 'um_icons_list', $common_icons, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user