[Plugin: Simple Twitter Connect] Preventing tweet showing html entities for apostrophes etc
-
If I publish a post with the following title:
test - test's & test
the default tweet that goes out replaces the hyphen, apostrophe, and ampersand with html entities: #8211, #039, and amp; (can’t display these properly in this forum)
Now, obviously this doesn’t look very nice in twitter, because it outputs those directly as code. So the usual solution would be to disable wptexturize on the_title in functions.php:
remove_filter('the_title','wptexturize');
However, this doesn’t work. It fixes up the hyphen, but nothing else.
I’ve done some debugging, and calling
stc_get_default_tweet($id)
somewhere else results in the correct title – just not on the edit page. This appears to be because earlier on, the post is being grabbed viaget_post_to_edit
, which callsget_post
with a filter of edit, which then converts various things via sanitize functions. When it comes tostc_get_default_tweet
, get_post returns the cached version which has been sanitized – so$post->post_title
already contains those HTML entities before anything gets done at all.Is there any way around this? (Or is this even a bug in WordPress that it returns the same cached version regardless of the filter set?)
https://www.ads-software.com/extend/plugins/simple-twitter-connect/
- The topic ‘[Plugin: Simple Twitter Connect] Preventing tweet showing html entities for apostrophes etc’ is closed to new replies.