Automattic\WooCommerce\Internal\RestApi\Routes\V4\Settings\PaymentGateways\Schema
AbstractPaymentGatewaySettingsSchema::get_groups
Get grouped settings structure with field metadata.
Method of the class: AbstractPaymentGatewaySettingsSchema{}
No Hooks.
Returns
Array.
Usage
// private - for code of main (parent) class only $result = $this->get_groups( $gateway ): array;
- $gateway(WC_Payment_Gateway) (required)
- Gateway instance.
AbstractPaymentGatewaySettingsSchema::get_groups() AbstractPaymentGatewaySettingsSchema::get groups code WC 10.4.3
private function get_groups( WC_Payment_Gateway $gateway ): array {
// Check if gateway has custom grouping.
$custom_groups = $this->get_custom_groups_for_gateway( $gateway );
if ( ! empty( $custom_groups ) ) {
return $custom_groups;
}
// Default: single group with all fields.
return $this->get_default_group( $gateway );
}