WC_Brands_Admin::save_permalink_settings()publicWC 1.0

Save permalnks settings.

We need to save the options ourselves; settings api does not trigger save for the permalinks page.

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

Хуков нет.

Возвращает

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

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

$WC_Brands_Admin = new WC_Brands_Admin();
$WC_Brands_Admin->save_permalink_settings();

Код WC_Brands_Admin::save_permalink_settings() WC 9.4.2

public function save_permalink_settings() {
	if ( ! is_admin() ) {
		return;
	}

	if ( isset( $_POST['permalink_structure'], $_POST['wc-permalinks-nonce'], $_POST['woocommerce_product_brand_slug'] ) && wp_verify_nonce( wp_unslash( $_POST['wc-permalinks-nonce'] ), 'wc-permalinks' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
		update_option( 'woocommerce_brand_permalink', wc_sanitize_permalink( trim( wc_clean( wp_unslash( $_POST['woocommerce_product_brand_slug'] ) ) ) ) );
	}
}