Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_dll_count() {
- $args = array(
- 'post_type' => 'attachment',
- 'posts_per_page' => null,
- 'post_status' => null,
- 'post_parent' => get_the_ID(),
- 'post_mime_type' => array('application/zip','application/pdf')
- );
- $attachments = get_children( $args );
- foreach ($attachments as $attachment) {
- $dll = get_post_meta($attachment->ID, '_edmc-download-count', true);
- }
- if( isset($dll) && $dll > 0 ) {
- return $dll;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement