diff --git a/admin/assets/css/um-admin-dashboard.css b/admin/assets/css/um-admin-dashboard.css index 5417f1b3..43287140 100644 --- a/admin/assets/css/um-admin-dashboard.css +++ b/admin/assets/css/um-admin-dashboard.css @@ -1,11 +1,11 @@ -.wrap h2 { +#um-metaboxes-general.wrap h2 { font-size: 23px; font-weight: 400; padding: 9px 15px 4px 0px; line-height: 29px; } -.wrap h2 sup { +#um-metaboxes-general.wrap h2 sup { font-size: 15px; } diff --git a/admin/core/um-admin-actions.php b/admin/core/um-admin-actions.php index 1612e8db..3be59027 100644 --- a/admin/core/um-admin-actions.php +++ b/admin/core/um-admin-actions.php @@ -1,5 +1,67 @@ user->set( $user_id ); + if ( !um_user('super_admin') ) { + + do_action("um_admin_user_action_hook", $bulk_action); + + do_action("um_admin_user_action_{$bulk_action}_hook"); + + } else { + $admin_err = 1; + } + } + + // Finished. redirect now + if ( $admin_err == 0 ){ + wp_redirect( admin_url('users.php?update=users_updated') ); + exit; + } else { + wp_redirect( admin_url('users.php?update=err_users_updated') ); + exit; + } + + } else { + + $redirect = add_query_arg('update','confirm_delete',$redirect); + + foreach( $users as $id ) { + $query .= '&user[]='.$id; + } + + $uri = $ultimatemember->permalinks->get_current_url( true ); + $uri = add_query_arg('um_adm_action', 'delete_users', $uri); + foreach( $users as $user_id ) { + $uri = add_query_arg('user[]', $user_id, $uri); + $redirect = add_query_arg('user[]', $user_id, $redirect); + } + $uri = add_query_arg('confirm', 1, $uri); + $redirect = add_query_arg('_refer', urlencode($uri), $redirect); + + exit( wp_redirect($redirect) ); + + } + + } + /*** *** @purge temp ***/ diff --git a/admin/core/um-admin-notices.php b/admin/core/um-admin-notices.php index ffd1a729..9176f066 100644 --- a/admin/core/um-admin-notices.php +++ b/admin/core/um-admin-notices.php @@ -113,6 +113,18 @@ class UM_Admin_Notices { $update = $_REQUEST['update']; switch($update) { + case 'confirm_delete': + + $confirm_uri = urldecode($_REQUEST['_refer']); + $users = implode(', ', $_REQUEST['user']); + + $ignore = admin_url('users.php'); + + $messages[0]['err_content'] = sprintf(__('Are you sure you want to delete the selected user(s)? The following users will be deleted: (%s) This cannot be undone!','ultimatemember'), $users); + $messages[0]['err_content'] .= ' ' . __('Yes! Delete','ultimatemember') . ' ' . __('Cancel','ultimatemember') . ''; + + break; + case 'language_updated': $messages[0]['content'] = __('Your translation files have been updated successfully.','ultimatemember'); break; diff --git a/admin/core/um-admin-users.php b/admin/core/um-admin-users.php index ca85e18d..374926d1 100644 --- a/admin/core/um-admin-users.php +++ b/admin/core/um-admin-users.php @@ -183,6 +183,21 @@ class UM_Admin_Users { $users = $_REQUEST['users']; $bulk_action = $_REQUEST['um_bulk_action']; + if ( $bulk_action == 'um_delete' ) { // this needs confirmation + + $uri = admin_url('users.php'); + $userids = array_map( 'intval', (array) $_REQUEST['users'] ); + + if ( is_array( $userids ) ) { + $uri = add_query_arg('um_adm_action', 'delete_users', $uri); + foreach( $userids as $user_id ) { + $uri = add_query_arg('user[]', $user_id, $uri); + } + exit( wp_redirect( $uri ) ); + } + + } + foreach($users as $user_id){ $ultimatemember->user->set( $user_id ); if ( !um_user('super_admin') ) { @@ -196,6 +211,7 @@ class UM_Admin_Users { } } + // Finished. redirect now if ( $admin_err == 0 ){ wp_redirect( admin_url('users.php?update=users_updated') ); exit; diff --git a/admin/templates/dashboard/language-contrib.php b/admin/templates/dashboard/language-contrib.php index 6f4a093a..18fc75bb 100644 --- a/admin/templates/dashboard/language-contrib.php +++ b/admin/templates/dashboard/language-contrib.php @@ -1,3 +1,3 @@
%1$s.','ultimatemember'), $locale); ?>
-community forum.','ultimatemember'); ?>
\ No newline at end of file diff --git a/core/um-enqueue.php b/core/um-enqueue.php index 767ac6f8..83a748c4 100644 --- a/core/um-enqueue.php +++ b/core/um-enqueue.php @@ -35,9 +35,8 @@ class UM_Enqueue { *** @Enqueue scripts and styles ***/ function wp_enqueue_scripts() { - global $ultimatemember; - + $exclude_home = um_get_option('js_css_exlcude_home'); if ( $exclude_home && ( is_home() || is_front_page() ) ) { return; @@ -49,24 +48,33 @@ class UM_Enqueue { $c_url = $ultimatemember->permalinks->get_current_url( get_option('permalink_structure') ); foreach( $exclude as $match ) { - if ( strstr( $c_url, untrailingslashit( $match ) ) ) + if ( strstr( $c_url, untrailingslashit( $match ) ) ) { return; + } } } $include = um_get_option('js_css_include'); if ( $include && !is_admin() && is_array( $include ) ) { - + $c_url = $ultimatemember->permalinks->get_current_url( get_option('permalink_structure') ); foreach( $include as $match ) { - if ( !strstr( $c_url, untrailingslashit( $match ) ) ) - return; + if ( strstr( $c_url, untrailingslashit( $match ) ) ) { + $force_load = true; + } else { + if ( !isset( $force_load ) ) { + $force_load = false; + } + } } - + } + + if ( isset($force_load) && $force_load == false ) return; + // enqueue styles if ( um_get_option('disable_minify') ) { $this->load_original(); diff --git a/core/um-user.php b/core/um-user.php index 5204a3ab..258d46ec 100644 --- a/core/um-user.php +++ b/core/um-user.php @@ -333,7 +333,7 @@ class UM_User { require_once( ABSPATH . 'wp-admin/includes/user.php' ); } - wp_delete_user( $this->id ); + wp_delete_user( $this->id, 1 ); } diff --git a/index.php b/index.php index aa86ee36..666c0210 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ Plugin Name: Ultimate Member Plugin URI: http://ultimatemember.com/ Description: Ultimate Member is a powerful community and membership plugin that allows you to create beautiful community and membership sites with WordPress -Version: 1.0.52 +Version: 1.0.53 Author: Ultimate Member Author URI: http://ultimatemember.com/ */ diff --git a/readme.txt b/readme.txt index df9f39b8..6f6967a9 100644 --- a/readme.txt +++ b/readme.txt @@ -7,7 +7,7 @@ Tags: access control, author, authors, author profile, comments, community, comm Requires at least: 4.1 Tested up to: 4.1 -Stable Tag: 1.0.52 +Stable Tag: 1.0.53 License: GNU Version 2 or Any Later Version @@ -186,6 +186,12 @@ The plugin works with popular caching plugins by automatically excluding Ultimat == Changelog == += 1.0.53: February 14, 2015 = + +* Tweak: when deleting users in backend, users will be deleted upon confirmation only +* Tweak: deleted users content is assigned to admin by default (to avoid losing content) +* Fixed: include plugin js and css on specific pages only + = 1.0.52: February 13, 2015 = * Fixed: issue with users backend **update recommended**