Home › Forums › Calendar Products › Events Calendar PRO › Using shortcodes within event descriptions
- This topic has 11 replies, 4 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
February 23, 2012 at 3:22 pm #15605
Jen
ParticipantI have been using a custom shortcode to insert post content into the description field of some of my events. (The fewer places to update information, the better!) Anyway, the tooltips on the calendar weren’t equipped to deal with shortcodes.
It was an easy fix, setting up a custom table.php file in my theme and changing one line from:
TribeEvents::truncate(get_the_content())
to
TribeEvents::truncate(do_shortcode(get_the_content())
I thought I’d document the fix here and request that it be added to a future update.
February 24, 2012 at 12:01 pm #15657Rob
MemberHi Jen. Thanks for the note here. Glad to see you got this figured out. I’m going to run it by the team and if makes sense, will integrate smoothly and is issue-free to incorporate in the code, we’ll definitely include this for a future release. Thanks for the heads up!
February 29, 2012 at 8:06 am #15920Rob
MemberHi again Jen. Just wanted to confirm that I talked this over with our dev Joey today. He looked at the code for the truncate() function in our plugin and it already has:
apply_filters(‘the_content’, $text);
which runs through do_shortcode() – we also tested it with a shortcode and it did process and show the shortcode. So this should be working appropriately.
March 2, 2012 at 7:47 am #16121Jen
ParticipantYes, but the same truncate() function also includes strip_shortcodes(), which I’m getting around by putting do_shortcodes() around the_content() *before* running it through truncate().
March 2, 2012 at 7:12 pm #16153Rob
MemberAh, I see. That’s outside my area of expertise – let me get Joey to comment directly. Thanks Jen!
March 5, 2012 at 1:59 pm #16234Joey Kudish
MemberHi Jen,
Your comment makes perfect sense actually, and it didn’t make much sense for us to strip shortcodes there anyway. I’ve just committed the removal of strip_shortcodes() in the truncate function to our development codebase, so do expect that in a future release.
Cheers
March 21, 2012 at 3:03 pm #17047Jen
ParticipantI’m also having shortcode issues in the description portions of the functions iCalFeed() and googleCalendarLink(). The content in the former is not being run through apply_filters(), and the latter is getting encoded before apply_filters(), which prevents the shortcode from being expanded. I’ve got a workaround in place, but wanted to bring it to your attention.
I’ve also got a separate issue with too-long URIs that I see is being handled in an upcoming release.
March 21, 2012 at 3:22 pm #17048Jen
ParticipantSorry, I should have said apply_filters(‘the_content’,$content) in those references. Or I can also just wrap the content in do_shortcode() as before.
March 21, 2012 at 7:56 pm #17056Rob
MemberThanks Jen. Can you provide some steps to recreate the ical/Google Calendar shortcode issue? We can try to resolve it from there…glad you have a workaround but if there is an issue with the code we definitely want to make sure that gets fixed.
March 22, 2012 at 9:25 am #17068Jen
ParticipantI used a custom shortcode in the description of my events, and then when I exported the calendar items via either Google or iCal, the shortcode was left intact rather than expanded. So I’d see something like “[list cat=32 current=true]” instead of “This event is fantastic and you should totally go. Here are more details and a picture.”
In the case of iCalFeed(), the content is never filtered, so the shortcodes are never run. For googleCalendarLink(), the shortcodes are being encoded before they are filtered, which then prevents them from running.
Once I got this fixed, I then ran into two unrelated problems with googleCalendarLink(), which I’ll relate in separate threads. (One I think you’re already on top of.)
March 23, 2012 at 4:38 pm #17111Rob
MemberAh, gotcha. Thanks for confirming as much – looks like this is indeed an issue with the current release. While 2.0.5 is already tagged and awaiting release, I have logged this for 2.1. Thanks for the heads up here, Jen, and apologies for the inconvenience for the time being.
July 6, 2015 at 5:00 pm #976386Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Using shortcodes within event descriptions’ is closed to new replies.
