Support » Plugin: Media Tags » Use a variable in the tag selection (i.e. media_tags=$tagname)

  • I have implemented a custom meta box in a template where I am also using media tags to generate a list of images for an image slider.

    I want to be able to us the data from this meta box to choose which tag is selected by for use in the slider:

    Right now each template is as so:

    $media_items = get_attachments_by_media_tags('media_tags=vacation');

    I have a variable:

    `global $mediatag_selector;

    $thistag = $mediatag_selector->the_value(‘s_single’);’

    and I’d like to be able to use that variable to define which media tag is selected

    to acheive an equivalent to this:

    $media_items = get_attachments_by_media_tags('media_tags=$thistag');

    Is this even possible? I’m kind of learning this php as I go and I’m not sure if I’m trying to do something impossible.



Viewing 1 replies (of 1 total)
  • @jamieisboss: You probably figured it out by now, but just for the record, like this it should work:
    $media_items = get_attachments_by_media_tags('media_tags='.$thistag);

Viewing 1 replies (of 1 total)
  • The topic ‘Use a variable in the tag selection (i.e. media_tags=$tagname)’ is closed to new replies.