WC_Brands_Admin::save_permalink_settings
Save permalink settings.
We need to save the options ourselves; settings api does not trigger save for the permalink page.
Method of the class: WC_Brands_Admin{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Brands_Admin = new WC_Brands_Admin(); $WC_Brands_Admin->save_permalink_settings();
WC_Brands_Admin::save_permalink_settings() WC Brands Admin::save permalink settings code WC 10.3.3
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'] ) ) ) ) );
}
}