Skip to content

Instantly share code, notes, and snippets.

@Pratik-Jain12
Last active March 22, 2019 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pratik-Jain12/b4f39f934e08b1a1db164dc36f1b18c8 to your computer and use it in GitHub Desktop.
Save Pratik-Jain12/b4f39f934e08b1a1db164dc36f1b18c8 to your computer and use it in GitHub Desktop.
Get User Purchased Download Products
// WP Query Parameters
$args = array (
'post_type' => 'download',
'post_status' => array( 'publish' ),
'order' => 'DESC',
'orderby' => 'post_date',
'posts_per_page' => 10,
'ignore_sticky_posts' => true,
'meta_query' => array(
array(
'key' => '_edd_download_sales',
'value' => 0,
'compare' => '>',
),
),
);
// WP Query
$query = new WP_Query( $args );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment