jmlapam

Untitled

May 16th, 2013
53
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function get_dll_count() {
  2. $args = array(
  3. 'post_type' => 'attachment',
  4. 'posts_per_page' => null,
  5. 'post_status' => null,
  6. 'post_parent' => get_the_ID(),
  7. 'post_mime_type' => array('application/zip','application/pdf')
  8. );
  9.  
  10. $attachments = get_children( $args );
  11.  
  12. foreach ($attachments as $attachment) {
  13. $dll = get_post_meta($attachment->ID, '_edmc-download-count', true);
  14. }
  15.  
  16. if( isset($dll) && $dll > 0 ) {
  17. return $dll;
  18. }
  19. }
RAW Paste Data