dashboard_php_nag_class( string[] $classes ): string[]

In this article

Adds an additional class to the PHP nag if the current version is insecure.

Parameters

$classesstring[]required
Array of meta box classes.

Return

string[] Modified array of meta box classes.

Source

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;
}

Changelog

VersionDescription
5.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.