slswc_get_user_purchased_products

Filter product purchased products. Allows to change the list of products purchased by a user.

Parameters:
array $user_products The list of products purchased by a user
int $user_id The id of the user
array $args The query arguments for retriving the products.

Example usage:

<?php
add_filter( 'slswc_get_user_purchased_products', function( $user_products, $user_id, $args ) {
    // Do something with $user_products or query $products based on $user_id and $args

    return $user_products;
} );

Was this article helpful?