wppaste
WordPress

apply_filters( 'wp_is_php_version_acceptable', bool $is_acceptable, string $version )

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

Description

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.

Compatibility

WordPress
since 5.1.1
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$is_acceptablebool
Whether the PHP version is considered acceptable. Default true.
$versionstring
PHP version checked.

Where this hook fires · 1

  • wp-admin/includes/misc.php:1625wp_check_php_version()

Source code

		 *		 * @since 5.1.1		 *		 * @param bool   $is_acceptable Whether the PHP version is considered acceptable. Default true.		 * @param string $version       PHP version checked.		 */		$response['is_acceptable'] = (bool) apply_filters( 'wp_is_php_version_acceptable', true, $version );	} 	$response['is_lower_than_future_minimum'] = false; 	// The minimum supported PHP version will be updated to at least 8.0 in the future. Check if the current version is lower.	if ( version_compare( $version, '8.0', '<' ) ) {

Changelog

Introduced in 5.1.1. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.