wc_products_array_filter_visible

Callback for array filter to get visible only.

Description

wc_products_array_filter_visible( (WC_Product) $product ); 

Parameters (1)

0. $product (WC_Product)
The product.

Usage

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

Defined (1)

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

/includes/wc-product-functions.php  
  1. function wc_products_array_filter_visible( $product ) { 
  2. return $product && is_a( $product, 'WC_Product' ) && $product->is_visible();