Shortcode sort by tag AND category

Home Forums Calendar Products Events Calendar PRO Shortcode sort by tag AND category

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1014628
    Our Saviors Church
    Participant

    when using the [tribe_events_list] shortcode with the category and tag filters, the results are events from either the category or the tag. How can the events listed be from the category AND the tag? I need only the events that are in a certain category and that have a certain tag. and, not or. Does that make sense?

    #1014745
    Brook
    Participant

    Howdy Tyler,

    That’s a good question, I did not realize this myself until 2 seconds ago when I investigated. Buried in our code there is actually a shortcode argument called “operand”. If you wish to do AND instead of the default OR, specify it like so:

    [tribe_events_list operand="AND"]

    Does that do the trick?

    Cheers!

    – Brook

    #1014753
    Our Saviors Church
    Participant

    Hey Brook, it appears that it’s still pulling events with either the category or the tag, not from events from the category and the tag. Here’s my shortcode:

    [tribe_events_list tags="growth-track" category="opelousas" operand="AND"]

    #1015301
    Brook
    Participant

    My mistake, Tyler. I should have tested that first. There is one missing element to getting this to work. Inside of this file /events-calendar-pro/src/Tribe/Shortcodes/Events_List.php on line 48 there is a variable called $default_args. It needs the following line added to it:

    'operand' => 'AND',

    In my tests that added the operand to the shortcode, and should make your above shortcode work. It working for you as well?

    – Brook

    #1015673
    Our Saviors Church
    Participant

    Beautiful! Thanks!

    #1015872
    Brook
    Participant

    Excellent. I am going to log this as a feature request. It will likely be included in our 4.1 release as the next 4.0 release is already in testing and can’t have more features added to it. Until it is included as a feature in the plugin, each time you update this change will be undone. Until then you will need to either readd that line, or ignore the update.

    I will set this thread to be notified when the feature is ready to be released. Please let me know if you have any questions. Cheers!

    • Brook
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Shortcode sort by tag AND category’ is closed to new replies.