mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
9 lines
329 B
Text
9 lines
329 B
Text
function wp_block_user_enumeration_attempts() {
|
|
if ( is_admin() ) return;
|
|
|
|
$author_by_id = ( isset( $_REQUEST['author'] ) && is_numeric( $_REQUEST['author'] ) );
|
|
|
|
if ( $author_by_id )
|
|
wp_die( 'Author archives have been disabled.' );
|
|
}
|
|
add_action( 'template_redirect', 'wp_block_user_enumeration_attempts' );
|