WC_Settings_Shipping::output_shipping_class_screen()protectedWC 1.0

Handles output of the shipping class settings screen.

Method of the class: WC_Settings_Shipping{}

Hooks from the method

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->output_shipping_class_screen();

WC_Settings_Shipping::output_shipping_class_screen() code WC 8.6.1

protected function output_shipping_class_screen() {
	$wc_shipping = WC_Shipping::instance();
	wp_localize_script(
		'wc-shipping-classes',
		'shippingClassesLocalizeScript',
		array(
			'classes'                   => $wc_shipping->get_shipping_classes(),
			'default_shipping_class'    => array(
				'term_id'     => 0,
				'name'        => '',
				'description' => '',
			),
			'wc_shipping_classes_nonce' => wp_create_nonce( 'wc_shipping_classes_nonce' ),
			'strings'                   => array(
				'unload_confirmation_msg' => __( 'Your changed data will be lost if you leave this page without saving.', 'woocommerce' ),
				'save_failed'             => __( 'Your changes were not saved. Please retry.', 'woocommerce' ),
			),
		)
	);
	wp_enqueue_script( 'wc-shipping-classes' );

	// Extendable columns to show on the shipping classes screen.
	$shipping_class_columns = apply_filters(
		'woocommerce_shipping_classes_columns',
		array(
			'wc-shipping-class-name'        => __( 'Shipping class', 'woocommerce' ),
			'wc-shipping-class-slug'        => __( 'Slug', 'woocommerce' ),
			'wc-shipping-class-description' => __( 'Description', 'woocommerce' ),
			'wc-shipping-class-count'       => __( 'Product count', 'woocommerce' ),
		)
	);

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