Title: Context conditional bug when using shortcode [tribe_events_list]
Last modified: January 27, 2022

---

# Context conditional bug when using shortcode [tribe_events_list]

 *  Resolved [Scott Trsar](https://wordpress.org/support/users/scotttrsar/)
 * (@scotttrsar)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/context-conditional-bug-when-using-shortcode-tribe_events_list/)
 * This is either a bug, an oversight or this isn’t documented very clearly… I’m
   assuming the cause is because certain shortcodes other than [tribe_events] are
   reusing widget code.
 * [Referring to the documentation on this article](https://theeventscalendar.com/knowledgebase/k/hide-events-of-a-category-on-the-calendar/#h-hide-only-on-shortcode-page)
 * —–
    - TEC v5.12.4
    - TEC PRO v5.12.0
 * If you are using the shortcode [tribe_event_list] the shortcode context conditional
   does not work in filter tribe_events_views_v2_view_repository_args.
 *     ```
       if($context->is('shortcode')){
         // Is shortcode... @NOTE: doesn't work with shortcode [tribe_events_list] in main page content
       }
       ```
   
 * Instead what worked is checking for the context of a widget _(even though it’s
   a shortcode)_.
 *     ```
       if($context->is('widget')){
         // Is widget... @NOTE: works when using shortcode [tribe_events_list] for some reason
       }
       ```
   
 * Is this intentional or am I mis-understanding the documentation?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcontext-conditional-bug-when-using-shortcode-tribe_events_list%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [Erica](https://wordpress.org/support/users/eeide/)
 * (@eeide)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/context-conditional-bug-when-using-shortcode-tribe_events_list/#post-15344035)
 * Hi [@scotttrsar](https://wordpress.org/support/users/scotttrsar/)
 * It looks like you have an active Events Calendar Pro license! Please open a ticket
   at [theeventscalendar.com/support/](https://theeventscalendar.com/support/) so
   we can continue to assist you with this through our premium support.
 * Thanks!
    Erica

Viewing 1 replies (of 1 total)

The topic ‘Context conditional bug when using shortcode [tribe_events_list]’ is 
closed to new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [context](https://wordpress.org/support/topic-tag/context/)
 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 1 reply
 * 2 participants
 * Last reply from: [Erica](https://wordpress.org/support/users/eeide/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/context-conditional-bug-when-using-shortcode-tribe_events_list/#post-15344035)
 * Status: resolved