[Plugin: Tweet Old Post] Custom post types
-
At the moment, TOP (nice acronym, by the way!) supports only blog posts and pages. So if you have custom post types (for instance, if you’re using the latest version of Webcomic), the plugin passes them over.
Fortunately, editing the plugin to add one line to a single file (top-admin.php) is all that’s needed to let me post webcomics from Noise to Signal. It should work for any other custom post type, too; if you have a custom type called “book_review”, just replace “webcomic_post” with “book_review” (note that you’re using the singular form).
In tweet-old-post/top-admin.php, after line 679:
<option value="page" ' . top_opt_optionselected("page", $top_opt_post_type) . '>' . __(' Page Only ', 'TweetOldPost') . ' </option>
add this line:
<option value="webcomic_post" ' . top_opt_optionselected("webcomic_post", $top_opt_post_type) . '>' . __(' Webcomic Only ', 'TweetOldPost') . ' </option>
Of course, I’ll have to do that again each time the plugin is updated (unless the update is to add custom post type support!). But it’s a simple fix, and works nicely on my site.
By the way, I’m a little lucky in that webcomic_post is the only post type I want to tweet. If I wanted the option of all post types, then I’d have to tweak line 89 of tweet-old-post/top-core.php to read something like:
$post_type="(post_type = 'post' OR post_type = 'webcomic_post' OR post_type = 'page' ) AND";
- The topic ‘[Plugin: Tweet Old Post] Custom post types’ is closed to new replies.