Automattic\WooCommerce\Internal\Admin\Settings

PaymentsController::handle_sectionspublicWC 1.0

Alter the Payments tab sections under certain conditions.

Method of the class: PaymentsController{}

No Hooks.

Returns

Array. The filtered sections.

Usage

$PaymentsController = new PaymentsController();
$PaymentsController->handle_sections( $sections ): array;
$sections(array) (required)
The payments/checkout tab sections.

PaymentsController::handle_sections() code WC 9.8.5

public function handle_sections( array $sections ): array {
	global $current_section;

	// For WooPayments and offline payment methods settings pages, we don't want any section navigation.
	if ( in_array( $current_section, array( 'woocommerce_payments', WC_Gateway_BACS::ID, WC_Gateway_Cheque::ID, WC_Gateway_COD::ID  ), true ) ) {
		return array();
	}

	return $sections;
}