wp_is_php_version_acceptable
Filter HookDescription
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.Hook Information
File Location |
wp-admin/includes/misc.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1621 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$is_acceptable
|
Whether the PHP version is considered acceptable. Default true. |
string
|
$version
|
PHP version checked. |
Usage Examples
Basic Usage
<?php
// Hook into wp_is_php_version_acceptable
add_filter('wp_is_php_version_acceptable', 'my_custom_filter', 10, 2);
function my_custom_filter($is_acceptable, $version) {
// Your custom filtering logic here
return $is_acceptable;
}
Source Code Context
wp-admin/includes/misc.php:1621
- How this hook is used in WordPress core
<?php
1616 * @since 5.1.1
1617 *
1618 * @param bool $is_acceptable Whether the PHP version is considered acceptable. Default true.
1619 * @param string $version PHP version checked.
1620 */
1621 $response['is_acceptable'] = (bool) apply_filters( 'wp_is_php_version_acceptable', true, $version );
1622 }
1623
1624 $response['is_lower_than_future_minimum'] = false;
1625
1626 // The minimum supported PHP version will be updated to 7.4 in the future. Check if the current version is lower.
PHP Documentation
<?php
/**
* 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.
*
* @since 5.1.1
*
* @param bool $is_acceptable Whether the PHP version is considered acceptable. Default true.
* @param string $version PHP version checked.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-admin/includes/misc.php
Related Hooks
Related hooks will be displayed here in future updates.