Esempio n. 1
0
 protected function get_attachments()
 {
     $atts = get_posts(array('posts_per_page' => 0, 'post_type' => 'attachment', 'post_status' => 'inherit', 'order' => 'ASC', 'post_parent' => $this->post->ID));
     if (!empty($atts)) {
         $attachments = array();
         foreach ($atts as $att) {
             $attachment = new cfd_attachment($att);
             $attachments[$attachment->guid()] = $attachment;
             unset($attachment);
         }
         ksort($attachments);
         return $attachments;
     } else {
         return false;
     }
 }