-
-
Save doozy/8178b9788be2797a0dc082b6a198c73f to your computer and use it in GitHub Desktop.
Get wishlist products for default user wishlist or by ID or SHAREKEY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( ! function_exists( 'tinvwl_get_wishlist_products' ) ) { | |
/** | |
* Get wishlist products for default user wishlist or by ID or SHAREKEY | |
* | |
* @param int $wishlist_id by ID or SHAREKEY, 0 = default wishlist of current user | |
* | |
* @return array|bool | |
*/ | |
function tinvwl_get_wishlist_products( $wishlist_id = 0 ) { | |
$wishlist = tinv_wishlist_get( $wishlist_id ); | |
if ( empty( $wishlist ) ) { | |
return false; | |
} | |
$wlp = new TInvWL_Product( $wishlist ); | |
$products = $wlp->get_wishlist(); | |
if ( empty( $products ) ) { | |
return false; | |
} | |
return $products; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment