Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I want Get wordpress media library image class.
I have attachment id and I tired this but won't able to get it.
print_r(wp_get_attachment_image_src( $attachment_id, $size, $icon, $attr ));
How can I get it ?
If this is a regular custom field, use get_post_meta():
$classes = get_post_meta( $attachment_id, 'name_of_the_field', TRUE );
attachment is just another post type, regarding to meta data, it works like regular posts or pages.
Required, but never shown