Support

Home Forums Events Calendar Add-on Calendar Tool Tip excerpt only?

Calendar Tool Tip excerpt only?

Posted: February 11, 2013 at 11:46 pm

Viewing 9 reply threads


Kraft

February 11, 2013 at 11:46 pm

Previously, upon hovering of the calendar item, the tool tip would display only the excerpt (I believe; whatever was before a more tag). After updating to the latest versions of WP, EE, EE Calendar, it is now displaying the entire content.

What’s the best/safest/future-proofingest way to enable to old behavior?

[I may have edited the plugin itself to create the behavior; been long enough that I don’t recall. If that’s the case, could I drop a template into /uploads/espresso to future-proof for update?]


Dean

February 12, 2013 at 5:20 am

Hi,

I will raise a ticket to get the devs to look into this as it is not functioning correctly my side either.


cerulean

February 18, 2013 at 1:53 pm

I’d love to see this feature too. I’m using created posts as the default setting and currently they are very long on the calendar. Thanks!


Jonathan Wilson

February 18, 2013 at 3:16 pm

Hi cerulean,

Thank you for your input.


Kraft

February 19, 2013 at 9:05 pm

Hi Dean,

Wonder if there has been any progress on EE not respecting the more tag in the Calendar add-on tool-tip?

Client isn’t very happy :-/

Thanks!


Dean

February 19, 2013 at 11:47 pm

Hi,

I have upped the priority on this thicket but I can’t confirm when it will get resolved, the developers work on the highest priority stuff first, and queue things accordingly.

I took a look myself and I think I can see what is happening (the more tag is being stripped from the content string) but I do not know how to resolve that, I will inform the devs to look at that area.


Kraft

February 20, 2013 at 12:11 am

That got me to thinking and I think I found it.

It looks like /includes/functions/main.php was changed somewhat recently dropping return wpautop(stripslashes_deep(html_entity_decode(do_shortcode($content), ENT_QUOTES, "UTF-8")));

for

return strip_tags(wpautop(stripslashes_deep(html_entity_decode(do_shortcode($content), ENT_QUOTES, "UTF-8"))),$allowed_tags);

(roughly line 48).

PHP strip_tags is hardcoded to remove html comments, which can’t be changed by the $allowed_tags. (ref: http://php.net/manual/en/function.strip-tags.php ).

I didn’t compare the list of allowed tags, but using wp_kses_post instead of strip_tags works (ref: http://www.artbytheglassstudio.com/calendar/ notice that most tooltips show only the image without additional text).

Worst case, use wp_kses and set the allowed tags through that.

Thanks for narrowing down the problem!


Dean

February 20, 2013 at 1:11 am

Hey,

That nailed it! I didnt think to look in the main.php but yeah looks like an oversight regarding the html comment tags issue in strip_tags. Ill make sure the devs see this.

Why not use wp_kses instead of wp_kses_post ? It seems to work better for text but not images, though it should allow them.

Thankyou very much for pinpointing the issue, much appreciated!


Kraft

February 20, 2013 at 11:53 am

Well, a couple of thoughts:

I’d rather use wp_kses_post (which is just an extension of wp_kses anyhow) because it will always match up with what WP allows in posts. When questions arise as far as “what I am able to include in my event’s description”, the answer can be whatever WordPress allows, while pointing them to the list. So, in future versions, as the list adapts and changes, there isn’t a) the need for y’all to update or b) a different set of allowed tags for users.
I’m not sure if wp_kses is needed there at all. It looks like it’s there for formatting, but I’d think that applying those rules upon saving info is enough (and what WP itself does when saving posts, wp_kses is linked to the content_pre_save filter (and comments_pre_save, etc). In an example like this, the bug could have been discovered when the more tag was removed upon saving the event, rather than display.

I don’t know the EE code that well, so my second thought may be way off-base. Just thinking aloud.


Seth Shoultes

  • Support Staff

February 22, 2013 at 4:03 pm

Thanks Brandon! I added the strip_tags at the last minute when I was fixing something else. I wasn’t aware of wp_kses_post at the time and have switched it over. So that fix will be out in the next update.

Viewing 9 reply threads

The support post ‘Calendar Tool Tip excerpt only?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso