Automattic\WooCommerce\Internal\Admin\Settings

PaymentsRestController::get_extension_suggestionsprivateWC 1.0

Get the payment extension suggestions (other) for the given location.

Method of the class: PaymentsRestController{}

No Hooks.

Returns

Array[]. The payment extension suggestions for the given location, excluding the ones part of the main providers list.

Usage

// private - for code of main (parent) class only
$result = $this->get_extension_suggestions( $location ): array;
$location(string) (required)
The location for which the suggestions are being fetched.

PaymentsRestController::get_extension_suggestions() code WC 9.9.4

private function get_extension_suggestions( string $location ): array {
	// If the requesting user can't install plugins, we don't suggest any extensions.
	if ( ! current_user_can( 'install_plugins' ) ) {
		return array();
	}

	$suggestions = $this->payments->get_payment_extension_suggestions( $location );

	return $suggestions['other'] ?? array();
}