wp_get_attachment_caption
wp_get_attachment_caption ( $post_id = 0 )
Parameters:- (int) post_id Optional. Attachment ID. Default is the ID of the global `$post`.
Returns:- (string|false) Attachment caption on success, false on failure.
Defined at: - Introduced in WordPress: 4.6.0
- Deprecated in WordPress: —
Description
Retrieves the caption for an attachment.