wc_update_200_subcat_display()

Update sub-category display options for 2.0


Description Description


Return Return

(void)


Top ↑

Source Source

File: includes/wc-update-functions.php

function wc_update_200_subcat_display() {
	// Update subcat display settings.
	if ( get_option( 'woocommerce_shop_show_subcategories' ) == 'yes' ) {
		if ( get_option( 'woocommerce_hide_products_when_showing_subcategories' ) == 'yes' ) {
			update_option( 'woocommerce_shop_page_display', 'subcategories' );
		} else {
			update_option( 'woocommerce_shop_page_display', 'both' );
		}
	}

	if ( get_option( 'woocommerce_show_subcategories' ) == 'yes' ) {
		if ( get_option( 'woocommerce_hide_products_when_showing_subcategories' ) == 'yes' ) {
			update_option( 'woocommerce_category_archive_display', 'subcategories' );
		} else {
			update_option( 'woocommerce_category_archive_display', 'both' );
		}
	}
}

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.