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 ?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI 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.