Skip to content

Instantly share code, notes, and snippets.

@Zodiac1978
Created June 22, 2019 05:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zodiac1978/ce9db99becd3507ec8d8207c583e947b to your computer and use it in GitHub Desktop.
Save Zodiac1978/ce9db99becd3507ec8d8207c583e947b to your computer and use it in GitHub Desktop.
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