Problems when adding embeds on event description
-
When I add embeds (like Twitter or anything else) on the description of my event, it generates problems in the calendar view showing part of the text of my description, and and at the end this text
","eventStatus":"https://schema.org/EventScheduled"}
This problem comes from class-calendar-event-structure.php which has this code (lines 1183-1188):
// Event details
$__schema_desc = !empty($event_excerpt_txt)? $event_excerpt_txt : (isset($EVENT->post_title)? '"'.$EVENT->post_title.'"':'');
if(!empty($event_details)) $__schema_desc = $event_details;
$__schema_desc = str_replace("'","'", $__schema_desc);
$__schema_desc = str_replace('"',"'", $__schema_desc);
$__schema_desc = preg_replace( "/\r|\n/", " ", $__schema_desc );If you simply add this line below this code, the problem it’s solved:
// Escaping embedded content
? ? ? $__schema_desc = htmlentities($__schema_desc, ENT_QUOTES);Basically, it solves the problems with the quotes on embed content, and solves the view on the calendar
Can you please solve it on the code?
Thank you
Hugo
- The topic ‘Problems when adding embeds on event description’ is closed to new replies.