函数原型
dashboard_php_nag_class( string[] $classes ): string[]
函数描述
Adds an additional class to the PHP nag if the current version is insecure.
是否弃用
未弃用
函数参数
-
$classes
string[]
Required - Array of meta box classes.
函数返回值
string[] Modified array of meta box classes.
函数位置
File: wp-admin/includes/dashboard.php.
函数源码
function dashboard_php_nag_class( $classes ) {
$response = wp_check_php_version();
if ( ! $response ) {
return $classes;
}
if ( isset( $response['is_secure'] ) && ! $response['is_secure'] ) {
$classes[] = 'php-no-security-updates';
} elseif ( $response['is_lower_than_future_minimum'] ) {
$classes[] = 'php-version-lower-than-future-minimum';
}
return $classes;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 5.1.0 | Introduced. |

