根据附件ID获取附件标题


19

我正在通过图像getMeta。它向我返回附件的ID。现在,我要获取标题,替代文本,描述等。

对于替代文本,效果很好:

get_post_meta($logo, '_wp_attachment_image_alt', true);

现在我想获得标题。我发现可以使用来做到这一点$attachment->post_title,但是这里只有ID。如何获得附件ID的标题?

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.