Update 1.0.53

This commit is contained in:
ultimatemember
2015-02-14 02:06:43 +02:00
parent ffd9668319
commit 5ad611a472
9 changed files with 117 additions and 13 deletions
+2 -2
View File
@@ -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;
}
+62
View File
@@ -1,5 +1,67 @@
<?php
/***
*** @delete users need confirmation
***/
add_action('um_admin_do_action__delete_users', 'um_admin_do_action__delete_users');
function um_admin_do_action__delete_users( $action ){
global $ultimatemember;
if ( !is_admin() || !current_user_can('manage_options') ) die();
$redirect = admin_url('users.php');
$users = array_map( 'intval', (array) $_REQUEST['user'] );
if ( !$users ) exit( wp_redirect( $redirect ) );
if ( isset( $_REQUEST['confirm'] ) && $_REQUEST['confirm'] == 1 ) { // delete
$bulk_action = 'um_delete';
foreach($users as $user_id){
$ultimatemember->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
***/
+12
View File
@@ -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) <strong>This cannot be undone!</strong>','ultimatemember'), $users);
$messages[0]['err_content'] .= '&nbsp;&nbsp;<a href="'.$confirm_uri.'" class="button-primary">' . __('Yes! Delete','ultimatemember') . '</a>&nbsp;&nbsp;<a href="'.$ignore.'" class="button">' . __('Cancel','ultimatemember') . '</a>';
break;
case 'language_updated':
$messages[0]['content'] = __('Your translation files have been updated successfully.','ultimatemember');
break;
+16
View File
@@ -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;
@@ -1,3 +1,3 @@
<p><?php printf(__('Ultimate Member is not yet available in your language: <strong>%1$s</strong>.','ultimatemember'), $locale); ?></p>
<p><?php _e('If you want to contribute this translation to the plugin, please add it on our <a href="https://ultimatemember.com/forums/"><forums</a>.','ultimatemember'); ?></p>
<p><?php _e('If you want to contribute this translation to the plugin, please add it on our <a href="https://ultimatemember.com/forums/">community forum</a>.','ultimatemember'); ?></p>
+15 -7
View File
@@ -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();
+1 -1
View File
@@ -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 );
}
+1 -1
View File
@@ -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/
*/
+7 -1
View File
@@ -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**