WC_REST_System_Status_V2_Controller::get_dropins_mu_plugins
Get a list of Dropins and MU plugins.
Method of the class: WC_REST_System_Status_V2_Controller{}
No Hooks.
Returns
Array.
Usage
$WC_REST_System_Status_V2_Controller = new WC_REST_System_Status_V2_Controller(); $WC_REST_System_Status_V2_Controller->get_dropins_mu_plugins();
Changelog
| Since 3.6.0 | Introduced. |
WC_REST_System_Status_V2_Controller::get_dropins_mu_plugins() WC REST System Status V2 Controller::get dropins mu plugins code WC 10.3.6
public function get_dropins_mu_plugins() {
$plugins = get_transient( 'wc_system_status_dropins_mu_plugins' );
if ( false === $plugins ) {
$dropins = get_dropins();
$plugins = array(
'dropins' => array(),
'mu_plugins' => array(),
);
foreach ( $dropins as $key => $dropin ) {
$plugins['dropins'][] = array(
'plugin' => $key,
'name' => $dropin['Name'],
);
}
$mu_plugins = get_mu_plugins();
foreach ( $mu_plugins as $plugin => $mu_plugin ) {
$plugins['mu_plugins'][] = array(
'plugin' => $plugin,
'name' => $mu_plugin['Name'],
'version' => $mu_plugin['Version'],
'url' => $mu_plugin['PluginURI'],
'author_name' => $mu_plugin['AuthorName'],
'author_url' => esc_url_raw( $mu_plugin['AuthorURI'] ),
);
}
set_transient( 'wc_system_status_dropins_mu_plugins', $plugins, HOUR_IN_SECONDS );
}
return $plugins;
}