$title = __('Users');
$parent_file = 'users.php';
-add_screen_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) );
+add_screen_option( 'per_page' );
// contextual help - choose Help on the top right of admin panel to preview this.
get_current_screen()->add_help_tab( array(
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Users_Screen" target="_blank">Documentation on Managing Users</a>') . '</p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Descriptions of Roles and Capabilities</a>') . '</p>' .
+ '<p>' . __('<a href="https://codex.wordpress.org/Users_Screen" target="_blank">Documentation on Managing Users</a>') . '</p>' .
+ '<p>' . __('<a href="https://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Descriptions of Roles and Capabilities</a>') . '</p>' .
'<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
include( ABSPATH . 'wp-admin/admin-header.php' );
?>
-<form action="" method="post" name="updateusers" id="updateusers">
+<form method="post" name="updateusers" id="updateusers">
<?php wp_nonce_field('delete-users') ?>
<?php echo $referer; ?>
<div class="wrap">
-<h2><?php _e('Delete Users'); ?></h2>
+<h1><?php _e( 'Delete Users' ); ?></h1>
<?php if ( isset( $_REQUEST['error'] ) ) : ?>
-<div class="error">
- <p><strong><?php _e( 'ERROR:' ); ?></strong> <?php _e( 'Please select an option.' ); ?></p>
-</div>
+ <div class="error">
+ <p><strong><?php _e( 'ERROR:' ); ?></strong> <?php _e( 'Please select an option.' ); ?></p>
+ </div>
<?php endif; ?>
-<p><?php echo _n( 'You have specified this user for deletion:', 'You have specified these users for deletion:', count( $userids ) ); ?></p>
+
+<?php if ( 1 == count( $userids ) ) : ?>
+ <p><?php _e( 'You have specified this user for deletion:' ); ?></p>
+<?php else : ?>
+ <p><?php _e( 'You have specified these users for deletion:' ); ?></p>
+<?php endif; ?>
+
<ul>
<?php
$go_delete = 0;
?>
</ul>
<?php if ( $go_delete ) : ?>
- <fieldset><p><legend><?php echo _n( 'What should be done with content owned by this user?', 'What should be done with content owned by these users?', $go_delete ); ?></legend></p>
+ <?php if ( 1 == $go_delete ) : ?>
+ <fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p>
+ <?php else : ?>
+ <fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p>
+ <?php endif; ?>
<ul style="list-style:none;">
<li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" />
<?php _e('Delete all content.'); ?></label></li>
include( ABSPATH . 'wp-admin/admin-header.php' );
?>
-<form action="" method="post" name="updateusers" id="updateusers">
+<form method="post" name="updateusers" id="updateusers">
<?php wp_nonce_field('remove-users') ?>
<?php echo $referer; ?>
<div class="wrap">
-<h2><?php _e('Remove Users from Site'); ?></h2>
-<p><?php _e('You have specified these users for removal:'); ?></p>
+<h1><?php _e( 'Remove Users from Site' ); ?></h1>
+
+<?php if ( 1 == count( $userids ) ) : ?>
+ <p><?php _e( 'You have specified this user for removal:' ); ?></p>
+<?php else : ?>
+ <p><?php _e( 'You have specified these users for removal:' ); ?></p>
+<?php endif; ?>
+
<ul>
<?php
$go_remove = false;
case 'del':
case 'del_many':
$delete_count = isset($_GET['delete_count']) ? (int) $_GET['delete_count'] : 0;
- $messages[] = '<div id="message" class="updated"><p>' . sprintf( _n( 'User deleted.', '%s users deleted.', $delete_count ), number_format_i18n( $delete_count ) ) . '</p></div>';
+ if ( 1 == $delete_count ) {
+ $message = __( 'User deleted.' );
+ } else {
+ $message = _n( '%s user deleted.', '%s users deleted.', $delete_count );
+ }
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $delete_count ) ) . '</p></div>';
break;
case 'add':
if ( isset( $_GET['id'] ) && ( $user_id = $_GET['id'] ) && current_user_can( 'edit_user', $user_id ) ) {
- $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( 'New user created. <a href="%s">Edit user</a>' ),
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( __( 'New user created. <a href="%s">Edit user</a>' ),
esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
self_admin_url( 'user-edit.php?user_id=' . $user_id ) ) ) ) . '</p></div>';
} else {
- $messages[] = '<div id="message" class="updated"><p>' . __( 'New user created.' ) . '</p></div>';
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'New user created.' ) . '</p></div>';
}
break;
case 'promote':
- $messages[] = '<div id="message" class="updated"><p>' . __('Changed roles.') . '</p></div>';
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __('Changed roles.') . '</p></div>';
break;
case 'err_admin_role':
- $messages[] = '<div id="message" class="error"><p>' . __('The current user’s role must have user editing capabilities.') . '</p></div>';
- $messages[] = '<div id="message" class="updated"><p>' . __('Other user roles have been changed.') . '</p></div>';
+ $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __('The current user’s role must have user editing capabilities.') . '</p></div>';
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __('Other user roles have been changed.') . '</p></div>';
break;
case 'err_admin_del':
- $messages[] = '<div id="message" class="error"><p>' . __('You can’t delete the current user.') . '</p></div>';
- $messages[] = '<div id="message" class="updated"><p>' . __('Other users have been deleted.') . '</p></div>';
+ $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __('You can’t delete the current user.') . '</p></div>';
+ $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __('Other users have been deleted.') . '</p></div>';
break;
case 'remove':
- $messages[] = '<div id="message" class="updated fade"><p>' . __('User removed from this site.') . '</p></div>';
+ $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __('User removed from this site.') . '</p></div>';
break;
case 'err_admin_remove':
- $messages[] = '<div id="message" class="error"><p>' . __("You can't remove the current user.") . '</p></div>';
- $messages[] = '<div id="message" class="updated fade"><p>' . __('Other users have been removed.') . '</p></div>';
+ $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __("You can't remove the current user.") . '</p></div>';
+ $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __('Other users have been removed.') . '</p></div>';
break;
}
endif; ?>
} ?>
<div class="wrap">
-<h2>
+<h1>
<?php
echo esc_html( $title );
if ( current_user_can( 'create_users' ) ) { ?>
- <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
+ <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
- <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
+ <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
<?php }
if ( $usersearch )
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( $usersearch ) ); ?>
-</h2>
+</h1>
<?php $wp_list_table->views(); ?>
-<form action="" method="get">
+<form method="get">
<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>