Changing date on calendar breaks URL and shortcodes

Home Forums Calendar Products Events Calendar PRO Changing date on calendar breaks URL and shortcodes

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #954113
    Armando
    Participant

    Hello Tribe,
    I have found a fairly complicated bug but I will do my best to explain my problem.

    Important info:
    I am using Day and Month views
    I am using short codes on every event
    Normally you can see short codes on day and month views. To fix this I am calling the_content and not the_excerpt

    The Problem:
    Everything works fine if I just got to day or month view but if I use the search by date function I get my problem.
    At this point two unwanted things happen. First, my short codes stop working. Second, the URL is in the incorrect format. Normally if a specific date is selected on month view the URL will look like this:

    /events/month/?tribe-bar-date=2015-04

    If you use the date search on month view you get this:

    /events/2015-04/

    You get the same problem if you use the previous or next month navigation at the bottom of the calendar. Even though it is incorrect this normally doesn’t cause a problem. In my case it does because of the way I am using short codes. If the URL is in the correct format (/events/month/?tribe-bar-date=2015-04) the shortcodes work. There is a similar problem if you got to day view (I haven’t tested the others). The way I know that /events/month/?tribe-bar-date=2015-04 is the correct format is because when you select a specific date then switch from one view to another you get the correct format.

    During my tests I have deactivated all other plugins and set the theme to the Default 2015 WP Theme. You can even see this problem in your example install at http://wpshindig.com/events/month/

    I hope this fully explains my problem. Please let me know if there is any more explanation required.

    Thanks

    #954200
    Josh
    Participant

    Hey Armando,

    Thanks for reaching out to us!

    This definitely sounds like an interesting issue to be facing. To start, the URL format of “/events/2015-04/” is a proper format and isn’t a bug or problem with the plugin. This is a format that we expect to see when using the Date options within the Tribe Bar. To think of it differently, it is similar to “http://wpshindig.com/events/category/wordpress-meetups/” rather than “http://wpshindig.com/events/?event-category=wordpress-meetups”.

    It sounds like your issue is due to your shortcode requiring the query string with the date to work? As an alternative, would using something like “tribe_is_month()” work with determining the shortcode functionality?

    Thanks!

    #954229
    Armando
    Participant

    Ok, that makes sense. I guess I jumped to conclusions.

    The short codes work when the url is in the formats of:
    /events/month/?tribe-bar-date=2015-04
    /events/today/
    /events/

    It doesn’t work in the formats of:
    /events/2015-04/
    /events/2015-04-05/

    Do you know what the difference of these is or how we might fix this problem?

    I am not sure I understand how “tribe_is_month()” would help me.

    #954280
    Josh
    Participant

    Hey Armando,

    No problem!

    It’s hard to say what the issue might be without see the source for the shortcode. Would you mind posting a gist of the code so we can take a look at it? I am a little limited on the support that I can provide for something like this but want to check it out in case there is something that stands out.

    The “tribe_is_month()” alternative may not make sense for what the shortcode is doing. I only offered it since it sounded like the shortcode may have been relying on the “?tribe-bar-date=” format for determining that the current view was a month view. That could be a far off assumption on my part though 🙂

    Thanks!

    #954386
    Armando
    Participant

    The shortcode is a content protection shortcode from the plugin Protected Content by WPMUDEV. It looks like this:

    [ms-protect-content id=”38922″]
    The protected content
    [/ms-protect-content]

    Thank you for any help you are able to give.

    #954498
    Josh
    Participant

    Hey Armando,

    Thanks for following up with this. However, I would need to see the actual code from the plugin where the shortcode is created to be able to help.

    As an alternative, would this plugin be an option for accomplishing the same functionality https://wordpress.org/plugins/hide-this/?

    Thanks!

    #954604
    Armando
    Participant

    Thank you for your help. I was able to find a solution to my problem by altering the navigation so that it only goes to the calendar using these formats:
    /events/month/?tribe-bar-date=2015-04
    /events/today/
    /events/

    #955078
    Josh
    Participant

    Hey Armando,

    Thanks for following up! I’m glad you were able to find a solution that works!

    I’ll go ahead and close this thread. If you have any further questions, please don’t hesitate to open a new thread.

    Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Changing date on calendar breaks URL and shortcodes’ is closed to new replies.