WC_Gateway_COD::get_settings_url
Get the settings URL for the gateway.
Метод класса: WC_Gateway_COD{}
Хуков нет.
Возвращает
string. The settings page URL for the gateway.
Использование
$WC_Gateway_COD = new WC_Gateway_COD(); $WC_Gateway_COD->get_settings_url();
Код WC_Gateway_COD::get_settings_url() WC Gateway COD::get settings url WC 11.1.1
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::COD_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 )
);
}