wc_ps_get_product_categories

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

Description

wc_ps_get_product_categories( (int) $parent = 0, (string) $child_space = '', (null) $cats_excluded = null ); 

Parameters (3)

0. $parent — Optional. (int)
The parent.
1. $child_space — Optional. (string) => ''
The child space.
2. $cats_excluded — Optional. (null) => null
The cats excluded.

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. // The parent. 
  5. $parent = -1; 
  6.  
  7. // The child space. 
  8. $child_space = ''; 
  9.  
  10. // The cats excluded. 
  11. $cats_excluded = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = wc_ps_get_product_categories($parent, $child_space, $cats_excluded); 
  15.  

Defined (1)

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

/includes/wc-predictive-template-functions.php  
  1. function wc_ps_get_product_categories( $parent = 0, $child_space = '', $cats_excluded = NULL ) { 
  2. $enable_cache = get_option( 'predictive_search_category_cache', 'yes' ); 
  3. $categories_list = false; 
  4. $append_transient_name = ''; 
  5.  
  6.  
  7. if ( ! $categories_list ) { 
  8. global $wc_predictive_search; 
  9. $categories_list = $wc_predictive_search->get_product_categories_nested( $parent, $child_space , $cats_excluded ); 
  10.  
  11.  
  12. return $categories_list;