WordPress at Your Fingertips
function is not described

WC_Settings_Advanced::save() public WC 1.0

Save settings.

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

Hooks from the method

Return

null. Nothing.

Usage

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

Code of WC_Settings_Advanced::save() WC 5.9.0

public function save() {
	// phpcs:disable WordPress.Security.NonceVerification.Missing
	global $current_section;

	if ( apply_filters( 'woocommerce_rest_api_valid_to_save', ! in_array( $current_section, array( 'keys', 'webhooks' ), true ) ) ) {
		// Prevent the T&Cs and checkout page from being set to the same page.
		if ( isset( $_POST['woocommerce_terms_page_id'], $_POST['woocommerce_checkout_page_id'] ) && $_POST['woocommerce_terms_page_id'] === $_POST['woocommerce_checkout_page_id'] ) {
			$_POST['woocommerce_terms_page_id'] = '';
		}

		// Prevent the Cart, checkout and my account page from being set to the same page.
		if ( isset( $_POST['woocommerce_cart_page_id'], $_POST['woocommerce_checkout_page_id'], $_POST['woocommerce_myaccount_page_id'] ) ) {
			if ( $_POST['woocommerce_cart_page_id'] === $_POST['woocommerce_checkout_page_id'] ) {
				$_POST['woocommerce_checkout_page_id'] = '';
			}
			if ( $_POST['woocommerce_cart_page_id'] === $_POST['woocommerce_myaccount_page_id'] ) {
				$_POST['woocommerce_myaccount_page_id'] = '';
			}
			if ( $_POST['woocommerce_checkout_page_id'] === $_POST['woocommerce_myaccount_page_id'] ) {
				$_POST['woocommerce_myaccount_page_id'] = '';
			}
		}

		$this->save_settings_for_current_section();
		$this->do_update_options_action();
	}
	// phpcs:enable
}