WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
[resolved] tribe_is_upcoming() returns true (but shouldn't) (13 posts)

  1. tautologe
    Member
    Posted 1 year ago #

    The function tribe_is_upcoming() should
    "Returns true if the query is set for upcoming events, false otherwise" as stated in the documentation.

    But it returns true almost everywhere: frontpage, pages, posts, events in the past, search results, 404 pages,...

    http://wordpress.org/extend/plugins/the-events-calendar/

  2. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Thanks for the note here, tautologe. I'm not sure about the implications or ramifications of this but I've asked Jonah from our dev team - far more code-minded than I am - to take a look here. If he can confirm that this was done in error, we'll get it logged and patched up for the next release.

    One of us will be in touch to confirm the course of action, in either case. Appreciate the heads up and do let us know if you need anything else down the road.

  3. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    I'm sorry that this one slipped through the cracks, tautologe. I wanted to confirm that after checking with Jonah, we do have this on the radar and are working to fix it for the major 3.0 build we're working on now. Should be out the door when that ships over the coming weeks.

    Thanks for your patience and support so far. If you need anything else please just let me know.

  4. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Confirming that this is in the 3.0 code base, ready for release! Should be out early next year :)

  5. tautologe
    Member
    Posted 1 year ago #

    Great! Glad to hear, that I can get rid of a few workarounds :)

    Thanks!

  6. entrepreneurial
    Member
    Posted 1 year ago #

    Hey Tautologe, I am having the same issue. What are the workarounds you are using in the meantime?

  7. tautologe
    Member
    Posted 1 year ago #

    Hi entrepreneurial,
    I'm using the following function instead of tribe_is_upcoming():

    function my_is_upcoming() {
        return tribe_is_upcoming() && (get_post_type() == "" || get_post_type() == "tribe_events") && !is_404();
    }
  8. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Thanks for providing this, tautologe!

    entrepreneurial: that help?

  9. entrepreneurial
    Member
    Posted 1 year ago #

    Thanks for that Tautologe!
    Unfortunately we had to move this particular client to a new plugin due to some issues with MySQL. However we still have a number of clients on the plugin, so I will probably be able to use this in the future. Although I probably won't need to with 3.0 around the corner :)

    FYI the workaround I used before moving to a new plugin was to target the events page URLs instead:

    <?php
    $uri = $_SERVER["REQUEST_URI"];
    $uri_array = split("/",$uri);
    $uri_first = $uri_array[1];
    ?>
    <?php if ($uri_first == 'event-list-page-here'){ ?>
    Blah blah blah
    <?php } else { ?>
    Blah blah blah
    <? } ?>

    Thanks again for getting back to me

  10. entrepreneurial
    Member
    Posted 1 year ago #

    For anyone else reading this...I'd recommend going with Tautologe's workaround (assuming it works), as it will be safer than targeting the URLs. Mine was a last resort workaround

  11. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Thanks for the follow-up and for that last note there, entrepreneurial...will definitely be of value if anyone else shows up with this same problem in the future.

    By that same token...if we can do anything else for you down the road, do let us know. We really appreciate you using The Events Calendar.

  12. torsteino
    Member
    Posted 1 year ago #

    Nice one Tautologe, thanks! Seems to work fine for me!

  13. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Hey guys. Been offline for a while, but I'm back checking the forum and am glad to see this is all sorted. Thanks for confirming, torsteino!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic