Home › Forums › Calendar Products › Events Calendar PRO › Snippet no longer works after 3.11 upgrade.
- This topic has 8 replies, 2 voices, and was last updated 8 years, 9 months ago by George.
-
AuthorPosts
-
July 26, 2015 at 11:30 am #990358Dan FeeleyParticipant
This snippet: https://theeventscalendar.com/knowledgebase/make-phone-numbers-links/ no longer seems to work after the 3.11 upgrade. The number is no longer a link and just displays the following:
July 26, 2015 at 11:31 am #990359Dan FeeleyParticipantOh well, I figured the link might not show up right but if you check the URL I gave you will see the problem I mentioned. Thank You.
July 26, 2015 at 11:41 am #990361Dan FeeleyParticipantI guess you can add this one to the list as well:
https://theeventscalendar.com/knowledgebase/make-organizer-email-a-mailto-field/It appears to be doing the same thing.
July 27, 2015 at 7:49 am #990516GeorgeParticipantHey @danfeeley,
The code in these snippets is actually still compatible with 3.11, so let’s address one separately on your site.
First is the phone-number snippet. You say “The number is no longer a link and just displays the following”, but then it shows a phone number – this number is coming from your event itself, correct? It’s not hard-coded into the snippet so it’s pulling that value from the event venue and if there’s a number there, that means that’s the number from your venue.
Can you please link to where the phone number is showing on your site?
Next, can you clarify what you mean regarding the email snippet when you say “It appears to be doing the same thing.”? Do you literally mean that it’s showing the same phone number as the phone snippet? Please also link to a place on your site where we can see this email snippet being used.
Thank you!
GeorgeJuly 27, 2015 at 9:26 am #990584Dan FeeleyParticipantThis reply is private.
July 27, 2015 at 11:07 am #990622Dan FeeleyParticipantMy bad, in the above reference I meant multiple organizers (we have it relabeled).
July 27, 2015 at 11:57 am #990650GeorgeParticipantNo worries @danfeeley!
I dug deeper and it turns out we’re both kinda right here.
While I’m correct about the actual snippets on our site having “correct” code, we did recently introduce the addition of some esc_html() calls around the relevant bits of code that output the phone number and email address.
Now, this is meant with good intentions, as these functions help “sanitize” data and improve security. But it might admittedly be a bit overkill, especially for your customization here.
Unfortunately, the only way around this is to modify some plugin code. You can either make a whole new template file in your theme and do a whole bunch of copying and pasting and such, which is outlined here → https://theeventscalendar.com/knowledgebase/themers-guide/
Or, though not typically recommended, you can just head into the plugin code yourself and tweak the code. This normally is not recommended because updating the plugin breaks changes you make like this, but I brought up this dilemma with another developer and we’re probably going to remove these unnecessary esc_ functions in these two cases.
To manually make this edit to fix this, head to your plugin files for The Events Calendar. Then head to /src/views/modules/meta/organizer.php
In this file you’ll see two lines of code, which will look like this:
<dd class="tel">
<?php echo esc_html( $phone ); ?>
</dd>and this:
<dd class="email">
<?php echo esc_html( $email ); ?>
</dd>Remove the esc_html() wrapping functions and you should be good to go, so for example, those above would just become this:
<dd class="tel">
<?php echo $phone; ?>
</dd>and this:
<dd class="email">
<?php echo $email; ?>
</dd>I hope this helps – let us know!
Thank you,
GeorgeJuly 27, 2015 at 12:59 pm #990688Dan FeeleyParticipantThat appears to have done the job. Thank you very much.
July 28, 2015 at 10:12 am #991114GeorgeParticipantCool! Stay tuned for the next few updates, as we’re hoping to improve this a bit. If you update and the same problem arises again, please have this issue bookmarked and run through the simple changes above to remove the overzealous HTML escaping from our code 🙂
Cheers!
George -
AuthorPosts
- The topic ‘Snippet no longer works after 3.11 upgrade.’ is closed to new replies.