Automattic\WooCommerce\Internal\RestApi\Routes\V4\Settings\PaymentGateways\Schema
AbstractPaymentGatewaySettingsSchema::get_groups
Get grouped settings structure with field metadata.
Метод класса: AbstractPaymentGatewaySettingsSchema{}
Хуков нет.
Возвращает
array.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_groups( $gateway ): array;
- $gateway(WC_Payment_Gateway) (обязательный)
- Gateway instance.
Код AbstractPaymentGatewaySettingsSchema::get_groups() AbstractPaymentGatewaySettingsSchema::get groups WC 11.2.2
private function get_groups( WC_Payment_Gateway $gateway ): array {
$gateway->init_form_fields();
// 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 );
}