WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
фильтр не описан

site_status_tests хук-фильтр . WP 5.2.0

Add or modify which site status tests are run on a site.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

The site health is determined by a set of tests based on best practices from both the WordPress Hosting Team, but also web standards in general.

Some sites may not have the same requirements, for example the automatic update checks may be handled by a host, and are therefore disabled in core. Or maybe you want to introduce a new test, is caching enabled/disabled/stale for example.

Tests may be added either as direct, or asynchronous ones. Any test that may require some time to complete should run asynchronously, to avoid extended loading periods within wp-admin.


add_filter( 'site_status_tests', 'filter_function_name_2196' );
function filter_function_name_2196( $test_type ){
	// filter...

	return $test_type;

An associative array, where the $test_type is either direct or async, to declare if the test should run via Ajax calls after page load.

  • identifier(массив)
    $identifier should be a unique identifier for the test that should run. Plugins and themes are encouraged to prefix test identifiers with their slug to avoid any collisions between tests.

    • label(строка)
      A friendly label for your test to identify it by.

    • test(разное)
      A callable to perform a direct test, or a string AJAX action to be called to perform an async test.

    • has_rest(true|false)
      Optional. Denote if $test has a REST API endpoint.

    • skip_cron(true|false)
      Whether to skip this test when running as cron.

    • async_direct_test(callable)
      A manner of directly calling the test marked as asynchronous, as the scheduled event can not authenticate, and endpoints may require authentication.

Список изменений

С версии 5.2.0 Введена.
С версии 5.6.0 Added the async_direct_test array key. Added the skip_cron array key.

Где вызывается хук

wp-admin/includes/class-wp-site-health.php 2407
$tests = apply_filters( 'site_status_tests', $tests );

Где используется хук в ядре WordPress

Использование не найдено.