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:
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 via
get_post_to_edit, which calls
get_postwith a filter of edit, which then converts various things via sanitize functions. When it comes to
stc_get_default_tweet, get_post returns the cached version which has been sanitized – so
$post->post_titlealready 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?)
- The topic ‘[Plugin: Simple Twitter Connect] Preventing tweet showing html entities for apostrophes etc’ is closed to new replies.