Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Adds an additional check to the Site Health plugin for the intl (internationalization) module
<?php
/**
* Filter PHP modules for testing
*
* @package Normalizer
*/
/**
* Plugin Name: Check for intl PHP module
* Description: Add intl module for testing in Site Health
* Plugin URI: http://torstenlandsiedel.de
* Version: 1.0
* Author: Torsten Landsiedel
* Author URI: https://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Add intl module for testing
*
* @param array $modules Recommended PHP modules.
* @return array Recommended PHP modules.
*/
function add_intl_module_testing( $modules ) {
$modules['intl'] = array(
//You can check for the function ...
//'function' => 'normalizer_normalize',
// or for the extension itself:
'extension' => 'intl',
'required' => true,
);
return $modules;
}
add_filter( 'site_status_test_php_modules', 'add_intl_module_testing', 11 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment