コード例 #1
0
ファイル: AttachmentMapper.php プロジェクト: cyberwani/wpmvc
 protected function wpmvcAddData($item)
 {
     $item = parent::wpmvcAddData($item);
     $item->url = wp_get_attachment_url($item->ID);
     $item->alt_text = get_post_meta($item->ID, "_wp_attachment_image_alt", true);
     return $item;
 }
コード例 #2
0
ファイル: PostMapper.php プロジェクト: cyberwani/wpmvc
 protected function wpmvcAddData($item)
 {
     $item = parent::wpmvcAddData($item);
     $item->url = get_permalink($item->ID);
     $item->attachments = $this->getAttachments($item);
     if ($this->hasFeatured()) {
         $item->featured_image = $this->getFeaturedImage($item);
     }
     $item->meta = $this->getMeta($item->ID);
     $item->author = $this->getAuthor($item);
     return $item;
 }