diff --git a/includes/admin/assets/js/um-admin-role-wrapper.js b/includes/admin/assets/js/um-admin-role-wrapper.js index 020d3cd0..7da1c4ac 100644 --- a/includes/admin/assets/js/um-admin-role-wrapper.js +++ b/includes/admin/assets/js/um-admin-role-wrapper.js @@ -1,6 +1,11 @@ jQuery( document ).ready( function() { jQuery( '#role' ).change( function() { + + if ( typeof um_roles == 'object' ) { + um_roles = Object.keys( um_roles ).map(function( key ) { return um_roles[ key ]; }); + } + if ( jQuery.inArray( jQuery(this).val().substr(3), um_roles ) !== -1 ) { jQuery( '#um_role_selector_wrapper' ).hide(); jQuery( '#um-role' ).val(''); @@ -10,6 +15,10 @@ jQuery( document ).ready( function() { }).trigger('change'); jQuery( '#adduser-role' ).change( function() { + if ( typeof um_roles == 'object' ) { + um_roles = Object.keys( um_roles ).map(function( key ) { return um_roles[ key ]; }); + } + if ( jQuery.inArray( jQuery(this).val().substr(3), um_roles ) !== -1 ) { jQuery( '#um_role_existing_selector_wrapper' ).hide(); jQuery( '#um-role' ).val(''); diff --git a/includes/admin/core/class-admin-enqueue.php b/includes/admin/core/class-admin-enqueue.php index 27dfdf47..c5f018dd 100644 --- a/includes/admin/core/class-admin-enqueue.php +++ b/includes/admin/core/class-admin-enqueue.php @@ -164,8 +164,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) { */ function load_role_wrapper() { wp_register_script( 'um_admin_role_wrapper', $this->js_url . 'um-admin-role-wrapper.js', array( 'jquery' ), ultimatemember_version, true ); - $localize_roles_data = get_option( 'um_roles' ); - wp_localize_script( 'um_admin_role_wrapper', 'um_roles', $localize_roles_data ); + $localize_roles_data = get_option( 'um_roles' ); + wp_localize_script( 'um_admin_role_wrapper', 'um_roles', (array) $localize_roles_data ); wp_enqueue_script( 'um_admin_role_wrapper' ); } diff --git a/languages/ultimate-member-en_US.po b/languages/ultimate-member-en_US.po index 620d438c..580dcab2 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: 2019-08-20 16:27+0300\n" -"PO-Revision-Date: 2019-08-20 16:27+0300\n" +"POT-Creation-Date: 2019-08-21 16:04+0300\n" +"PO-Revision-Date: 2019-08-21 16:04+0300\n" "Last-Translator: \n" "Language-Team: \n" "Language: en_US\n" diff --git a/readme.txt b/readme.txt index 7623d904..559c0842 100644 --- a/readme.txt +++ b/readme.txt @@ -140,7 +140,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.56: August 20, 2019 = += 2.0.56: August 21, 2019 = * Enhancements: - Added security fixes (XSS) @@ -160,6 +160,7 @@ The plugin works with popular caching plugins by automatically excluding Ultimat - Fixed is_selected method for some cases - Fixed form settings fields for default button labels in wp-admin metaboxes - Fixed generate metakeys for the form's custom fields + - Fixed issue when UM Roles localized as object on Add/Edit User screen - Fixed PHP notices = 2.0.55: August 16, 2019 =