From 88f1f55f0c1ddf652b140612c57ade95bf873de4 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Thu, 1 Nov 2018 16:02:08 +0200 Subject: [PATCH 01/10] - changed enqueue; --- includes/core/class-enqueue.php | 255 +++++++++++++------------------- 1 file changed, 100 insertions(+), 155 deletions(-) diff --git a/includes/core/class-enqueue.php b/includes/core/class-enqueue.php index d35eb286..e5102597 100644 --- a/includes/core/class-enqueue.php +++ b/includes/core/class-enqueue.php @@ -1,9 +1,11 @@ js_baseurl . 'select2/select2.full.min.js', array( 'jquery', 'jquery-masonry' ), ultimatemember_version, true ); - wp_register_script( 'um_scrollbar', $this->js_baseurl . 'um-scrollbar' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true ); wp_register_script( 'um_jquery_form', $this->js_baseurl . 'um-jquery-form' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true ); @@ -96,16 +96,56 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { $datetime_deps[] = 'um_datetime_locale'; } wp_register_script( 'um_datetime', $this->js_baseurl . 'pickadate/picker.js', $datetime_deps, ultimatemember_version, true ); - wp_register_script( 'um_datetime_date', $this->js_baseurl . 'pickadate/picker.date.js', array( 'jquery' ), ultimatemember_version, true ); - wp_register_script( 'um_datetime_time', $this->js_baseurl . 'pickadate/picker.time.js', array( 'jquery' ), ultimatemember_version, true ); - wp_register_script( 'um_datetime_legacy', $this->js_baseurl . 'pickadate/legacy.js', array( 'jquery' ), ultimatemember_version, true ); - + wp_register_script( 'um_datetime_date', $this->js_baseurl . 'pickadate/picker.date.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true ); + wp_register_script( 'um_datetime_time', $this->js_baseurl . 'pickadate/picker.time.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true ); + wp_register_script( 'um_datetime_legacy', $this->js_baseurl . 'pickadate/legacy.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true ); wp_register_script( 'um_tipsy', $this->js_baseurl . 'um-tipsy' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true ); wp_register_script( 'um_raty', $this->js_baseurl . 'um-raty' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true ); wp_register_script( 'um_crop', $this->js_baseurl . 'um-crop' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true ); + wp_register_script( 'um_modal', $this->js_baseurl . 'um-modal' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'um_crop' ), ultimatemember_version, true ); + wp_register_script( 'um_responsive', $this->js_baseurl . 'um-responsive' . $this->suffix . '.js', array( 'jquery', 'um_functions', 'um_crop' ), ultimatemember_version, true ); + wp_register_script('um_functions', $this->js_baseurl . 'um-functions' . $this->suffix . '.js', array( 'jquery', 'jquery-masonry', 'wp-util', 'um_scrollbar' ), ultimatemember_version, true ); + wp_register_script( 'um-gdpr', $this->js_baseurl . 'um-gdpr' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, false ); + wp_register_script('um_conditional', $this->js_baseurl . 'um-conditional' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true ); + wp_register_script('um_scripts', $this->js_baseurl . 'um-scripts' . $this->suffix . '.js', array( 'jquery', 'wp-util' ), ultimatemember_version, true ); + /** + * UM hook + * + * @type filter + * @title um_enqueue_localize_data + * @description Extend UM localized data + * @input_vars + * [{"var":"$data","type":"array","desc":"Localize Array"}] + * @change_log + * ["Since: 2.0"] + * @usage add_filter( 'um_enqueue_localize_data', 'function_name', 10, 1 ); + * @example + * + */ + $localize_data = apply_filters( 'um_enqueue_localize_data', array() ); + wp_localize_script( 'um_scripts', 'um_scripts', $localize_data ); + + wp_register_script('um_members', $this->js_baseurl . 'um-members' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true ); + wp_register_script('um_profile', $this->js_baseurl . 'um-profile' . $this->suffix . '.js', array( 'jquery', 'wp-util' ), ultimatemember_version, true ); + wp_register_script('um_account', $this->js_baseurl . 'um-account' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true ); + + wp_register_script( 'um_gchart', 'https://www.google.com/jsapi', array(), ultimatemember_version, true ); + } + + + /** + * + */ + function register_styles() { //FontAwesome and FontIcons styles wp_register_style( 'um_fonticons_ii', $this->css_baseurl . 'um-fonticons-ii.css', array(), ultimatemember_version ); wp_register_style( 'um_fonticons_fa', $this->css_baseurl . 'um-fonticons-fa.css', array(), ultimatemember_version ); @@ -118,67 +158,42 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { wp_register_style( 'um_datetime_date', $this->css_baseurl . 'pickadate/default.date.css', array( 'um-datetime' ), ultimatemember_version ); wp_register_style( 'um_datetime_time', $this->css_baseurl . 'pickadate/default.time.css', array( 'um-datetime' ), ultimatemember_version ); wp_register_style( 'um_scrollbar', $this->css_baseurl . 'um-scrollbar.css', array(), ultimatemember_version ); - //ui slider for filters - //wp_enqueue_script( 'jquery-ui-slider' ); + + wp_register_style( 'um_rtl', $this->css_baseurl . 'um.rtl.css', array(), ultimatemember_version ); + wp_register_style( 'um_default_css', $this->css_baseurl . 'um-old-default.css', array(), ultimatemember_version ); + wp_register_style( 'um_modal', $this->css_baseurl . 'um-modal.css', array( 'um_crop' ), ultimatemember_version ); + wp_register_style( 'um_responsive', $this->css_baseurl . 'um-responsive.css', array( 'um_profile', 'um_crop' ), ultimatemember_version ); + + wp_register_style( 'um_styles', $this->css_baseurl . 'um-styles.css', array(), ultimatemember_version ); + wp_register_style( 'um_members', $this->css_baseurl . 'um-members.css', array(), ultimatemember_version ); + wp_register_style( 'um_profile', $this->css_baseurl . 'um-profile.css', array(), ultimatemember_version ); + wp_register_style( 'um_account', $this->css_baseurl . 'um-account.css', array(), ultimatemember_version ); + wp_register_style( 'um_misc', $this->css_baseurl . 'um-misc.css', array(), ultimatemember_version ); + } - global $post; + /** + * Enqueue scripts and styles + */ + function wp_enqueue_scripts() { - if ( ! is_admin() ) { - $c_url = UM()->permalinks()->get_current_url( get_option( 'permalink_structure' ) ); - - $exclude = UM()->options()->get( 'js_css_exclude' ); - if ( is_array( $exclude ) ) { - array_filter( $exclude ); - } - - if ( $exclude && is_array( $exclude ) ) { - foreach ( $exclude as $match ) { - $sub_match = untrailingslashit( $match ); - if ( ! empty( $c_url ) && ! empty( $sub_match ) && strstr( $c_url, $sub_match ) ) { - return; - } - } - } - - $include = UM()->options()->get( 'js_css_include' ); - if ( is_array( $include ) ) { - array_filter( $include ); - } - - if ( $include && is_array( $include ) ) { - foreach ( $include as $match ) { - $sub_match = untrailingslashit( $match ); - if ( ! empty( $c_url ) && ! empty( $sub_match ) && strstr( $c_url, $sub_match ) ) { - $force_load = true; - } else { - if ( ! isset( $force_load ) ) { - $force_load = false; - } - } - } - } - } - - if ( isset( $force_load ) && $force_load == false ) { - return; - } + $this->register_scripts(); + $this->register_styles(); $this->load_original(); // rtl style if ( is_rtl() ) { - wp_register_style('um_rtl', um_url . 'assets/css/um.rtl.css', array(), ultimatemember_version ); - wp_enqueue_style('um_rtl'); + wp_enqueue_style( 'um_rtl' ); } - if(is_object($post) && has_shortcode($post->post_content,'ultimate-member')) { - wp_dequeue_script('jquery-form'); + global $post; + if ( is_object( $post ) && has_shortcode( $post->post_content,'ultimatemember' ) ) { + wp_dequeue_script( 'jquery-form' ); } //old settings before UM 2.0 CSS - wp_register_style('um_default_css', um_url . 'assets/css/um-old-default.css', array(), ultimatemember_version ); - wp_enqueue_style('um_default_css'); + wp_enqueue_style( 'um_default_css' ); $this->old_css_settings(); } @@ -191,11 +206,8 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { $uploads = wp_upload_dir(); $upload_dir = $uploads['basedir'] . DIRECTORY_SEPARATOR . 'ultimatemember' . DIRECTORY_SEPARATOR; if ( file_exists( $upload_dir . 'um_old_settings.css' ) ) { - //was the issues with HTTPS - //wp_register_style('um_old_css', $uploads['baseurl'] . '/ultimatemember/um_old_settings.css' ); - //fixed using "../../" - wp_register_style('um_old_css', um_url . '../../uploads/ultimatemember/um_old_settings.css' ); - wp_enqueue_style('um_old_css'); + wp_register_style( 'um_old_css', um_url . '../../uploads/ultimatemember/um_old_settings.css' ); + wp_enqueue_style( 'um_old_css' ); } } @@ -243,10 +255,7 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { * Include Google charts */ function load_google_charts() { - - wp_register_script('um_gchart', 'https://www.google.com/jsapi' ); - wp_enqueue_script('um_gchart'); - + wp_enqueue_script( 'um_gchart' ); } @@ -254,22 +263,11 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { * Load plugin css */ function load_css() { - - wp_register_style('um_styles', um_url . 'assets/css/um-styles.css' ); - wp_enqueue_style('um_styles'); - - wp_register_style('um_members', um_url . 'assets/css/um-members.css' ); - wp_enqueue_style('um_members'); - - wp_register_style('um_profile', um_url . 'assets/css/um-profile.css' ); - wp_enqueue_style('um_profile'); - - wp_register_style('um_account', um_url . 'assets/css/um-account.css' ); - wp_enqueue_style('um_account'); - - wp_register_style('um_misc', um_url . 'assets/css/um-misc.css' ); - wp_enqueue_style('um_misc'); - + wp_enqueue_style( 'um_styles' ); + wp_enqueue_style( 'um_members' ); + wp_enqueue_style( 'um_profile' ); + wp_enqueue_style( 'um_account' ); + wp_enqueue_style( 'um_misc' ); } @@ -277,19 +275,17 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { * Load select-dropdowns JS */ function load_selectjs() { - - wp_enqueue_script('select2'); - wp_enqueue_style('select2'); - + wp_enqueue_script( 'select2' ); + wp_enqueue_style( 'select2' ); } /** * Load Fonticons */ - function load_fonticons(){ - wp_enqueue_style('um_fonticons_ii'); - wp_enqueue_style('um_fonticons_fa'); + function load_fonticons() { + wp_enqueue_style( 'um_fonticons_ii' ); + wp_enqueue_style( 'um_fonticons_fa' ); } @@ -297,9 +293,8 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { * Load fileupload JS */ function load_fileupload() { - wp_enqueue_script('um_jquery_form'); - wp_enqueue_script('um_fileupload'); - wp_enqueue_style('um_fileupload'); + wp_enqueue_script( 'um_fileupload' ); + wp_enqueue_style( 'um_fileupload' ); } @@ -307,12 +302,8 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { * Load JS functions */ function load_functions() { - - wp_register_script('um_functions', um_url . 'assets/js/um-functions' . $this->suffix . '.js', array('jquery', 'jquery-masonry', 'wp-util', 'um_scrollbar') ); - wp_enqueue_script('um_functions'); - - wp_enqueue_script( 'um-gdpr', um_url . 'assets/js/um-gdpr' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, false ); - + wp_enqueue_script('um_functions' ); + wp_enqueue_script( 'um-gdpr' ); } @@ -320,47 +311,11 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { * Load custom JS */ function load_customjs() { - - wp_register_script('um_conditional', um_url . 'assets/js/um-conditional' . $this->suffix . '.js' ); wp_enqueue_script('um_conditional'); - - wp_register_script('um_scripts', um_url . 'assets/js/um-scripts' . $this->suffix . '.js', array('jquery','wp-util') ); - - /** - * UM hook - * - * @type filter - * @title um_enqueue_localize_data - * @description Extend UM localized data - * @input_vars - * [{"var":"$data","type":"array","desc":"Localize Array"}] - * @change_log - * ["Since: 2.0"] - * @usage add_filter( 'um_enqueue_localize_data', 'function_name', 10, 1 ); - * @example - * - */ - $localize_data = apply_filters( 'um_enqueue_localize_data', array() ); - - wp_localize_script( 'um_scripts', 'um_scripts', $localize_data ); - wp_enqueue_script('um_scripts'); - - wp_register_script('um_members', um_url . 'assets/js/um-members' . $this->suffix . '.js' ); wp_enqueue_script('um_members'); - - wp_register_script('um_profile', um_url . 'assets/js/um-profile' . $this->suffix . '.js', array('jquery','wp-util') ); wp_enqueue_script('um_profile'); - - wp_register_script('um_account', um_url . 'assets/js/um-account' . $this->suffix . '.js' ); wp_enqueue_script('um_account'); - } @@ -398,46 +353,36 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { /** * Load crop script */ - function load_imagecrop(){ - wp_enqueue_script('um_crop'); - wp_enqueue_style('um_crop'); + function load_imagecrop() { + wp_enqueue_script( 'um_crop' ); + wp_enqueue_style( 'um_crop' ); } /** * Load tipsy */ - function load_tipsy(){ - wp_enqueue_script('um_tipsy'); - wp_enqueue_style('um_tipsy'); + function load_tipsy() { + wp_enqueue_script( 'um_tipsy' ); + wp_enqueue_style( 'um_tipsy' ); } /** * Load modal */ - function load_modal(){ - - wp_register_style('um_modal', um_url . 'assets/css/um-modal.css' ); - wp_enqueue_style('um_modal'); - - wp_register_script('um_modal', um_url . 'assets/js/um-modal' . $this->suffix . '.js', array('jquery','wp-util') ); - wp_enqueue_script('um_modal'); - + function load_modal() { + wp_enqueue_script( 'um_modal' ); + wp_enqueue_style( 'um_modal' ); } /** * Load responsive styles */ - function load_responsive(){ - - wp_register_script('um_responsive', um_url . 'assets/js/um-responsive' . $this->suffix . '.js' ); - wp_enqueue_script('um_responsive'); - - wp_register_style('um_responsive', um_url . 'assets/css/um-responsive.css', array( 'um_profile' ) ); - wp_enqueue_style('um_responsive'); - + function load_responsive() { + wp_enqueue_script( 'um_responsive' ); + wp_enqueue_style( 'um_responsive' ); } } From e253b42edb20267dadd2a5f63a9085df9268d1b2 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Mon, 5 Nov 2018 10:02:55 +0200 Subject: [PATCH 02/10] - additional variable; --- includes/admin/core/class-admin-settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index a768d742..af0435f9 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -1170,7 +1170,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { */ do_action( "um_settings_page_before_" . $current_tab . "_" . $current_subtab . "_content" ); - if ( in_array( $current_tab, apply_filters('um_settings_custom_tabs', array( 'licenses', 'install_info' ) ) ) || in_array( $current_subtab, apply_filters('um_settings_custom_subtabs', array() ) ) ) { + if ( in_array( $current_tab, apply_filters('um_settings_custom_tabs', array( 'licenses', 'install_info' ) ) ) || in_array( $current_subtab, apply_filters( 'um_settings_custom_subtabs', array(), $current_tab ) ) ) { /** * UM hook From 151e6464f10028cdac293e7611f7e8a45dac578b Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Tue, 6 Nov 2018 09:12:37 +0200 Subject: [PATCH 03/10] - admin forms media uploader trigger; --- includes/admin/assets/js/um-admin-forms.js | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/includes/admin/assets/js/um-admin-forms.js b/includes/admin/assets/js/um-admin-forms.js index 21d236f5..edd3966f 100644 --- a/includes/admin/assets/js/um-admin-forms.js +++ b/includes/admin/assets/js/um-admin-forms.js @@ -127,6 +127,8 @@ jQuery(document).ready( function() { button.siblings('.um-clear-image').show(); button.hide(); + + jQuery( document ).trigger( 'um_media_upload_select', button ); }); frame.open(); @@ -137,16 +139,19 @@ jQuery(document).ready( function() { }); jQuery('.um-clear-image').click( function(e) { - var default_image_url = jQuery(this).siblings('.um-forms-field').data('default'); - jQuery(this).siblings('.um-set-image').show(); - jQuery(this).hide(); - jQuery(this).siblings('.icon_preview').attr( 'src', default_image_url ); - jQuery(this).siblings('.um-media-upload-data-id').val(''); - jQuery(this).siblings('.um-media-upload-data-width').val(''); - jQuery(this).siblings('.um-media-upload-data-height').val(''); - jQuery(this).siblings('.um-media-upload-data-thumbnail').val(''); - jQuery(this).siblings('.um-forms-field').val( default_image_url ); - jQuery(this).siblings('.um-media-upload-url').val( default_image_url ); + var clear_button = jQuery(this); + var default_image_url = clear_button.siblings('.um-forms-field').data('default'); + clear_button.siblings('.um-set-image').show(); + clear_button.hide(); + clear_button.siblings('.icon_preview').attr( 'src', default_image_url ); + clear_button.siblings('.um-media-upload-data-id').val(''); + clear_button.siblings('.um-media-upload-data-width').val(''); + clear_button.siblings('.um-media-upload-data-height').val(''); + clear_button.siblings('.um-media-upload-data-thumbnail').val(''); + clear_button.siblings('.um-forms-field').val( default_image_url ); + clear_button.siblings('.um-media-upload-url').val( default_image_url ); + + jQuery( document ).trigger( 'um_media_upload_clear', clear_button ); }); } From a9a50e619c75d5c4bb69dddb67f49b1deef58970 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Wed, 7 Nov 2018 00:17:04 +0200 Subject: [PATCH 04/10] - fixed date time internalization; --- includes/core/class-date-time.php | 40 ++++++++++++++-------------- includes/core/um-filters-fields.php | 3 ++- includes/um-deprecated-functions.php | 18 +++++++++++++ includes/um-short-functions.php | 25 +++-------------- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/includes/core/class-date-time.php b/includes/core/class-date-time.php index cfa71dd8..cb685c34 100644 --- a/includes/core/class-date-time.php +++ b/includes/core/class-date-time.php @@ -36,10 +36,10 @@ if ( ! class_exists( 'um\core\Date_Time' ) ) { /** * Show a cool time difference between 2 timestamps * - * @param $from - * @param string $to + * @param int $from + * @param int $to * - * @return mixed|void + * @return string */ function time_diff( $from, $to = '' ) { $since = ''; @@ -51,52 +51,52 @@ if ( ! class_exists( 'um\core\Date_Time' ) ) { $diff = (int) abs( $to - $from ); if ( $diff < 60 ) { - $since = __('just now','ultimate-member'); + $since = __( 'just now', 'ultimate-member' ); } elseif ( $diff < HOUR_IN_SECONDS ) { $mins = round( $diff / MINUTE_IN_SECONDS ); - if ( $mins <= 1 ) + if ( $mins <= 1 ) { $mins = 1; - if ( $mins == 1 ) { - $since = sprintf( __('%s min','ultimate-member'), $mins ); - } else { - $since = sprintf( __('%s mins','ultimate-member'), $mins ); } + $since = _n( '%s min', '%s mins', $mins, 'ultimate-member' ); + } elseif ( $diff < DAY_IN_SECONDS && $diff >= HOUR_IN_SECONDS ) { $hours = round( $diff / HOUR_IN_SECONDS ); - if ( $hours <= 1 ) + if ( $hours <= 1 ) { $hours = 1; - if ( $hours == 1 ) { - $since = sprintf( __('%s hr','ultimate-member'), $hours ); - } else { - $since = sprintf( __('%s hrs','ultimate-member'), $hours ); } + $since = _n( '%s hr', '%s hrs', $hours, 'ultimate-member' ); + } elseif ( $diff < WEEK_IN_SECONDS && $diff >= DAY_IN_SECONDS ) { $days = round( $diff / DAY_IN_SECONDS ); - if ( $days <= 1 ) + if ( $days <= 1 ) { $days = 1; + } + + + if ( $days == 1 ) { - $since = sprintf( __('Yesterday at %s','ultimate-member'), date('g:ia', $from ) ); + $since = sprintf( __( 'Yesterday at %s', 'ultimate-member' ), date_i18n( 'g:ia', $from ) ); } else { - $since = sprintf(__('%s at %s','ultimate-member'), date('F d', $from ), date('g:ia', $from ) ); + $since = sprintf( __( '%s at %s', 'ultimate-member' ), date_i18n( 'F d', $from ), date_i18n( 'g:ia', $from ) ); } } elseif ( $diff < 30 * DAY_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) { - $since = sprintf(__('%s at %s','ultimate-member'), date('F d', $from ), date('g:ia', $from ) ); + $since = sprintf( __( '%s at %s', 'ultimate-member' ), date_i18n( 'F d', $from ), date_i18n( 'g:ia', $from ) ); } elseif ( $diff < YEAR_IN_SECONDS && $diff >= 30 * DAY_IN_SECONDS ) { - $since = sprintf(__('%s at %s','ultimate-member'), date('F d', $from ), date('g:ia', $from ) ); + $since = sprintf( __( '%s at %s','ultimate-member'), date_i18n( 'F d', $from ), date_i18n( 'g:ia', $from ) ); } elseif ( $diff >= YEAR_IN_SECONDS ) { - $since = sprintf(__('%s at %s','ultimate-member'), date( 'F d, Y', $from ), date('g:ia', $from ) ); + $since = sprintf( __( '%s at %s', 'ultimate-member' ), date_i18n( 'F d, Y', $from ), date_i18n( 'g:ia', $from ) ); } diff --git a/includes/core/um-filters-fields.php b/includes/core/um-filters-fields.php index d0018551..f45272bf 100644 --- a/includes/core/um-filters-fields.php +++ b/includes/core/um-filters-fields.php @@ -130,7 +130,8 @@ add_filter( 'um_profile_field_filter_hook__user_registered', 'um_profile_field_f * @return string */ function um_profile_field_filter_hook__last_login( $value, $data ) { - $value = sprintf( __('Last login: %s','ultimate-member'), um_user_last_login( um_user('ID') ) ); + //$value = sprintf( __('Last login: %s','ultimate-member'), um_user_last_login( um_user('ID') ) ); + $value = um_user_last_login( um_user( 'ID' ) ); return $value; } add_filter( 'um_profile_field_filter_hook__last_login', 'um_profile_field_filter_hook__last_login', 99, 2 ); diff --git a/includes/um-deprecated-functions.php b/includes/um-deprecated-functions.php index 4d19c1c8..1f3e100a 100644 --- a/includes/um-deprecated-functions.php +++ b/includes/um-deprecated-functions.php @@ -399,4 +399,22 @@ function um_requesting_password_change() { } return false; +} + + + +/** + * Get core page url + * + * @deprecated 2.0.30 + * + * @param $time1 + * @param $time2 + * + * @return string + */ +function um_time_diff( $time1, $time2 ) { + //um_deprecated_function( 'um_time_diff', '2.0.30', 'UM()->datetime()->time_diff' ); + + return UM()->datetime()->time_diff( $time1, $time2 ); } \ No newline at end of file diff --git a/includes/um-short-functions.php b/includes/um-short-functions.php index 7dfb0d46..6006db8a 100644 --- a/includes/um-short-functions.php +++ b/includes/um-short-functions.php @@ -835,19 +835,6 @@ function um_is_temp_file( $filename ) { } -/** - * Get core page url - * - * @param $time1 - * @param $time2 - * - * @return mixed|void - */ -function um_time_diff( $time1, $time2 ) { - return UM()->datetime()->time_diff( $time1, $time2 ); -} - - /** * Get user's last login timestamp * @@ -867,19 +854,13 @@ function um_user_last_login_timestamp( $user_id ) { /** * Get user's last login (time diff) * - * @param $user_id + * @param int $user_id * - * @return mixed|string|void + * @return string */ function um_user_last_login( $user_id ) { $value = get_user_meta( $user_id, '_um_last_login', true ); - if ( $value ) { - $value = um_time_diff( $value, current_time( 'timestamp' ) ); - } else { - $value = ''; - } - - return $value; + return ! empty( $value ) ? UM()->datetime()->time_diff( $value, current_time( 'timestamp' ) ) : ''; } From 2598bdeb5717f40a9d661166f4421e0120bfdfc3 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Wed, 7 Nov 2018 15:34:19 +0200 Subject: [PATCH 05/10] - fixed date localize; --- includes/admin/assets/js/um-admin-forms.js | 2 +- includes/core/class-date-time.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/includes/admin/assets/js/um-admin-forms.js b/includes/admin/assets/js/um-admin-forms.js index edd3966f..fbd3eecf 100644 --- a/includes/admin/assets/js/um-admin-forms.js +++ b/includes/admin/assets/js/um-admin-forms.js @@ -128,7 +128,7 @@ jQuery(document).ready( function() { button.siblings('.um-clear-image').show(); button.hide(); - jQuery( document ).trigger( 'um_media_upload_select', button ); + jQuery( document ).trigger( 'um_media_upload_select', [button, attachment] ); }); frame.open(); diff --git a/includes/core/class-date-time.php b/includes/core/class-date-time.php index cb685c34..0a462d6d 100644 --- a/includes/core/class-date-time.php +++ b/includes/core/class-date-time.php @@ -60,7 +60,7 @@ if ( ! class_exists( 'um\core\Date_Time' ) ) { $mins = 1; } - $since = _n( '%s min', '%s mins', $mins, 'ultimate-member' ); + $since = sprintf( _n( '%s min', '%s mins', $mins, 'ultimate-member' ), $mins ); } elseif ( $diff < DAY_IN_SECONDS && $diff >= HOUR_IN_SECONDS ) { @@ -69,7 +69,7 @@ if ( ! class_exists( 'um\core\Date_Time' ) ) { $hours = 1; } - $since = _n( '%s hr', '%s hrs', $hours, 'ultimate-member' ); + $since = sprintf( _n( '%s hr', '%s hrs', $hours, 'ultimate-member' ), $hours ); } elseif ( $diff < WEEK_IN_SECONDS && $diff >= DAY_IN_SECONDS ) { @@ -78,8 +78,6 @@ if ( ! class_exists( 'um\core\Date_Time' ) ) { $days = 1; } - - if ( $days == 1 ) { $since = sprintf( __( 'Yesterday at %s', 'ultimate-member' ), date_i18n( 'g:ia', $from ) ); } else { From 8cf1567b9153dbc8993684d8789213d53c7bee18 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Wed, 7 Nov 2018 16:03:02 +0200 Subject: [PATCH 06/10] - fixed posts pagination for un-logged users; --- includes/core/class-ajax-common.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/core/class-ajax-common.php b/includes/core/class-ajax-common.php index 36e55ea1..b1faa596 100644 --- a/includes/core/class-ajax-common.php +++ b/includes/core/class-ajax-common.php @@ -39,6 +39,7 @@ if ( ! class_exists( 'um\core\AJAX_Common' ) ) { add_action( 'wp_ajax_um_ajax_paginate', array( UM()->query(), 'ajax_paginate' ) ); add_action( 'wp_ajax_um_ajax_paginate_posts', array( UM()->user_posts(), 'load_posts' ) ); + add_action( 'wp_ajax_nopriv_um_ajax_paginate_posts', array( UM()->user_posts(), 'load_posts' ) ); add_action( 'wp_ajax_um_muted_action', array( UM()->form(), 'ajax_muted_action' ) ); From 0ca9213dbee7f59dac94bd2918c82948f859643e Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Fri, 9 Nov 2018 16:21:34 +0200 Subject: [PATCH 07/10] - fixed conditional js; - fixed um_ prefix for role data; --- assets/js/um-conditional.js | 1135 ++++++++++---------- assets/js/um-conditional.min.js | 2 +- assets/js/um-scripts.js | 4 +- assets/js/um-scripts.min.js | 2 +- includes/core/class-enqueue.php | 6 +- includes/core/class-roles-capabilities.php | 7 +- languages/ultimate-member-en_US.po | 63 +- 7 files changed, 605 insertions(+), 614 deletions(-) diff --git a/assets/js/um-conditional.js b/assets/js/um-conditional.js index 11a58835..2e66c913 100644 --- a/assets/js/um-conditional.js +++ b/assets/js/um-conditional.js @@ -1,507 +1,572 @@ +var arr_all_conditions = []; //raw +var um_field_conditions = {}; // filtered +var um_field_default_values = {}; + +/** + * Get field default value + * @param object $dom + * @return string + */ +function um_get_field_default_value( $dom ) { + var default_value = ''; + var type = um_get_field_type($dom); + switch ( type ) { + + case 'text': + case 'number': + case 'date': + case 'textarea': + case 'select': + default_value = $dom.find('input:text,input[type=number],textarea,select').val(); + break; + + case 'multiselect': + default_value = $dom.find('select').val(); + break; + + case 'radio': + if ($dom.find('input[type=radio]:checked').length >= 1) { + default_value = $dom.find('input[type=radio]:checked').val(); + } + + break; + case 'checkbox': + + if ($dom.find('input[type=checkbox]:checked').length >= 1) { + + if ($dom.find('input[type=checkbox]:checked').length > 1) { + $dom.find('input[type=checkbox]:checked').each(function () { + default_value = default_value + jQuery(this).val() + ' '; + }); + } else { + default_value = $dom.find('input[type=checkbox]:checked').val(); + } + + } + break; + } + + return {type: type, value: default_value}; +} + +/** + * Get field element by field wrapper + * @param object $dom + * @return object + */ +function um_get_field_element( $dom ) { + var default_value = ''; + var type = um_get_field_type($dom); + + switch ( type ) { + + case 'text': + case 'number': + case 'date': + case 'textarea': + case 'select': + case 'multiselect': + case 'radio': + case 'checkbox': + return $dom.find('input,textarea,select'); + break; + + + } + + return ''; +} + +/** + * Get field type + * @param object $dom + * @return string + */ +function um_get_field_type($dom) { + var type = ''; + var classes = $dom.attr( 'class' ); + jQuery.each( classes.split(' '), function (i, d) { + if (d.indexOf('um-field-type') != -1) { + type = d.split('_')[1]; + } + }); + + return type; + +} + +/** + * Get field siblings/chidren conditions + * @param string field_key + * @return array + */ +function um_get_field_children(field_key) { + var arr_conditions = []; + jQuery.each(arr_all_conditions, function (ii, condition) { + if (condition.field.parent == field_key) { + arr_conditions.push(condition.field.condition); + } + }); + + return arr_conditions; + +} + +/** + * Split single array to multi-dimensional array + * @param array arr + * @param integer n + * @return array + */ +function um_splitup_array(arr, n) { + var rest = arr.length % n, + restUsed = rest, + partLength = Math.floor(arr.length / n), + result = []; + + for (var i = 0; i < arr.length; i += partLength) { + var end = partLength + i, + add = false; + + if (rest !== 0 && restUsed) { + end++; + restUsed--; + add = true; + } + + result.push(arr.slice(i, end)); + + if (add) { + i++; + } + } + + var obj_result = []; + jQuery.each(result, function (ii, dd) { + obj_result.push({ + action: dd[0], + if_field: dd[1], + operator: dd[2], + value: dd[3] + }) + }); + + return obj_result; +} + +/** + * Get field live value + * @param object $dom + * @return mixed + */ +function um_get_field_data($dom) { + um_live_field = $dom.parents('.um-field').data('key'); + um_live_value = $dom.val(); + + if ($dom.is(':checkbox')) { + + um_live_value = ''; + + if ($dom.parents('.um-field').find('input:checked').length > 1) { + $dom.parents('.um-field').find('input:checked').each(function () { + um_live_value = um_live_value + jQuery(this).val() + ' '; + }); + } else { + if ($dom.parents('.um-field').find('input:checked').length >= 1) { + um_live_value = $dom.parents('.um-field').find('input:checked').val(); + } + } + + } + + if ($dom.is(':radio')) { + um_live_value = $dom.parents('.um-field').find('input[type=radio]:checked').val(); + } + + return um_live_value; + +} + +function um_in_array(needle, haystack, strict){ + var found = false, key, strict = !!strict; + for (key in haystack) { + if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) { + found = true; + break; + } + } + + return found; +} + +/** + * Apply field conditions + * @param object $dom + * @param boolean is_single_update + */ +function um_apply_conditions($dom, is_single_update) { + var operators = ['empty', 'not empty', 'equals to', 'not equals', 'greater than', 'less than', 'contains']; + var key = $dom.parents('.um-field[data-key]').data('key'); + var conditions = um_field_conditions[key]; + + var live_field_value = um_get_field_data($dom); + + var $owners = {}; + var $owners_values = {}; + var $owner_conditions = {}; + + jQuery.each(conditions, function (index, condition) { + if (typeof $owners_values[condition.owner] == 'undefined') { + $owners_values[condition.owner] = []; + $owner_conditions[condition.owner] = {} + } + $owners_values[condition.owner].push(condition.value); + $owner_conditions[condition.owner] = condition; + }); + + jQuery.each(conditions, function (index, condition) { + if (typeof $owners[condition.owner] == 'undefined') { + $owners[condition.owner] = {}; + } + if (condition.operator == 'empty') { + if (!live_field_value || live_field_value == '' && um_in_array(live_field_value, $owners_values[condition.owner])) { + $owners[condition.owner][index] = true; + } else { + $owners[condition.owner][index] = false; + } + } + + if (condition.operator == 'not empty') { + if (live_field_value && live_field_value != '' && !um_in_array(live_field_value, $owners_values[condition.owner])) { + $owners[condition.owner][index] = true; + } else { + $owners[condition.owner][index] = false; + } + } + + if (condition.operator == 'equals to') { + if (condition.value == live_field_value && um_in_array(live_field_value, $owners_values[condition.owner])) { + $owners[condition.owner][index] = true; + } else { + $owners[condition.owner][index] = false; + } + } + + if (condition.operator == 'not equals') { + if (jQuery.isNumeric(condition.value) && parseInt(live_field_value) != parseInt(condition.value) && live_field_value && !um_in_array(live_field_value, $owners_values[condition.owner])) { + $owners[condition.owner][index] = true; + } else if (condition.value != live_field_value && !um_in_array(live_field_value, $owners_values[condition.owner])) { + $owners[condition.owner][index] = true; + } else { + $owners[condition.owner][index] = false; + } + } + + if (condition.operator == 'greater than') { + if (jQuery.isNumeric(condition.value) && parseInt(live_field_value) > parseInt(condition.value)) { + $owners[condition.owner][index] = true; + } else { + $owners[condition.owner][index] = false; + } + } + + if (condition.operator == 'less than') { + if (jQuery.isNumeric(condition.value) && parseInt(live_field_value) < parseInt(condition.value)) { + $owners[condition.owner][index] = true; + } else { + $owners[condition.owner][index] = false; + } + } + + if ( condition.operator == 'contains' ) { + if ( 'multiselect' == um_get_field_type( $dom.parents('.um-field[data-key]') ) ) { + if ( live_field_value && live_field_value.indexOf( condition.value ) >= 0 && um_in_array( condition.value, live_field_value ) ) { + $owners[condition.owner][index] = true; + } else { + $owners[condition.owner][index] = false; + } + } else if ( 'checkbox' == um_get_field_type( $dom.parents('.um-field[data-key]') ) ) { + if ( live_field_value && live_field_value.indexOf( condition.value ) >= 0 ) { + $owners[condition.owner][index] = true; + } else { + $owners[condition.owner][index] = false; + } + } else { + if ( live_field_value && live_field_value.indexOf( condition.value ) >= 0 && um_in_array( live_field_value, $owners_values[ condition.owner ] ) ) { + $owners[condition.owner][index] = true; + } else { + $owners[condition.owner][index] = false; + } + } + } + + }); // end foreach `conditions` + jQuery.each($owners, function (index, field) { + if (um_in_array(true, field)) { + um_field_apply_action($dom, $owner_conditions[index], true); + } else { + um_field_apply_action($dom, $owner_conditions[index], false); + } + }); + $dom.trigger('um_fields_change'); + +} + +/** + * Apply condition's action + * @param object $dom + * @param string condition + * @param boolean is_true + */ +function um_field_apply_action($dom, condition, is_true) { + var child_dom = jQuery('div.um-field[data-key="' + condition.owner + '"]'); + + if (condition.action == 'show' && is_true /*&& child_dom.is(':hidden')*/) { + child_dom.show(); + _show_in_ie( child_dom ); + um_field_restore_default_value(child_dom); + } + + if (condition.action == 'show' && !is_true /*&& child_dom.is(':visible') */) { + child_dom.hide(); + _hide_in_ie( child_dom ); + } + + if (condition.action == 'hide' && is_true /*&& child_dom.is(':visible')*/) { + child_dom.hide(); + _hide_in_ie( child_dom ); + } + + if (condition.action == 'hide' && !is_true /*&& child_dom.is(':hidden')*/) { + child_dom.show(); + _show_in_ie( child_dom ); + um_field_restore_default_value( child_dom ); + + } + $dom.removeClass('um-field-has-changed'); +} + +/** + * Restores default field value + * @param object $dom + */ +function um_field_restore_default_value( $dom ) { + //um_field_default_values + + var type = um_get_field_type( $dom ); + var key = $dom.data('key'); + var field = um_field_default_values[key]; + switch ( type ) { + + case 'text': + case 'number': + case 'date': + case 'textarea': + $dom.find('input:text,input[type=number],textareas').val(field.value); + break; + + case 'select': + $dom.find('select').find('option').prop('selected', false); + $dom.find('select').val(field.value); + $dom.find('select').trigger('change'); + break; + + case 'multiselect': + $dom.find('select').find('option').prop('selected', false); + jQuery.each(field.value, function (i, value) { + $dom.find('select').find('option[value="' + value + '"]').attr('selected', true); + }); + $dom.find('select').trigger('change'); + break; + + case 'checkbox': + + if ( $dom.find('input[type=checkbox]:checked').length >= 1 ) { + + $dom.find('input[type=checkbox]:checked').removeAttr('checked'); + $dom.find('span.um-field-checkbox-state i').removeClass('um-icon-android-checkbox-outline'); + $dom.find('span.um-field-checkbox-state i').addClass('um-icon-android-checkbox-outline-blank'); + $dom.find('.um-field-checkbox.active').removeClass('active'); + + if (jQuery.isArray(field.value)) { + jQuery.each(field.value, function (i, value) { + var cbox_elem = $dom.find('input[type=checkbox][value="' + value + '"]'); + cbox_elem.attr('checked', true); + cbox_elem.closest('.um-field-checkbox').find('i').removeClass('um-icon-android-checkbox-outline-blank'); + cbox_elem.closest('.um-field-checkbox').find('i').addClass('um-icon-android-checkbox-outline'); + cbox_elem.closest('.um-field-checkbox').addClass('active'); + }); + } else { + var cbox_elem = $dom.find('input[type=checkbox][value="' + field.value + '"]'); + cbox_elem.attr('checked', true); + cbox_elem.closest('.um-field-checkbox').find('i').removeClass('um-icon-android-checkbox-outline-blank'); + cbox_elem.closest('.um-field-checkbox').find('i').addClass('um-icon-android-checkbox-outline'); + cbox_elem.closest('.um-field-checkbox').addClass('active'); + } + + } + + break; + case 'radio': + + if ( $dom.find('input[type=radio]:checked').length >= 1 ) { + + setTimeout(function () { + + $dom.find('input[type=radio]:checked').removeAttr('checked'); + + $dom.find('span.um-field-radio-state i').removeClass('um-icon-android-radio-button-on'); + $dom.find('span.um-field-radio-state i').addClass('um-icon-android-radio-button-off'); + $dom.find('.um-field-radio.active').removeClass('active'); + + var radio_elem = $dom.find("input[type=radio][value='" + field.value + "']"); + radio_elem.attr('checked', true); + radio_elem.closest('.um-field-radio').find('i').removeClass('um-icon-android-radio-button-off'); + radio_elem.closest('.um-field-radio').find('i').addClass('um-icon-android-radio-button-on'); + radio_elem.closest('.um-field-radio').addClass('active'); + + }, 100); + } + + break; + + + } // end switch type + + + if ( ! $dom.hasClass( 'um-field-has-changed' ) ) { + var me = um_get_field_element( $dom ); + + if ( type == 'radio' || type == 'checkbox' ) { + me = me.find( ':checked' ); + } + + if ( me ) { + me.trigger( 'change' ); + $dom.addClass( 'um-field-has-changed' ); + } + + /* + maybe future fix + if ( me ) { + if ( type == 'radio' || type == 'checkbox' ) { + me.each( function() { + if ( jQuery(this).is(':checked') ) { + jQuery(this).trigger('change'); + } + }); + } else { + me.trigger( 'change' ); + } + + $dom.addClass( 'um-field-has-changed' ); + }*/ + } +} + +/** + * Hides sibling/child field when parent field is hidden + */ +function um_field_hide_siblings() { + + jQuery.each(um_field_conditions, function (index, conditions) { + if (jQuery('.um-field[data-key="' + index + '"]:hidden').length >= 1 || jQuery('.um-field[data-key="' + index + '"]').css('display') == 'none') { + jQuery.each(conditions, function (key, condition) { + jQuery('.um-field[data-key="' + condition.owner + '"]').hide(); + }); + } + + }); + +} + +/** + * Hides div for IE browser + * @param object $dom + */ +function _hide_in_ie( $dom ){ + if ( typeof( jQuery.browser ) != 'undefined' && jQuery.browser.msie ) { + $dom.css({"visibility":"hidden"}); + } +} + +/** + * Shows div for IE browser + * @param object $dom + */ +function _show_in_ie( $dom ){ + if ( typeof( jQuery.browser ) != 'undefined' && jQuery.browser.msie ) { + $dom.css({"visibility":"visible"}); + } +} + +/** + * UM Conditional fields Init + */ +function um_init_field_conditions() { + var arr_field_keys = []; + + jQuery( '.um-field[data-key]' ).each( function() { + + var key = jQuery(this).data( 'key' ); + + arr_field_keys.push( key ); + + var parse_attrs = {}; + jQuery.each( jQuery(this)[0].attributes, function ( index, attribute ) { + if ( attribute.name.indexOf( 'data-cond' ) != -1 ) { + // replace "data-cond-" + var cond_field_id_and_attr = attribute.name.slice( 10 ); + // return "n" + var cond_field_id = cond_field_id_and_attr.substring( 1, 0 ); + //replace "n-" + var cond_field_attr = cond_field_id_and_attr.slice( 2 ); + + if ( typeof parse_attrs[cond_field_id] == 'undefined' ) + parse_attrs[cond_field_id] = {}; + + parse_attrs[cond_field_id][cond_field_attr] = attribute.value; + } + }); + + jQuery.each( parse_attrs, function ( ii, dd ) { + var obj = {'field' :{ + owner: key, + action: dd.action, + parent: dd.field, + operator: dd.operator, + value: dd.value, + condition: { + owner: key, + action: dd.action, + operator: dd.operator, + value: dd.value + } + }}; + + arr_all_conditions.push(obj); + }); + + um_field_default_values[jQuery(this).data('key')] = um_get_field_default_value( jQuery(this) ); + }); + + jQuery.each( arr_field_keys, function ( i, field_key ) { + um_field_conditions[field_key] = um_get_field_children( field_key ); + }); + + jQuery( '.um-field[data-key]:visible' ).each( function() { + var $wrap_dom = jQuery(this); + var me = um_get_field_element( $wrap_dom ); + if ( typeof me.trigger !== 'undefined' ) { + me.trigger( 'change' ); + } + }); + +} + + jQuery(document).ready( function (){ - var arr_all_conditions = []; //raw - var um_field_conditions = {}; // filtered - var um_field_default_values = {}; - - /** - * Get field default value - * @param object $dom - * @return string - */ - function um_get_field_default_value( $dom ) { - var default_value = ''; - var type = um_get_field_type($dom); - switch ( type ) { - - case 'text': - case 'number': - case 'date': - case 'textarea': - case 'select': - default_value = $dom.find('input:text,input[type=number],textarea,select').val(); - break; - - case 'multiselect': - default_value = $dom.find('select').val(); - break; - - case 'radio': - if ($dom.find('input[type=radio]:checked').length >= 1) { - default_value = $dom.find('input[type=radio]:checked').val(); - } - - break; - case 'checkbox': - - if ($dom.find('input[type=checkbox]:checked').length >= 1) { - - if ($dom.find('input[type=checkbox]:checked').length > 1) { - $dom.find('input[type=checkbox]:checked').each(function () { - default_value = default_value + jQuery(this).val() + ' '; - }); - } else { - default_value = $dom.find('input[type=checkbox]:checked').val(); - } - - } - break; - } - - return {type: type, value: default_value}; - } - - /** - * Get field element by field wrapper - * @param object $dom - * @return object - */ - function um_get_field_element( $dom ) { - var default_value = ''; - var type = um_get_field_type($dom); - - switch ( type ) { - - case 'text': - case 'number': - case 'date': - case 'textarea': - case 'select': - case 'multiselect': - case 'radio': - case 'checkbox': - return $dom.find('input,textarea,select'); - break; - - - } - - return ''; - } - - /** - * Get field type - * @param object $dom - * @return string - */ - function um_get_field_type($dom) { - var type = ''; - var classes = $dom.attr( 'class' ); - jQuery.each( classes.split(' '), function (i, d) { - if (d.indexOf('um-field-type') != -1) { - type = d.split('_')[1]; - } - }); - - return type; - - } - - /** - * Get field siblings/chidren conditions - * @param string field_key - * @return array - */ - function um_get_field_children(field_key) { - var arr_conditions = []; - jQuery.each(arr_all_conditions, function (ii, condition) { - if (condition.field.parent == field_key) { - arr_conditions.push(condition.field.condition); - } - }); - - return arr_conditions; - - } - - /** - * Split single array to multi-dimensional array - * @param array arr - * @param integer n - * @return array - */ - function um_splitup_array(arr, n) { - var rest = arr.length % n, - restUsed = rest, - partLength = Math.floor(arr.length / n), - result = []; - - for (var i = 0; i < arr.length; i += partLength) { - var end = partLength + i, - add = false; - - if (rest !== 0 && restUsed) { - end++; - restUsed--; - add = true; - } - - result.push(arr.slice(i, end)); - - if (add) { - i++; - } - } - - var obj_result = []; - jQuery.each(result, function (ii, dd) { - obj_result.push({ - action: dd[0], - if_field: dd[1], - operator: dd[2], - value: dd[3] - }) - }); - - return obj_result; - } - - /** - * Get field live value - * @param object $dom - * @return mixed - */ - function um_get_field_data($dom) { - um_live_field = $dom.parents('.um-field').data('key'); - um_live_value = $dom.val(); - - if ($dom.is(':checkbox')) { - - um_live_value = ''; - - if ($dom.parents('.um-field').find('input:checked').length > 1) { - $dom.parents('.um-field').find('input:checked').each(function () { - um_live_value = um_live_value + jQuery(this).val() + ' '; - }); - } else { - if ($dom.parents('.um-field').find('input:checked').length >= 1) { - um_live_value = $dom.parents('.um-field').find('input:checked').val(); - } - } - - } - - if ($dom.is(':radio')) { - um_live_value = $dom.parents('.um-field').find('input[type=radio]:checked').val(); - } - - return um_live_value; - - } - - function um_in_array(needle, haystack, strict){ - var found = false, key, strict = !!strict; - for (key in haystack) { - if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) { - found = true; - break; - } - } - - return found; - } - - /** - * Apply field conditions - * @param object $dom - * @param boolean is_single_update - */ - function um_apply_conditions($dom, is_single_update) { - var operators = ['empty', 'not empty', 'equals to', 'not equals', 'greater than', 'less than', 'contains']; - var key = $dom.parents('.um-field[data-key]').data('key'); - var conditions = um_field_conditions[key]; - - var live_field_value = um_get_field_data($dom); - - var $owners = {}; - var $owners_values = {}; - var $owner_conditions = {}; - - jQuery.each(conditions, function (index, condition) { - if (typeof $owners_values[condition.owner] == 'undefined') { - $owners_values[condition.owner] = []; - $owner_conditions[condition.owner] = {} - } - $owners_values[condition.owner].push(condition.value); - $owner_conditions[condition.owner] = condition; - }); - - jQuery.each(conditions, function (index, condition) { - if (typeof $owners[condition.owner] == 'undefined') { - $owners[condition.owner] = {}; - } - if (condition.operator == 'empty') { - if (!live_field_value || live_field_value == '' && um_in_array(live_field_value, $owners_values[condition.owner])) { - $owners[condition.owner][index] = true; - } else { - $owners[condition.owner][index] = false; - } - } - - if (condition.operator == 'not empty') { - if (live_field_value && live_field_value != '' && !um_in_array(live_field_value, $owners_values[condition.owner])) { - $owners[condition.owner][index] = true; - } else { - $owners[condition.owner][index] = false; - } - } - - if (condition.operator == 'equals to') { - if (condition.value == live_field_value && um_in_array(live_field_value, $owners_values[condition.owner])) { - $owners[condition.owner][index] = true; - } else { - $owners[condition.owner][index] = false; - } - } - - if (condition.operator == 'not equals') { - if (jQuery.isNumeric(condition.value) && parseInt(live_field_value) != parseInt(condition.value) && live_field_value && !um_in_array(live_field_value, $owners_values[condition.owner])) { - $owners[condition.owner][index] = true; - } else if (condition.value != live_field_value && !um_in_array(live_field_value, $owners_values[condition.owner])) { - $owners[condition.owner][index] = true; - } else { - $owners[condition.owner][index] = false; - } - } - - if (condition.operator == 'greater than') { - if (jQuery.isNumeric(condition.value) && parseInt(live_field_value) > parseInt(condition.value)) { - $owners[condition.owner][index] = true; - } else { - $owners[condition.owner][index] = false; - } - } - - if (condition.operator == 'less than') { - if (jQuery.isNumeric(condition.value) && parseInt(live_field_value) < parseInt(condition.value)) { - $owners[condition.owner][index] = true; - } else { - $owners[condition.owner][index] = false; - } - } - - if ( condition.operator == 'contains' ) { - if ( 'multiselect' == um_get_field_type( $dom.parents('.um-field[data-key]') ) ) { - if ( live_field_value && live_field_value.indexOf( condition.value ) >= 0 && um_in_array( condition.value, live_field_value ) ) { - $owners[condition.owner][index] = true; - } else { - $owners[condition.owner][index] = false; - } - } else if ( 'checkbox' == um_get_field_type( $dom.parents('.um-field[data-key]') ) ) { - if ( live_field_value && live_field_value.indexOf( condition.value ) >= 0 ) { - $owners[condition.owner][index] = true; - } else { - $owners[condition.owner][index] = false; - } - } else { - if ( live_field_value && live_field_value.indexOf( condition.value ) >= 0 && um_in_array( live_field_value, $owners_values[ condition.owner ] ) ) { - $owners[condition.owner][index] = true; - } else { - $owners[condition.owner][index] = false; - } - } - } - - }); // end foreach `conditions` - jQuery.each($owners, function (index, field) { - if (um_in_array(true, field)) { - um_field_apply_action($dom, $owner_conditions[index], true); - } else { - um_field_apply_action($dom, $owner_conditions[index], false); - } - }); - $dom.trigger('um_fields_change'); - - } - - /** - * Apply condition's action - * @param object $dom - * @param string condition - * @param boolean is_true - */ - function um_field_apply_action($dom, condition, is_true) { - var child_dom = jQuery('div.um-field[data-key="' + condition.owner + '"]'); - - if (condition.action == 'show' && is_true /*&& child_dom.is(':hidden')*/) { - child_dom.show(); - _show_in_ie( child_dom ); - um_field_restore_default_value(child_dom); - } - - if (condition.action == 'show' && !is_true /*&& child_dom.is(':visible') */) { - child_dom.hide(); - _hide_in_ie( child_dom ); - } - - if (condition.action == 'hide' && is_true /*&& child_dom.is(':visible')*/) { - child_dom.hide(); - _hide_in_ie( child_dom ); - } - - if (condition.action == 'hide' && !is_true /*&& child_dom.is(':hidden')*/) { - child_dom.show(); - _show_in_ie( child_dom ); - um_field_restore_default_value( child_dom ); - - } - $dom.removeClass('um-field-has-changed'); - } - - /** - * Restores default field value - * @param object $dom - */ - function um_field_restore_default_value( $dom ) { - //um_field_default_values - - var type = um_get_field_type( $dom ); - var key = $dom.data('key'); - var field = um_field_default_values[key]; - switch ( type ) { - - case 'text': - case 'number': - case 'date': - case 'textarea': - $dom.find('input:text,input[type=number],textareas').val(field.value); - break; - - case 'select': - $dom.find('select').find('option').prop('selected', false); - $dom.find('select').val(field.value); - $dom.find('select').trigger('change'); - break; - - case 'multiselect': - $dom.find('select').find('option').prop('selected', false); - jQuery.each(field.value, function (i, value) { - $dom.find('select').find('option[value="' + value + '"]').attr('selected', true); - }); - $dom.find('select').trigger('change'); - break; - - case 'checkbox': - - if ( $dom.find('input[type=checkbox]:checked').length >= 1 ) { - - $dom.find('input[type=checkbox]:checked').removeAttr('checked'); - $dom.find('span.um-field-checkbox-state i').removeClass('um-icon-android-checkbox-outline'); - $dom.find('span.um-field-checkbox-state i').addClass('um-icon-android-checkbox-outline-blank'); - $dom.find('.um-field-checkbox.active').removeClass('active'); - - if (jQuery.isArray(field.value)) { - jQuery.each(field.value, function (i, value) { - var cbox_elem = $dom.find('input[type=checkbox][value="' + value + '"]'); - cbox_elem.attr('checked', true); - cbox_elem.closest('.um-field-checkbox').find('i').removeClass('um-icon-android-checkbox-outline-blank'); - cbox_elem.closest('.um-field-checkbox').find('i').addClass('um-icon-android-checkbox-outline'); - cbox_elem.closest('.um-field-checkbox').addClass('active'); - }); - } else { - var cbox_elem = $dom.find('input[type=checkbox][value="' + field.value + '"]'); - cbox_elem.attr('checked', true); - cbox_elem.closest('.um-field-checkbox').find('i').removeClass('um-icon-android-checkbox-outline-blank'); - cbox_elem.closest('.um-field-checkbox').find('i').addClass('um-icon-android-checkbox-outline'); - cbox_elem.closest('.um-field-checkbox').addClass('active'); - } - - } - - break; - case 'radio': - - if ( $dom.find('input[type=radio]:checked').length >= 1 ) { - - setTimeout(function () { - - $dom.find('input[type=radio]:checked').removeAttr('checked'); - - $dom.find('span.um-field-radio-state i').removeClass('um-icon-android-radio-button-on'); - $dom.find('span.um-field-radio-state i').addClass('um-icon-android-radio-button-off'); - $dom.find('.um-field-radio.active').removeClass('active'); - - var radio_elem = $dom.find("input[type=radio][value='" + field.value + "']"); - radio_elem.attr('checked', true); - radio_elem.closest('.um-field-radio').find('i').removeClass('um-icon-android-radio-button-off'); - radio_elem.closest('.um-field-radio').find('i').addClass('um-icon-android-radio-button-on'); - radio_elem.closest('.um-field-radio').addClass('active'); - - }, 100); - } - - break; - - - } // end switch type - - - if ( ! $dom.hasClass( 'um-field-has-changed' ) ) { - var me = um_get_field_element( $dom ); - - if ( type == 'radio' || type == 'checkbox' ) { - me = me.find( ':checked' ); - } - - if ( me ) { - me.trigger( 'change' ); - $dom.addClass( 'um-field-has-changed' ); - } - - /* - maybe future fix - if ( me ) { - if ( type == 'radio' || type == 'checkbox' ) { - me.each( function() { - if ( jQuery(this).is(':checked') ) { - jQuery(this).trigger('change'); - } - }); - } else { - me.trigger( 'change' ); - } - - $dom.addClass( 'um-field-has-changed' ); - }*/ - } - } - - /** - * Hides sibling/child field when parent field is hidden - */ - function um_field_hide_siblings() { - - jQuery.each(um_field_conditions, function (index, conditions) { - if (jQuery('.um-field[data-key="' + index + '"]:hidden').length >= 1 || jQuery('.um-field[data-key="' + index + '"]').css('display') == 'none') { - jQuery.each(conditions, function (key, condition) { - jQuery('.um-field[data-key="' + condition.owner + '"]').hide(); - }); - } - - }); - - } - - /** - * Hides div for IE browser - * @param object $dom - */ - function _hide_in_ie( $dom ){ - if ( typeof( jQuery.browser ) != 'undefined' && jQuery.browser.msie ) { - $dom.css({"visibility":"hidden"}); - } - } - - /** - * Shows div for IE browser - * @param object $dom - */ - function _show_in_ie( $dom ){ - if ( typeof( jQuery.browser ) != 'undefined' && jQuery.browser.msie ) { - $dom.css({"visibility":"visible"}); - } - } - jQuery(document).on('change', '.um-field select, .um-field input[type="radio"], .um-field input[type="checkbox"]', function () { var me = jQuery(this); um_apply_conditions(me, false); @@ -527,71 +592,5 @@ jQuery(document).ready( function (){ um_field_hide_siblings(); // dupes, issue with false field wrapper's visiblity validations. requires optimization. }); - - /** - * UM Conditional fields Init - */ - function um_init_field_conditions() { - var arr_field_keys = []; - - jQuery( '.um-field[data-key]' ).each( function() { - - var key = jQuery(this).data( 'key' ); - - arr_field_keys.push( key ); - - var parse_attrs = {}; - jQuery.each( jQuery(this)[0].attributes, function ( index, attribute ) { - if ( attribute.name.indexOf( 'data-cond' ) != -1 ) { - // replace "data-cond-" - var cond_field_id_and_attr = attribute.name.slice( 10 ); - // return "n" - var cond_field_id = cond_field_id_and_attr.substring( 1, 0 ); - //replace "n-" - var cond_field_attr = cond_field_id_and_attr.slice( 2 ); - - if ( typeof parse_attrs[cond_field_id] == 'undefined' ) - parse_attrs[cond_field_id] = {}; - - parse_attrs[cond_field_id][cond_field_attr] = attribute.value; - } - }); - - jQuery.each( parse_attrs, function ( ii, dd ) { - var obj = {'field' :{ - owner: key, - action: dd.action, - parent: dd.field, - operator: dd.operator, - value: dd.value, - condition: { - owner: key, - action: dd.action, - operator: dd.operator, - value: dd.value - } - }}; - - arr_all_conditions.push(obj); - }); - - um_field_default_values[jQuery(this).data('key')] = um_get_field_default_value( jQuery(this) ); - }); - - jQuery.each( arr_field_keys, function ( i, field_key ) { - um_field_conditions[field_key] = um_get_field_children( field_key ); - }); - - jQuery( '.um-field[data-key]:visible' ).each( function() { - var $wrap_dom = jQuery(this); - var me = um_get_field_element( $wrap_dom ); - if ( typeof me.trigger !== 'undefined' ) { - me.trigger( 'change' ); - } - }); - - } - - um_init_field_conditions(); }); \ No newline at end of file diff --git a/assets/js/um-conditional.min.js b/assets/js/um-conditional.min.js index 4b9c8602..d730672f 100644 --- a/assets/js/um-conditional.min.js +++ b/assets/js/um-conditional.min.js @@ -1 +1 @@ -jQuery(document).ready(function(){var e,t=[],d={},o={};function r(e){switch(s(e)){case"text":case"number":case"date":case"textarea":case"select":case"multiselect":case"radio":case"checkbox":return e.find("input,textarea,select")}return""}function s(e){var n="",i=e.attr("class");return jQuery.each(i.split(" "),function(e,i){-1!=i.indexOf("um-field-type")&&(n=i.split("_")[1])}),n}function l(e,i,n){var a,t=!1;n=!!n;for(a in i)if(n&&i[a]===e||!n&&i[a]==e){t=!0;break}return t}function i(n,e){var i,a=n.parents(".um-field[data-key]").data("key"),t=d[a],c=(i=n,um_live_field=i.parents(".um-field").data("key"),um_live_value=i.val(),i.is(":checkbox")&&(um_live_value="",1parseInt(i.value)?o[i.owner][e]=!0:o[i.owner][e]=!1),"less than"==i.operator&&(jQuery.isNumeric(i.value)&&parseInt(c)parseInt(i.value)?u[i.owner][e]=!0:u[i.owner][e]=!1),"less than"==i.operator&&(jQuery.isNumeric(i.value)&&parseInt(a)js_baseurl . 'um-functions' . $this->suffix . '.js', array( 'jquery', 'jquery-masonry', 'wp-util', 'um_scrollbar' ), ultimatemember_version, true ); wp_register_script( 'um-gdpr', $this->js_baseurl . 'um-gdpr' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, false ); wp_register_script('um_conditional', $this->js_baseurl . 'um-conditional' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true ); - wp_register_script('um_scripts', $this->js_baseurl . 'um-scripts' . $this->suffix . '.js', array( 'jquery', 'wp-util' ), ultimatemember_version, true ); + wp_register_script('um_scripts', $this->js_baseurl . 'um-scripts' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'um_conditional' ), ultimatemember_version, true ); /** * UM hook * @@ -155,8 +155,8 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { wp_register_style( 'select2', $this->css_baseurl . 'select2/select2.min.css', array(), ultimatemember_version ); wp_register_style( 'um_fileupload', $this->css_baseurl . 'um-fileupload.css', array(), ultimatemember_version ); wp_register_style( 'um_datetime', $this->css_baseurl . 'pickadate/default.css', array(), ultimatemember_version ); - wp_register_style( 'um_datetime_date', $this->css_baseurl . 'pickadate/default.date.css', array( 'um-datetime' ), ultimatemember_version ); - wp_register_style( 'um_datetime_time', $this->css_baseurl . 'pickadate/default.time.css', array( 'um-datetime' ), ultimatemember_version ); + wp_register_style( 'um_datetime_date', $this->css_baseurl . 'pickadate/default.date.css', array( 'um_datetime' ), ultimatemember_version ); + wp_register_style( 'um_datetime_time', $this->css_baseurl . 'pickadate/default.time.css', array( 'um_datetime' ), ultimatemember_version ); wp_register_style( 'um_scrollbar', $this->css_baseurl . 'um-scrollbar.css', array(), ultimatemember_version ); wp_register_style( 'um_rtl', $this->css_baseurl . 'um.rtl.css', array(), ultimatemember_version ); diff --git a/includes/core/class-roles-capabilities.php b/includes/core/class-roles-capabilities.php index adc9c2a8..580388b1 100644 --- a/includes/core/class-roles-capabilities.php +++ b/includes/core/class-roles-capabilities.php @@ -530,8 +530,11 @@ if ( ! class_exists( 'um\core\Roles_Capabilities' ) ) { $temp = array(); foreach ( $role_data as $key=>$value ) { - if ( strpos( $key, '_um_' ) === 0 ) - $key = str_replace( '_um_', '', $key ); + if ( strpos( $key, '_um_' ) === 0 ) { + $key = preg_replace('/_um_/', '', $key, 1); + } + + //$key = str_replace( '_um_', '', $key, $count ); $temp[ $key ] = $value; } diff --git a/languages/ultimate-member-en_US.po b/languages/ultimate-member-en_US.po index a642f814..8e7d5ef6 100644 --- a/languages/ultimate-member-en_US.po +++ b/languages/ultimate-member-en_US.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: Ultimate Member\n" -"POT-Creation-Date: 2018-10-26 14:45+0300\n" -"PO-Revision-Date: 2018-10-26 14:46+0300\n" +"POT-Creation-Date: 2018-11-09 16:19+0200\n" +"PO-Revision-Date: 2018-11-09 16:19+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: en_US\n" @@ -6195,48 +6195,42 @@ msgstr "" msgid "just now" msgstr "" -#: includes/core/class-date-time.php:62 +#: includes/core/class-date-time.php:63 #, php-format msgid "%s min" -msgstr "" +msgid_plural "%s mins" +msgstr[0] "" +msgstr[1] "" -#: includes/core/class-date-time.php:64 -#, php-format -msgid "%s mins" -msgstr "" - -#: includes/core/class-date-time.php:73 +#: includes/core/class-date-time.php:72 #, php-format msgid "%s hr" -msgstr "" +msgid_plural "%s hrs" +msgstr[0] "" +msgstr[1] "" -#: includes/core/class-date-time.php:75 -#, php-format -msgid "%s hrs" -msgstr "" - -#: includes/core/class-date-time.php:84 +#: includes/core/class-date-time.php:82 #, php-format msgid "Yesterday at %s" msgstr "" -#: includes/core/class-date-time.php:86 includes/core/class-date-time.php:91 -#: includes/core/class-date-time.php:95 includes/core/class-date-time.php:99 +#: includes/core/class-date-time.php:84 includes/core/class-date-time.php:89 +#: includes/core/class-date-time.php:93 includes/core/class-date-time.php:97 #, php-format msgid "%s at %s" msgstr "" -#: includes/core/class-date-time.php:148 +#: includes/core/class-date-time.php:146 #, php-format msgid "%s year old" msgstr "" -#: includes/core/class-date-time.php:151 +#: includes/core/class-date-time.php:149 #, php-format msgid "%s years old" msgstr "" -#: includes/core/class-date-time.php:154 +#: includes/core/class-date-time.php:152 msgid "Less than 1 year old" msgstr "" @@ -6313,7 +6307,7 @@ msgstr "" msgid "Upload File" msgstr "" -#: includes/core/class-fields.php:2364 includes/core/um-filters-fields.php:243 +#: includes/core/class-fields.php:2364 includes/core/um-filters-fields.php:244 msgid "This file has been removed." msgstr "" @@ -6530,36 +6524,36 @@ msgid "" "\"{login_referrer}\">login to view this content." msgstr "" -#: includes/core/class-shortcodes.php:644 +#: includes/core/class-shortcodes.php:645 msgid "You are already registered" msgstr "" -#: includes/core/class-shortcodes.php:886 +#: includes/core/class-shortcodes.php:887 msgid "Default Template" msgstr "" -#: includes/core/class-uploader.php:648 +#: includes/core/class-uploader.php:654 msgid "Your image is invalid!" msgstr "" -#: includes/core/class-uploader.php:690 +#: includes/core/class-uploader.php:696 msgid "This media type is not recognized." msgstr "" -#: includes/core/class-uploader.php:738 +#: includes/core/class-uploader.php:744 msgid "Your image is invalid or too large!" msgstr "" -#: includes/core/class-uploader.php:744 includes/core/class-uploader.php:746 +#: includes/core/class-uploader.php:750 includes/core/class-uploader.php:752 #, php-format msgid "Your photo is too small. It must be at least %spx wide." msgstr "" -#: includes/core/class-uploader.php:799 +#: includes/core/class-uploader.php:805 msgid "This file type is not recognized." msgstr "" -#: includes/core/class-uploader.php:1065 +#: includes/core/class-uploader.php:1071 #, php-format msgid "Maximum file size allowed: %s" msgstr "" @@ -6950,12 +6944,7 @@ msgstr "" msgid "Joined %s" msgstr "" -#: includes/core/um-filters-fields.php:133 -#, php-format -msgid "Last login: %s" -msgstr "" - -#: includes/core/um-filters-fields.php:274 +#: includes/core/um-filters-fields.php:275 msgid "Untitled photo" msgstr "" From d7323be45226f17cc68803c5fdb555c32ecdc75f Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Sun, 11 Nov 2018 22:22:55 +0200 Subject: [PATCH 08/10] - media field conditional logic; --- includes/admin/assets/js/um-admin-forms.js | 4 +++- includes/admin/core/class-admin-forms.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/admin/assets/js/um-admin-forms.js b/includes/admin/assets/js/um-admin-forms.js index fbd3eecf..dd16ba99 100644 --- a/includes/admin/assets/js/um-admin-forms.js +++ b/includes/admin/assets/js/um-admin-forms.js @@ -123,6 +123,7 @@ jQuery(document).ready( function() { button.siblings('.um-media-upload-data-width').val(attachment.width); button.siblings('.um-media-upload-data-height').val(attachment.height); button.siblings('.um-media-upload-data-thumbnail').val(attachment.thumbnail); + button.siblings('.um-media-upload-data-url').trigger('change'); button.siblings('.um-media-upload-url').val(attachment.url); button.siblings('.um-clear-image').show(); @@ -149,6 +150,7 @@ jQuery(document).ready( function() { clear_button.siblings('.um-media-upload-data-height').val(''); clear_button.siblings('.um-media-upload-data-thumbnail').val(''); clear_button.siblings('.um-forms-field').val( default_image_url ); + clear_button.siblings('.um-media-upload-data-url').trigger('change'); clear_button.siblings('.um-media-upload-url').val( default_image_url ); jQuery( document ).trigger( 'um_media_upload_clear', clear_button ); @@ -159,7 +161,7 @@ jQuery(document).ready( function() { /** * On option fields change */ - jQuery('body').on('change', '.um-forms-field', function() { + jQuery( document.body ).on('change', '.um-forms-field', function() { if ( jQuery('.um-forms-line[data-conditional*=\'"' + jQuery(this).data('field_id') + '",\']').length > 0 ) { run_check_conditions(); } diff --git a/includes/admin/core/class-admin-forms.php b/includes/admin/core/class-admin-forms.php index e27d96d9..2e65a51d 100644 --- a/includes/admin/core/class-admin-forms.php +++ b/includes/admin/core/class-admin-forms.php @@ -967,7 +967,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) { $class_attr = ' class="um-forms-field um-media-upload-data-url ' . $class . '"'; $data = array( - 'field_id' => $field_data['id'], + 'field_id' => $field_data['id'] . '_url', ); if ( ! empty( $field_data['default']['url'] ) ) From dec4a61e843d23d13647085bf0a725f393588fd9 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Mon, 12 Nov 2018 17:53:25 +0200 Subject: [PATCH 09/10] - changed readme; --- languages/ultimate-member-en_US.po | 4 ++-- readme.txt | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/languages/ultimate-member-en_US.po b/languages/ultimate-member-en_US.po index 8e7d5ef6..fa97e398 100644 --- a/languages/ultimate-member-en_US.po +++ b/languages/ultimate-member-en_US.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: Ultimate Member\n" -"POT-Creation-Date: 2018-11-09 16:19+0200\n" -"PO-Revision-Date: 2018-11-09 16:19+0200\n" +"POT-Creation-Date: 2018-11-12 17:51+0200\n" +"PO-Revision-Date: 2018-11-12 17:52+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: en_US\n" diff --git a/readme.txt b/readme.txt index 61aed26b..65bf3aa6 100644 --- a/readme.txt +++ b/readme.txt @@ -137,7 +137,7 @@ The plugin works with popular caching plugins by automatically excluding Ultimat = Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin = -= 2.0.30: October 29, 2018 = += 2.0.30: November 12, 2018 = * Bugfixes: - Fixed crop settings of the big images @@ -145,7 +145,13 @@ The plugin works with popular caching plugins by automatically excluding Ultimat - Fixed uppercase symbols using at profile page slug - Fixed download files/images with cache - Fixed download files/images with not closed buffers - - Added bookmarks compatibility + - Fixed looping in case if set 'display_name' as custom fields for display name setting + - Fixed cover photo size + - Fixed date time internalization + - Fixed posts pagination for un-logged users + - Fixed conditional JS + - Fixed "um_" prefix for role data + - Added compatibility for upcoming User Bookmarks extension = 2.0.29: October 8, 2018 = From 0d1a9f676b2104808eebd776397e247032dcddd4 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Tue, 13 Nov 2018 09:15:14 +0200 Subject: [PATCH 10/10] - added PHP7.2 to travisCI --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1f1c21df..b6e83fa9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,9 +34,11 @@ matrix: - php: "5.6" - php: "7.0" - php: "7.1" + - php: "7.2" allow_failures: - php: "7.1" + - php: "7.2" # - php: "nightly" # whitelist branches for the "push" build check.