Check get_plugin_data exists

This commit is contained in:
Mike Jolley 2019-04-12 15:34:52 +01:00
parent 4ea3049372
commit 4e8342be38
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 * @return array
*/ */
public function get_active_plugins() { 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() ); $active_plugins = (array) get_option( 'active_plugins', array() );
if ( is_multisite() ) { if ( is_multisite() ) {
$network_activated_plugins = array_keys( get_site_option( 'active_sitewide_plugins', array() ) ); $network_activated_plugins = array_keys( get_site_option( 'active_sitewide_plugins', array() ) );