WC_Gateway_Cheque::get_settings_urlpublicWC 1.0

Get the settings URL for the gateway.

Method of the class: WC_Gateway_Cheque{}

No Hooks.

Returns

String. The settings page URL for the gateway.

Usage

$WC_Gateway_Cheque = new WC_Gateway_Cheque();
$WC_Gateway_Cheque->get_settings_url();

WC_Gateway_Cheque::get_settings_url() code WC 10.4.3

public function get_settings_url() {
	// Search for a WC_Settings_Payment_Gateways instance in the settings pages.
	$payments_settings_page = null;
	foreach ( WC_Admin_Settings::get_settings_pages() as $settings_page ) {
		if ( $settings_page instanceof WC_Settings_Payment_Gateways ) {
			$payments_settings_page = $settings_page;
			break;
		}
	}
	// If no instance found, return the default settings URL (the Reactified page).
	if ( empty( $payments_settings_page ) ) {
		return SettingsUtils::wc_payments_settings_url( '/' . WC_Settings_Payment_Gateways::OFFLINE_SECTION_NAME . '/' . $this->id );
	}

	$should_use_react_settings_page = $payments_settings_page->should_render_react_section( WC_Settings_Payment_Gateways::CHEQUE_SECTION_NAME );

	// We must not include both the path and the section query parameter, as this can cause weird behavior.
	return SettingsUtils::wc_payments_settings_url(
		$should_use_react_settings_page ? '/' . WC_Settings_Payment_Gateways::OFFLINE_SECTION_NAME . '/' . $this->id : null,
		$should_use_react_settings_page ? array() : array( 'section' => $this->id )
	);
}