WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

Plugins_Handler::get_plugins_activating_via_request() private WC 1.0

Returns an array containing the names of plugins that are activating via a request.

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

Хуков нет.

Возвращает

Массив. An array of names of the activating plugins or an empty array.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_plugins_activating_via_request();

Код Plugins_Handler::get_plugins_activating_via_request() WC 4.6.0

<?php
private function get_plugins_activating_via_request() {

	 // phpcs:disable WordPress.Security.NonceVerification.Recommended

	$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : false;
	$plugin = isset( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : false;
	$nonce  = isset( $_REQUEST['_wpnonce'] ) ? $_REQUEST['_wpnonce'] : false;

	/**
	 * Note: we're not actually checking the nonce here becase it's too early
	 * in the execution. The pluggable functions are not yet loaded to give
	 * plugins a chance to plug their versions. Therefore we're doing the bare
	 * minimum: checking whether the nonce exists and it's in the right place.
	 * The request will fail later if the nonce doesn't pass the check.
	 */

	// In case of a single plugin activation there will be a plugin slug.
	if ( 'activate' === $action && ! empty( $nonce ) ) {
		return array( $this->create_plugin_path( wp_unslash( $plugin ) ) );
	}

	$plugins = isset( $_REQUEST['checked'] ) ? $_REQUEST['checked'] : array();

	// In case of bulk activation there will be an array of plugins.
	if ( 'activate-selected' === $action && ! empty( $nonce ) ) {
		$plugin_slugs = array_map( 'wp_unslash', $plugins );
		return array_map( array( $this, 'create_plugin_path' ), $plugin_slugs );
	}

	// phpcs:enable WordPress.Security.NonceVerification.Recommended
	return array();
}