1. daniel2
  2. Pres-sale questions about WP Media Folder
  3. Thursday, June 21 2018
  4.  Subscribe via email
How do you access image meta data using the custom taxonomy system? I am currently using

get_terms( 'wpmf-gallery-category, [ 'hide_empty', => 0 ]);

to pull in a gallery. I would like access to the image data ( title, captions, url, ect). How can I do that with your taxonomy?
Responses (1)
Accepted Answer Pending Moderation
Hi,

Thanks for contacting us here about this extension.
How do you access image meta data using the custom taxonomy system? I am currently using

get_terms( 'wpmf-gallery-category, [ 'hide_empty', => 0 ]);

to pull in a gallery. I would like access to the image data ( title, captions, url, ect). How can I do that with your taxonomy?

You can use the code below to access to your image data:


$args = array(
'post_status' => 'any',
'post_type' => array('attachment'),
'tax_query' => array(
array(
'taxonomy' => 'wpmf-gallery-category',
'terms' => $gallery_id,
'include_children' => false
)
)
);
$query = new WP_Query($args);
$attachments= $query->get_posts();


Hope it helps!
Cheers,
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!