Edit File by line
/home/barbar84/www/wp-admin
File: users.php
}
[500] Fix | Delete
[501] Fix | Delete
if ( $wp_list_table->current_action() && ! empty( $_REQUEST['users'] ) ) {
[502] Fix | Delete
$screen = get_current_screen()->id;
[503] Fix | Delete
$sendback = wp_get_referer();
[504] Fix | Delete
$userids = $_REQUEST['users'];
[505] Fix | Delete
[506] Fix | Delete
/** This action is documented in wp-admin/edit.php */
[507] Fix | Delete
$sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $wp_list_table->current_action(), $userids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[508] Fix | Delete
[509] Fix | Delete
wp_safe_redirect( $sendback );
[510] Fix | Delete
exit;
[511] Fix | Delete
}
[512] Fix | Delete
[513] Fix | Delete
$wp_list_table->prepare_items();
[514] Fix | Delete
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
[515] Fix | Delete
if ( $pagenum > $total_pages && $total_pages > 0 ) {
[516] Fix | Delete
wp_redirect( add_query_arg( 'paged', $total_pages ) );
[517] Fix | Delete
exit;
[518] Fix | Delete
}
[519] Fix | Delete
[520] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[521] Fix | Delete
[522] Fix | Delete
$messages = array();
[523] Fix | Delete
if ( isset( $_GET['update'] ) ) :
[524] Fix | Delete
switch ( $_GET['update'] ) {
[525] Fix | Delete
case 'del':
[526] Fix | Delete
case 'del_many':
[527] Fix | Delete
$delete_count = isset( $_GET['delete_count'] ) ? (int) $_GET['delete_count'] : 0;
[528] Fix | Delete
if ( 1 == $delete_count ) {
[529] Fix | Delete
$message = __( 'User deleted.' );
[530] Fix | Delete
} else {
[531] Fix | Delete
/* translators: %s: Number of users. */
[532] Fix | Delete
$message = _n( '%s user deleted.', '%s users deleted.', $delete_count );
[533] Fix | Delete
}
[534] Fix | Delete
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $delete_count ) ) . '</p></div>';
[535] Fix | Delete
break;
[536] Fix | Delete
case 'add':
[537] Fix | Delete
$message = __( 'New user created.' );
[538] Fix | Delete
[539] Fix | Delete
$user_id = isset( $_GET['id'] ) ? $_GET['id'] : false;
[540] Fix | Delete
if ( $user_id && current_user_can( 'edit_user', $user_id ) ) {
[541] Fix | Delete
$message .= sprintf(
[542] Fix | Delete
' <a href="%s">%s</a>',
[543] Fix | Delete
esc_url(
[544] Fix | Delete
add_query_arg(
[545] Fix | Delete
'wp_http_referer',
[546] Fix | Delete
urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
[547] Fix | Delete
self_admin_url( 'user-edit.php?user_id=' . $user_id )
[548] Fix | Delete
)
[549] Fix | Delete
),
[550] Fix | Delete
__( 'Edit user' )
[551] Fix | Delete
);
[552] Fix | Delete
}
[553] Fix | Delete
[554] Fix | Delete
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . $message . '</p></div>';
[555] Fix | Delete
break;
[556] Fix | Delete
case 'resetpassword':
[557] Fix | Delete
$reset_count = isset( $_GET['reset_count'] ) ? (int) $_GET['reset_count'] : 0;
[558] Fix | Delete
if ( 1 === $reset_count ) {
[559] Fix | Delete
$message = __( 'Password reset link sent.' );
[560] Fix | Delete
} else {
[561] Fix | Delete
/* translators: %s: Number of users. */
[562] Fix | Delete
$message = _n( 'Password reset links sent to %s user.', 'Password reset links sent to %s users.', $reset_count );
[563] Fix | Delete
}
[564] Fix | Delete
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $reset_count ) ) . '</p></div>';
[565] Fix | Delete
break;
[566] Fix | Delete
case 'promote':
[567] Fix | Delete
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
[568] Fix | Delete
break;
[569] Fix | Delete
case 'err_admin_role':
[570] Fix | Delete
$messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'The current user&#8217;s role must have user editing capabilities.' ) . '</p></div>';
[571] Fix | Delete
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other user roles have been changed.' ) . '</p></div>';
[572] Fix | Delete
break;
[573] Fix | Delete
case 'err_admin_del':
[574] Fix | Delete
$messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'You can&#8217;t delete the current user.' ) . '</p></div>';
[575] Fix | Delete
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other users have been deleted.' ) . '</p></div>';
[576] Fix | Delete
break;
[577] Fix | Delete
case 'remove':
[578] Fix | Delete
$messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'User removed from this site.' ) . '</p></div>';
[579] Fix | Delete
break;
[580] Fix | Delete
case 'err_admin_remove':
[581] Fix | Delete
$messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( "You can't remove the current user." ) . '</p></div>';
[582] Fix | Delete
$messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'Other users have been removed.' ) . '</p></div>';
[583] Fix | Delete
break;
[584] Fix | Delete
}
[585] Fix | Delete
endif;
[586] Fix | Delete
?>
[587] Fix | Delete
[588] Fix | Delete
<?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?>
[589] Fix | Delete
<div class="error">
[590] Fix | Delete
<ul>
[591] Fix | Delete
<?php
[592] Fix | Delete
foreach ( $errors->get_error_messages() as $err ) {
[593] Fix | Delete
echo "<li>$err</li>\n";
[594] Fix | Delete
}
[595] Fix | Delete
?>
[596] Fix | Delete
</ul>
[597] Fix | Delete
</div>
[598] Fix | Delete
<?php
[599] Fix | Delete
endif;
[600] Fix | Delete
[601] Fix | Delete
if ( ! empty( $messages ) ) {
[602] Fix | Delete
foreach ( $messages as $msg ) {
[603] Fix | Delete
echo $msg;
[604] Fix | Delete
}
[605] Fix | Delete
}
[606] Fix | Delete
?>
[607] Fix | Delete
[608] Fix | Delete
<div class="wrap">
[609] Fix | Delete
<h1 class="wp-heading-inline">
[610] Fix | Delete
<?php
[611] Fix | Delete
echo esc_html( $title );
[612] Fix | Delete
?>
[613] Fix | Delete
</h1>
[614] Fix | Delete
[615] Fix | Delete
<?php
[616] Fix | Delete
if ( current_user_can( 'create_users' ) ) {
[617] Fix | Delete
?>
[618] Fix | Delete
<a href="<?php echo admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
[619] Fix | Delete
<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
[620] Fix | Delete
<a href="<?php echo admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
[621] Fix | Delete
<?php
[622] Fix | Delete
}
[623] Fix | Delete
[624] Fix | Delete
if ( strlen( $usersearch ) ) {
[625] Fix | Delete
echo '<span class="subtitle">';
[626] Fix | Delete
printf(
[627] Fix | Delete
/* translators: %s: Search query. */
[628] Fix | Delete
__( 'Search results for: %s' ),
[629] Fix | Delete
'<strong>' . esc_html( $usersearch ) . '</strong>'
[630] Fix | Delete
);
[631] Fix | Delete
echo '</span>';
[632] Fix | Delete
}
[633] Fix | Delete
?>
[634] Fix | Delete
[635] Fix | Delete
<hr class="wp-header-end">
[636] Fix | Delete
[637] Fix | Delete
<?php $wp_list_table->views(); ?>
[638] Fix | Delete
[639] Fix | Delete
<form method="get">
[640] Fix | Delete
[641] Fix | Delete
<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
[642] Fix | Delete
[643] Fix | Delete
<?php if ( ! empty( $_REQUEST['role'] ) ) { ?>
[644] Fix | Delete
<input type="hidden" name="role" value="<?php echo esc_attr( $_REQUEST['role'] ); ?>" />
[645] Fix | Delete
<?php } ?>
[646] Fix | Delete
[647] Fix | Delete
<?php $wp_list_table->display(); ?>
[648] Fix | Delete
</form>
[649] Fix | Delete
[650] Fix | Delete
<div class="clear" /></div>
[651] Fix | Delete
</div>
[652] Fix | Delete
<?php
[653] Fix | Delete
break;
[654] Fix | Delete
[655] Fix | Delete
} // End of the $doaction switch.
[656] Fix | Delete
[657] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-footer.php';
[658] Fix | Delete
[659] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function