[Plugin: WP to Twitter] [FEATURE REQUEST] addition of a #modified# tag
-
I have a unique situation wherein individual posts are be programatically updated multiple times over the course of the same day, with each update being significant enough that it warrants being tweeted again as an update.
However, with the current set of optional tags (#url#, #title#, #post#, #category#, #date#, etc.), it offers no means of making the tweet format unique if the update happens in the same day.
When a post is updated and WP-to-Twitter attempts to tweet it again with the same format, Twitter sees it as a duplicate and flat-out ignores it.
Up till now, I’ve been manually (re-)modifying your plugin to add in a “#modified#” tag, in order to allow such tweet formats as “Post updated #modified#: #title# #url#”, thereby avoiding Twitter ignoring it as a duplicate.
The edit is simple, consisting only of a single line code addition to your jd_truncate_tweet() function:
$post_sentence = str_ireplace( ‘#modified#’, date(‘Y-m-d h:iA e’), $post_sentence );
and adding “#modified#” to the list of tags available. In my example, I’ve hardcoded the date format, but it should be fairly trivial, since you retrieve $post in the function, to alter it to use the post’s actual modified time and return it in the user-configured date & time formats — get_options(‘date_format’) and get_options(‘time_format’) — from the General > Settings page.
So I’m here to propose this as a feature request; adding a “#modified#” tag to the other available options. This would allow greater flexibility for users with unique situations like mine, and save us the hassle of having to manually edit your plugin each time its updated.
- The topic ‘[Plugin: WP to Twitter] [FEATURE REQUEST] addition of a #modified# tag’ is closed to new replies.