Automattic\WooCommerce\Internal\Features

FeaturesController::filter_plugins_list()privateWC 1.0

Handler for the all_plugins filter.

Returns the list of plugins incompatible with a given plugin if we are in the plugins page and the query string of the current request looks like '?plugin_status=incompatible_with_feature&feature_id=<feature id>'.

Метод класса: FeaturesController{}

Хуков нет.

Возвращает

null. Ничего (null).

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

// private - только в коде основоного (родительского) класса
$result = $this->filter_plugins_list( $list ): array;
$list(массив) (обязательный)
The original list of plugins.

Код FeaturesController::filter_plugins_list() WC 8.6.1

private function filter_plugins_list( $list ): array {
	if ( ! $this->verify_did_woocommerce_init() ) {
		return $list;
	}

	// phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput
	if ( ! function_exists( 'get_current_screen' ) || get_current_screen() && 'plugins' !== get_current_screen()->id || 'incompatible_with_feature' !== ArrayUtil::get_value_or_default( $_GET, 'plugin_status' ) ) {
		return $list;
	}

	$feature_id = $_GET['feature_id'] ?? 'all';
	if ( 'all' !== $feature_id && ! $this->feature_exists( $feature_id ) ) {
		return $list;
	}

	return $this->get_incompatible_plugins( $feature_id, $list );
}