diff --git a/src/DataTypes/Image.php b/src/DataTypes/Image.php index 6752ac7..26f1bdf 100644 --- a/src/DataTypes/Image.php +++ b/src/DataTypes/Image.php @@ -50,4 +50,14 @@ public function description() } return $meta->post_content; } + + public function caption() + { + $caption = $this->wp->wp_get_attachment_caption($this->id); + if (!$caption) { + return false; + } + + return $caption; + } }