Archived
Updates bonanza
This commit is contained in:
1 parent
d26191c9f8
commit
9d480fc3c5
1366 files changed
+220321
-90180
No files matched your search
+18
-18
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once( './admin.php' );
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! current_user_can( 'list_users' ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
@@ -43,9 +43,9 @@ $help = '<p>' . __('Hovering over a row in the users list will display action li
|
||||
'<li>' . __('Edit takes you to the editable profile screen for that user. You can also reach that screen by clicking on the username.') . '</li>';
|
||||
|
||||
if ( is_multisite() )
|
||||
$help .= '<li>' . __( 'Remove allows you to remove a user from your site. It does not delete their posts. You can also remove multiple users at once by using Bulk Actions.' ) . '</li>';
|
||||
$help .= '<li>' . __( 'Remove allows you to remove a user from your site. It does not delete their content. You can also remove multiple users at once by using Bulk Actions.' ) . '</li>';
|
||||
else
|
||||
$help .= '<li>' . __( 'Delete brings you to the Delete Users screen for confirmation, where you can permanently remove a user from your site and delete their posts. You can also delete multiple users at once by using Bulk Actions.' ) . '</li>';
|
||||
$help .= '<li>' . __( 'Delete brings you to the Delete Users screen for confirmation, where you can permanently remove a user from your site and delete their content. You can also delete multiple users at once by using Bulk Actions.' ) . '</li>';
|
||||
|
||||
$help .= '</ul>';
|
||||
|
||||
@@ -60,13 +60,13 @@ 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="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
'<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
|
||||
if ( empty($_REQUEST) ) {
|
||||
$referer = '<input type="hidden" name="wp_http_referer" value="'. esc_attr(stripslashes($_SERVER['REQUEST_URI'])) . '" />';
|
||||
$referer = '<input type="hidden" name="wp_http_referer" value="'. esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
|
||||
} elseif ( isset($_REQUEST['wp_http_referer']) ) {
|
||||
$redirect = remove_query_arg(array('wp_http_referer', 'updated', 'delete_count'), stripslashes($_REQUEST['wp_http_referer']));
|
||||
$redirect = remove_query_arg(array('wp_http_referer', 'updated', 'delete_count'), wp_unslash( $_REQUEST['wp_http_referer'] ) );
|
||||
$referer = '<input type="hidden" name="wp_http_referer" value="' . esc_attr($redirect) . '" />';
|
||||
} else {
|
||||
$redirect = 'users.php';
|
||||
@@ -86,6 +86,9 @@ jQuery(document).ready( function($) {
|
||||
$('input[name=delete_option]').one('change', function() {
|
||||
submit.prop('disabled', false);
|
||||
});
|
||||
$('#reassign_user').focus( function() {
|
||||
$('#delete_option1').prop('checked', true).trigger('change');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
@@ -208,14 +211,13 @@ case 'delete':
|
||||
|
||||
add_action( 'admin_head', 'delete_users_add_js' );
|
||||
|
||||
include ('admin-header.php');
|
||||
include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
?>
|
||||
<form action="" method="post" name="updateusers" id="updateusers">
|
||||
<?php wp_nonce_field('delete-users') ?>
|
||||
<?php echo $referer; ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php _e('Delete Users'); ?></h2>
|
||||
<?php if ( isset( $_REQUEST['error'] ) ) : ?>
|
||||
<div class="error">
|
||||
@@ -238,12 +240,12 @@ case 'delete':
|
||||
?>
|
||||
</ul>
|
||||
<?php if ( $go_delete ) : ?>
|
||||
<fieldset><p><legend><?php echo _n( 'What should be done with posts owned by this user?', 'What should be done with posts owned by these users?', $go_delete ); ?></legend></p>
|
||||
<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>
|
||||
<ul style="list-style:none;">
|
||||
<li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" />
|
||||
<?php _e('Delete all posts.'); ?></label></li>
|
||||
<?php _e('Delete all content.'); ?></label></li>
|
||||
<li><input type="radio" id="delete_option1" name="delete_option" value="reassign" />
|
||||
<?php echo '<label for="delete_option1">' . __( 'Attribute all posts to:' ) . '</label> ';
|
||||
<?php echo '<label for="delete_option1">' . __( 'Attribute all content to:' ) . '</label> ';
|
||||
wp_dropdown_users( array( 'name' => 'reassign_user', 'exclude' => array_diff( $userids, array($current_user->ID) ) ) ); ?></li>
|
||||
</ul></fieldset>
|
||||
<input type="hidden" name="action" value="dodelete" />
|
||||
@@ -313,14 +315,13 @@ case 'remove':
|
||||
else
|
||||
$userids = $_REQUEST['users'];
|
||||
|
||||
include ('admin-header.php');
|
||||
include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
?>
|
||||
<form action="" method="post" name="updateusers" id="updateusers">
|
||||
<?php wp_nonce_field('remove-users') ?>
|
||||
<?php echo $referer; ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php _e('Remove Users from Site'); ?></h2>
|
||||
<p><?php _e('You have specified these users for removal:'); ?></p>
|
||||
<ul>
|
||||
@@ -354,7 +355,7 @@ break;
|
||||
default:
|
||||
|
||||
if ( !empty($_GET['_wp_http_referer']) ) {
|
||||
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
||||
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce'), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -365,7 +366,7 @@ default:
|
||||
exit;
|
||||
}
|
||||
|
||||
include('./admin-header.php');
|
||||
include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
$messages = array();
|
||||
if ( isset($_GET['update']) ) :
|
||||
@@ -378,7 +379,7 @@ default:
|
||||
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>' ),
|
||||
esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ),
|
||||
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>';
|
||||
@@ -422,7 +423,6 @@ if ( ! empty($messages) ) {
|
||||
} ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2>
|
||||
<?php
|
||||
echo esc_html( $title );
|
||||
@@ -452,4 +452,4 @@ break;
|
||||
|
||||
} // end of the $doaction switch
|
||||
|
||||
include('./admin-footer.php');
|
||||
include( ABSPATH . 'wp-admin/admin-footer.php' );
|
||||
Reference in new issue
Block a user