Support » Plugin: Revive Old Post - Auto Post to Social Media » [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";

Viewing 4 replies - 1 through 4 (of 4 total)
  • Great Thanks for the tip 🙂 I’ll check if I can handle that in the plugin itself without you having to touch it again and again 🙂

    speechpoet, thank you so much for this hack! Worked like a charm 🙂

    You’re welcome, @mishko – and @matharuajay, I’m sorry I missed your reply! Thanks for the kind kudos (and great plugin).

    Thank you speechpoet; I am trying to use with PremiumPress [PP].

    PP uses a custom post type article_type. I tried adding:

    <option value=”article_type” ‘ . top_opt_optionselected(“article_type”, $top_opt_post_type) . ‘>’ . __(‘ Article ‘, ‘TweetOldPost’) . ‘ </option>

    as per the instructions above but I do not see any of my articles on the Exclude Posts page.

    EDIT: The tweets do work. I just cannot choose any to exclude.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Tweet Old Post] Custom post types’ is closed to new replies.