site_status_tests

過濾鉤子
apply_filters( 'site_status_tests', $tests )
引數
  • (array[]) $tests { An associative array of direct and asynchronous tests. @type array[] $direct { An array of direct tests. @type array ...$identifier { `$identifier` should be a unique identifier for the test. Plugins and themes are encouraged to prefix test identifiers with their slug to avoid collisions between tests. @type string $label The friendly label to identify the test. @type callable $test The callback function that runs the test and returns its result. @type bool $skip_cron Whether to skip this test when running as cron. } } @type array[] $async { An array of asynchronous tests. @type array ...$identifier { `$identifier` should be a unique identifier for the test. Plugins and themes are encouraged to prefix test identifiers with their slug to avoid collisions between tests. @type string $label The friendly label to identify the test. @type string $test An admin-ajax.php action to be called to perform the test, or if `$has_rest` is true, a URL to a REST API endpoint to perform the test. @type bool $has_rest Whether the `$test` property points to a REST API endpoint. @type bool $skip_cron Whether to skip this test when running as cron. @type callable $async_direct_test A manner of directly calling the test marked as asynchronous, as the scheduled event can not authenticate, and endpoints may require authentication. } } }
    Required:
定義位置
相關勾子
site_status_test_resultsite_status_test_php_modulesdisplay_site_statesuse_streams_transportsite_icon_meta_tags
相關方法
get_page_statuses_post_statesget_sitestatsget_post_statusespost_comment_status_meta_boxwp_sanitize_script_attributes
引入
5.6.0
棄用
-

site_status_tests: 這是一個過濾鉤子,允許你修改由網站健康工具執行的測試列表。網站健康工具提供關於你的網站及其環境的健康資訊。

篩選在站點上執行的站點狀態測試。

站點執行狀況由基於以下最佳實踐的一組測試確定:WordPress託管團隊和web標準。

某些站點可能沒有相同的要求,例如自動更新檢查可能由主機處理,因此在核心中被禁用。或者您可能想引入一個新的測試,例如,是否啟用/禁用/過時快取。

可以將測試新增為直接測試或非同步測試。任何可能需要一些時間才能完成的測試都應該非同步執行,以避免wp-admin中的載入時間延長。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$tests = apply_filters( 'site_status_tests', $tests );
$tests = apply_filters( 'site_status_tests', $tests );
$tests = apply_filters( 'site_status_tests', $tests );

常見問題

FAQs
檢視更多 >