WordPress.org

Ready to get started?Download WordPress

Forums

Revive Old Post (Former Tweet Old Post)
[Plugin: Tweet Old Post] Custom post types (5 posts)

  1. speechpoet
    Member
    Posted 2 years ago #

    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";

    http://wordpress.org/extend/plugins/tweet-old-post/

  2. Ajay Matharu
    Member
    Posted 1 year ago #

    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 :)

  3. mishko
    Member
    Posted 1 year ago #

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

  4. speechpoet
    Member
    Posted 1 year ago #

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

  5. web2010
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic