yith_wcwl_count_add_to_wishlist

Count number of times a product was added to users wishlists.

Description

(int) yith_wcwl_count_add_to_wishlist( (bool) $product_id = false ); 

Returns (int)

Number of times the product was added to wishlists

Parameters (1)

0. $product_id — Optional. (bool) => false
Int|bool Product id

Usage

  1. if ( !function_exists( 'yith_wcwl_count_add_to_wishlist' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yith-woocommerce-wishlist/includes/functions.yith-wcwl.php'; 
  3.  
  4. // int|bool Product id 
  5. $product_id = false; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = yith_wcwl_count_add_to_wishlist($product_id); 
  9.  

Defined (1)

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

/includes/functions.yith-wcwl.php  
  1. function yith_wcwl_count_add_to_wishlist( $product_id = false ) { 
  2. return YITH_WCWL()->count_add_to_wishlist( $product_id );