Automattic\WooCommerce\Internal\Admin\Settings
PaymentsRestController::get_extension_suggestions
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() PaymentsRestController::get extension suggestions code WC 10.5.0
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();
}