Created
June 22, 2019 05:21
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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