Filter hook 'site_status_test_php_modules'

in WP Core File wp-admin/includes/class-wp-site-health.php at line 1026

View Source

site_status_test_php_modules

Filter Hook
Description
Filters the array representing all the modules we wish to test for. An associative array of module properties used during testing. One of either `$function` or `$extension` must be provided, or they will fail by default. } }

Hook Information

File Location wp-admin/includes/class-wp-site-health.php View on GitHub
Hook Type Filter
Line Number 1026

Hook Parameters

Type Name Description
array $modules { An associative array of modules to test for.

Usage Examples

Basic Usage
<?php
// Hook into site_status_test_php_modules
add_filter('site_status_test_php_modules', 'my_custom_filter', 10, 1);

function my_custom_filter($modules) {
    // Your custom filtering logic here
    return $modules;
}

Source Code Context

wp-admin/includes/class-wp-site-health.php:1026 - How this hook is used in WordPress core
<?php
1021  		 *         @type bool   $required     Is this a required feature or not.
1022  		 *         @type string $fallback_for Optional. The module this module replaces as a fallback.
1023  		 *     }
1024  		 * }
1025  		 */
1026  		$modules = apply_filters( 'site_status_test_php_modules', $modules );
1027  
1028  		$failures = array();
1029  
1030  		foreach ( $modules as $library => $module ) {
1031  			$extension_name = ( isset( $module['extension'] ) ? $module['extension'] : null );

PHP Documentation

<?php
/**
		 * Filters the array representing all the modules we wish to test for.
		 *
		 * @since 5.2.0
		 * @since 5.3.0 The `$constant` and `$class` parameters were added.
		 *
		 * @param array $modules {
		 *     An associative array of modules to test for.
		 *
		 *     @type array ...$0 {
		 *         An associative array of module properties used during testing.
		 *         One of either `$function` or `$extension` must be provided, or they will fail by default.
		 *
		 *         @type string $function     Optional. A function name to test for the existence of.
		 *         @type string $extension    Optional. An extension to check if is loaded in PHP.
		 *         @type string $constant     Optional. A constant name to check for to verify an extension exists.
		 *         @type string $class        Optional. A class name to check for to verify an extension exists.
		 *         @type bool   $required     Is this a required feature or not.
		 *         @type string $fallback_for Optional. The module this module replaces as a fallback.
		 *     }
		 * }
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/includes/class-wp-site-health.php
Related Hooks

Related hooks will be displayed here in future updates.