wc_update_200_subcat_display

The WooCommerce wc update 200 subcat display function.

Description

wc_update_200_subcat_display(); 

Usage

  1. if ( !function_exists( 'wc_update_200_subcat_display' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-update-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wc_update_200_subcat_display(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-update-functions.php  
  1. function wc_update_200_subcat_display() { 
  2. // Update subcat display settings 
  3. if ( get_option( 'woocommerce_shop_show_subcategories' ) == 'yes' ) { 
  4. if ( get_option( 'woocommerce_hide_products_when_showing_subcategories' ) == 'yes' ) { 
  5. update_option( 'woocommerce_shop_page_display', 'subcategories' ); 
  6. } else { 
  7. update_option( 'woocommerce_shop_page_display', 'both' ); 
  8.  
  9. if ( get_option( 'woocommerce_show_subcategories' ) == 'yes' ) { 
  10. if ( get_option( 'woocommerce_hide_products_when_showing_subcategories' ) == 'yes' ) { 
  11. update_option( 'woocommerce_category_archive_display', 'subcategories' ); 
  12. } else { 
  13. update_option( 'woocommerce_category_archive_display', 'both' );