[Plugin: AddThis] Bug! inserting into metatag content via get_the_excerpt/the_content
-
The plugin “Facebook Open Graph Meta in WordPress” has this line of code in its insert_fb_in_head() function;
<meta property="og:description" content="<?php echo strip_tags(get_the_excerpt($post->ID)); ?>"/>
Probably other plugins will use the same method.
If there is no excerpt, or if it is a page, wordpress of course defaults to using an extract of “the_content”, which is unfortunately in this case filtered into by AddThis, which echo’s itself into the metatag and breaks things (i.e. content=”<script … “).
In addthis_social_widget.php, this;
add_filter('the_title', 'at_title_check');
will call this;
add_filter('the_content', 'addthis_script_to_content');
which will call <b>addthis_output_script()</b>, which actually echo’s the script there and then, rather than appending it or returning it.
commenting either of those filters will fix the problem, but we’d prefer a fix from the authors.
many thanks!
- The topic ‘[Plugin: AddThis] Bug! inserting into metatag content via get_the_excerpt/the_content’ is closed to new replies.