Christmas SALE 25% OFF on new purchases, early renewals or upgrades. Apply Discount
Start Protecting your WordPress Downloads
Protect and track downloads on WordPress... What are you waiting for?
Christmas SALE 25% OFF on new purchases, early renewals or upgrades. Apply Discount
Please note: Functionality described on this page requires Download Monitor version 4.0 or above.
Downloads in Download Monitor can be fetched via the Download Repository. Retrieve is a method of Download Monitor’s download repository service. The method returns an array of downloads. Modifiable with filters. Can be limited and offset.
public function retrieve( $filters=array(), $limit=0, $offset=0 );
Parameter | Type | Default | Description |
---|---|---|---|
$filters | array | array() | The filters that set what downloads will be fetch. Basic WP_Query parameters can be used here with some exceptions. Ignored parameters are post_type , posts_per_page , offset , paged , nopaging . |
$limit | int | 0 | Allows you to limit the amount of downloads that are fetched. |
$offset | int | 0 | The offset specifies the offset of the first row to return. Allows you to skip given offset of downloads in the result set. |
This snippet retrieves all published downloads.
$downloads = download_monitor()->service( 'download_repository' )->retrieve();
This snippet retrieves all published downloads but order them by title.
$downloads = download_monitor()->service( 'download_repository' )->retrieve( array(
'orderby' => 'title',
'order' => 'ASC'
) );
This snippet retrieves all published downloads but order them by title.
$downloads = download_monitor()->service( 'download_repository' )->retrieve( array(
'author' => 2
) );
This snippet retrieves all published downloads but order them by title.
$downloads = download_monitor()->service( 'download_repository' )->retrieve( array(
'tax_query' => array(
array(
'taxonomy' => 'dlm_download_category',
'field' => 'slug',
'terms' => 'my-category-slug'
)
)
) );
Retrieving a single download can also be done with retrieve_single method.
Protect and track downloads on WordPress... What are you waiting for?