wp_is_php_version_acceptable хук-фильтрWP 5.1.1

Filters whether the active PHP version is considered acceptable by WordPress.

Returning false will trigger a PHP version warning to show up in the admin dashboard to administrators.

This filter is only run if the wordpress.org Serve Happy API considers the PHP version acceptable, ensuring that this filter can only make this check stricter, but not loosen it.

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

add_filter( 'wp_is_php_version_acceptable', 'wp_kama_is_php_version_acceptable_filter', 10, 2 );

/**
 * Function for `wp_is_php_version_acceptable` filter-hook.
 * 
 * @param bool   $is_acceptable Whether the PHP version is considered acceptable.
 * @param string $version       PHP version checked.
 *
 * @return bool
 */
function wp_kama_is_php_version_acceptable_filter( $is_acceptable, $version ){

	// filter...
	return $is_acceptable;
}
$is_acceptable(true|false)
Whether the PHP version is considered acceptable.
По умолчанию: true
$version(строка)
PHP version checked.

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

С версии 5.1.1 Введена.

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

wp_check_php_version()
wp_is_php_version_acceptable
wp-admin/includes/misc.php 1614
$response['is_acceptable'] = (bool) apply_filters( 'wp_is_php_version_acceptable', true, $version );

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

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