Quotation marks in description/title may break HTML
-
Hi Frank,
I discovered that if title/description of videos contains quotation marks, it may break the generated itemprop html code. This might only occur in certain plugin combinations, most probably when some of them is trying to optimize HTML structure. I saw you already apply
esc_attr
to the retrieved youtube data so I assume that should be safe corresponding to the WordPress KB database.However, here is a quick workaround if someone else has a small number of videos not passing Google’s validation steps whilst the majority is working. Please add the following to your theme’s functions.php, which removes html-encoded quotes from all tags.
/* remove encoded quotes at all */ function afe_fix_lyte_quote_hanlding($tmpl, $type) { return str_replace('"', "", $tmpl ); } add_filter('lyte_match_postparse_template', 'afe_fix_lyte_quote_hanlding', 10, 2);
Cheers,
Matthieu
- The topic ‘Quotation marks in description/title may break HTML’ is closed to new replies.