WC_REST_System_Status_V2_Controller::get_dropins_mu_plugins()publicWC 3.6.0

Get a list of Dropins and MU plugins.

{} Это метод класса: WC_REST_System_Status_V2_Controller{}

Хуков нет.

Возвращает

Массив.

Использование

$WC_REST_System_Status_V2_Controller = new WC_REST_System_Status_V2_Controller();
$WC_REST_System_Status_V2_Controller->get_dropins_mu_plugins();

Список изменений

С версии 3.6.0 Введена.

Код WC_REST_System_Status_V2_Controller::get_dropins_mu_plugins() WC 6.9.4

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;
}