Merge pull request #23295 from woocommerce/fix/23291

Check `get_plugin_data` exists in `WC_REST_System_Status_V2_Controller`
This commit is contained in:
Timmy Crawford 2019-04-15 11:18:41 -07:00 committed by GitHub
commit 08c7bee019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -801,6 +801,12 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller {
* @return array
*/
public function get_active_plugins() {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
if ( ! function_exists( 'get_plugin_data' ) ) {
return array();
}
$active_plugins = (array) get_option( 'active_plugins', array() );
if ( is_multisite() ) {
$network_activated_plugins = array_keys( get_site_option( 'active_sitewide_plugins', array() ) );