yit_product_visibility_meta

The YITH WooCommerce Wishlist yit product visibility meta function.

Description

yit_product_visibility_meta( $args ); 

Parameters (1)

0. $args
The args.

Usage

  1. if ( !function_exists( 'yit_product_visibility_meta' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yith-woocommerce-wishlist/plugin-fw/yit-woocommerce-compatibility.php'; 
  3.  
  4. // The args. 
  5. $args = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = yit_product_visibility_meta($args); 
  9.  

Defined (1)

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

/plugin-fw/yit-woocommerce-compatibility.php  
  1. function yit_product_visibility_meta( $args ) { 
  2. if ( version_compare( WC()->version, '2.7.0', '<' ) ) { 
  3. $args[ 'meta_query' ] = isset( $args[ 'meta_query' ] ) ? $args[ 'meta_query' ] : array(); 
  4. $args[ 'meta_query' ][] = WC()->query->visibility_meta_query(); 
  5. } else { 
  6. $product_visibility_term_ids = wc_get_product_visibility_term_ids(); 
  7. $args[ 'tax_query' ] = isset( $args[ 'tax_query' ] ) ? $args[ 'tax_query' ] : array(); 
  8. $args[ 'tax_query' ][] = array( 
  9. 'taxonomy' => 'product_visibility',  
  10. 'field' => 'term_taxonomy_id',  
  11. 'terms' => is_search() ? $product_visibility_term_ids[ 'exclude-from-search' ] : $product_visibility_term_ids[ 'exclude-from-catalog' ],  
  12. 'operator' => 'NOT IN',  
  13. ); 
  14.  
  15. return $args;