WC_Settings_Shipping::save()publicWC 1.0

Save settings.

Метод класса: WC_Settings_Shipping{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WC_Settings_Shipping = new WC_Settings_Shipping();
$WC_Settings_Shipping->save();

Код WC_Settings_Shipping::save() WC 8.7.0

public function save() {
	global $current_section;

	switch ( $current_section ) {
		case 'options':
			$this->save_settings_for_current_section();
			$this->do_update_options_action();
			break;
		case 'classes':
			$this->do_update_options_action();
			break;
		case '':
			break;
		default:
			$is_shipping_method = false;

			foreach ( $this->get_shipping_methods() as $method_id => $method ) {
				if ( in_array( $current_section, array( $method->id, sanitize_title( get_class( $method ) ) ), true ) ) {
					$is_shipping_method = true;
					$this->do_update_options_action( $method->id );
				}
			}
			if ( ! $is_shipping_method ) {
				$this->save_settings_for_current_section();
			}
			break;
	}

	// Increments the transient version to invalidate cache.
	WC_Cache_Helper::get_transient_version( 'shipping', true );
}