wc_ps_get_product_categories

The WooCommerce Predictive Search LITE wc ps get product categories function.

Description

wc_ps_get_product_categories(); 

Usage

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

Defined (1)

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

/includes/wc-predictive-template-functions.php  
  1. function wc_ps_get_product_categories() { 
  2. global $wc_predictive_search_cache; 
  3. $categories_list = false; 
  4. $append_transient_name = ''; 
  5.  
  6. if ( $wc_predictive_search_cache->enable_cat_cache() ) { 
  7. if ( class_exists('SitePress') ) { 
  8. $current_lang = apply_filters( 'wpml_current_language', NULL ); 
  9. $append_transient_name = $current_lang; 
  10.  
  11. $categories_list = $wc_predictive_search_cache->get_product_categories_dropdown_cache( $append_transient_name ); 
  12.  
  13. if ( false === $categories_list ) { 
  14. $language = trim( $append_transient_name ); 
  15. if ( '' != $language ) { 
  16. $language = '_' . $language; 
  17. update_option( 'predictive_search_have_cat_cache' . $language, 'no' ); 
  18.  
  19. return $categories_list;