Title: dashboard_php_nag_class
Published: February 22, 2019
Last modified: February 24, 2026

---

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

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/dashboard_php_nag_class/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/dashboard_php_nag_class/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/dashboard_php_nag_class/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/dashboard_php_nag_class/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/dashboard_php_nag_class/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/dashboard_php_nag_class/?output_format=md#wp--skip-link--target)

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

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/dashboard_php_nag_class/?output_format=md#parameters)󠁿

 `$classes`string[]required

Array of meta box classes.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/dashboard_php_nag_class/?output_format=md#return)󠁿

 string[] Modified array of meta box classes.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/dashboard_php_nag_class/?output_format=md#source)󠁿

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

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/dashboard.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/dashboard.php#L1941)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/dashboard.php#L1941-L1955)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/dashboard_php_nag_class/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_check_php_version()](https://developer.wordpress.org/reference/functions/wp_check_php_version/)`wp-admin/includes/misc.php` |

Checks if the user needs to update PHP.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/dashboard_php_nag_class/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fdashboard_php_nag_class%2F)
before being able to contribute a note or feedback.