Update 1.2.92

This commit is contained in:
ultimatemember
2015-05-02 02:49:05 +03:00
parent 3c960b187c
commit 77cde02dd8
43 changed files with 1184 additions and 111 deletions
+52 -1
View File
@@ -13,6 +13,57 @@ class UM_Admin_Dashboard {
add_action('admin_menu', array(&$this, 'secondary_menu_items'), 1000);
add_action('admin_menu', array(&$this, 'extension_menu'), 9999);
add_action( 'admin_head', array( $this, 'menu_order_count' ) );
}
/**
* Get pending users (in queue)
*/
function get_pending_users_count() {
if ( get_option('um_cached_users_queue') > 0 ) {
return get_option('um_cached_users_queue');
}
$args = array( 'fields' => 'ID', 'number' => 20 );
$args['meta_query']['relation'] = 'OR';
$args['meta_query'][] = array(
'key' => 'account_status',
'value' => 'awaiting_email_confirmation',
'compare' => '='
);
$args['meta_query'][] = array(
'key' => 'account_status',
'value' => 'awaiting_admin_review',
'compare' => '='
);
$users = new WP_User_Query( $args );
delete_option('um_cached_users_queue');
add_option('um_cached_users_queue', count($users->results), '', 'no' );
return count($users->results);
}
/**
* Manage order of admin menu items
*/
public function menu_order_count() {
global $menu, $submenu;
$count = $this->get_pending_users_count();
foreach( $menu as $key => $menu_item ) {
if ( 0 === strpos( $menu_item[0], _x( 'Users', 'Admin menu name' ) ) ) {
$menu[ $key ][0] .= ' <span class="update-plugins count-'.$count.'"><span class="processing-count">'.$count.'</span></span>';
}
}
foreach ( $submenu['users.php'] as $key => $menu_item ) {
if ( 0 === strpos( $menu_item[0], _x( 'All Users', 'Admin menu name' ) ) ) {
$submenu['users.php'][ $key ][0] .= ' <span class="update-plugins count-'.$count.'"><span class="processing-count">'.$count.'</span></span>';
}
}
}
/***
@@ -51,7 +102,7 @@ class UM_Admin_Dashboard {
*** @extension menu
***/
function extension_menu() {
add_submenu_page( $this->slug, __('Extensions', $this->slug), '<span style="color: #3dc3e5">' .__('Extensions', $this->slug) . '</span>', 'manage_options', $this->slug . '-extensions', array(&$this, 'admin_page') );
add_submenu_page( $this->slug, __('Extensions', $this->slug), '<span style="color: #00B9EB">' .__('Extensions', $this->slug) . '</span>', 'manage_options', $this->slug . '-extensions', array(&$this, 'admin_page') );
}
/***
+8 -3
View File
@@ -117,12 +117,17 @@ class UM_Admin_Notices {
case 'confirm_delete':
$confirm_uri = urldecode($_REQUEST['_refer']);
$users = implode(', ', $_REQUEST['user']);
$users = '';
foreach( $_REQUEST['user'] as $user_id ) {
$user = get_userdata( $user_id );
$users .= '#' . $user_id . ': ' . $user->user_login . '<br />';
}
$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>';
$messages[0]['err_content'] = sprintf(__('Are you sure you want to delete the selected user(s)? The following users will be deleted: <p>%s</p> <strong>This cannot be undone!</strong>','ultimatemember'), $users);
$messages[0]['err_content'] .= '<p><a href="'.$confirm_uri.'" class="button-primary">' . __('Remove','ultimatemember') . '</a>&nbsp;&nbsp;<a href="'.$ignore.'" class="button">' . __('Undo','ultimatemember') . '</a></p>';
break;