WordPress at Your Fingertips
function is not described

WC_Settings_Shipping::instance_settings_screen() protected WC 1.0

Show instance settings

{} It's a method of the class: WC_Settings_Shipping{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->instance_settings_screen( $instance_id );
$instance_id(int) (required)
Shipping instance ID.

Code of WC_Settings_Shipping::instance_settings_screen() WC 5.9.0

protected function instance_settings_screen( $instance_id ) {
	$zone            = WC_Shipping_Zones::get_zone_by( 'instance_id', $instance_id );
	$shipping_method = WC_Shipping_Zones::get_shipping_method( $instance_id );

	if ( ! $shipping_method ) {
		wp_die( esc_html__( 'Invalid shipping method!', 'woocommerce' ) );
	}
	if ( ! $zone ) {
		wp_die( esc_html__( 'Zone does not exist!', 'woocommerce' ) );
	}
	if ( ! $shipping_method->has_settings() ) {
		wp_die( esc_html__( 'This shipping method does not have any settings to configure.', 'woocommerce' ) );
	}

	if ( ! empty( $_POST['save'] ) ) {

		// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
		if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( wp_unslash( $_REQUEST['_wpnonce'] ), 'woocommerce-settings' ) ) {
			echo '<div class="updated error"><p>' . esc_html__( 'Edit failed. Please try again.', 'woocommerce' ) . '</p></div>';
		}

		$shipping_method->process_admin_options();
		$shipping_method->display_errors();
	}

	include_once dirname( __FILE__ ) . '/views/html-admin-page-shipping-zones-instance.php';
}