wc_get_product_visibility_term_ids

Get full list of product visibilty term ids.

Description

(int[]) wc_get_product_visibility_term_ids(); 

Returns (int[])


Usage

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

Defined (1)

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

/includes/wc-term-functions.php  
  1. function wc_get_product_visibility_term_ids() { 
  2. return array_map( 'absint', wp_parse_args( 
  3. wp_list_pluck( 
  4. get_terms( array( 
  5. 'taxonomy' => 'product_visibility',  
  6. 'hide_empty' => false,  
  7. ) ),  
  8. 'term_taxonomy_id',  
  9. 'name' 
  10. ),  
  11. array( 
  12. 'exclude-from-catalog' => 0,  
  13. 'exclude-from-search' => 0,  
  14. 'featured' => 0,  
  15. 'outofstock' => 0,  
  16. 'rated-1' => 0,  
  17. 'rated-2' => 0,  
  18. 'rated-3' => 0,  
  19. 'rated-4' => 0,  
  20. 'rated-5' => 0,  
  21. ) );