Skip to content

109 Sandbox

A website made for testing

How to get an attachment description in WordPress

Published ·UPD ·In WordPress

wp_prepare_attachment_for_js(get_the_ID())['description']

Can be used to get any of the details of an attachment, not just description.

Documentation: developer.wordpress.org/reference/functions/wp_prepare_attachment_for_js