• Resolved dcumberland

    (@dcumberland)


    Hi there!

    Thanks for this great plugin. I love it!

    I use Jetpack and WP Bitly together to get shortlinks to blog posts while still in draft mode. This allows me to create auto completed tweet suggestions with a link to the post built in. Prior to last week the “Get Shortlink” button would appear when I saved a draft. Now it only appears after a post is published (properly supplying a bitly shortened link).

    When WP Bitly is deactivated the “Get Shortlink” does appear on drafts.

    So it seems as though WP Bitly may be overriding Jetpack’s Get Shortlink on draft?

    I’d love some help figuring this out. Thanks!

    (My site is TheMeaningMovement.com, if that’s helpful. Also, I have debug mode enabled.)

    https://www.ads-software.com/plugins/wp-bitly/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Mark

    (@delayedinsanity)

    WP Bitly deactivates Jetpack so that the two don’t compete; it’s assumed that if you install WP Bitly side by side with Jetpack it’s intended to be the priority shortlink generator (as it does nothing else).

    You could experiment with editing the array of allowed post types. If you open /wp-bitly/includes/functions.php and go to line 111, you’ll see:

    if (!in_array(get_post_type($post_id), $wpbitly->get_option('post_types')) ||
            !in_array(get_post_status($post_id), array('publish', 'future', 'private')))
            return;

    Change it to the following:

    if (!in_array(get_post_type($post_id), $wpbitly->get_option('post_types')) ||
            !in_array(get_post_status($post_id), array('publish', 'draft', 'future', 'private')))
            return;

    If that does what you want, I’ll add a filter to the code so you can modify the list of allowed post status’ from your themes functions.php instead of editing the plugin directly.

    Thread Starter dcumberland

    (@dcumberland)

    Thanks for the fast reply, Mark!

    I made that change and it works perfectly ??

    Mark

    (@delayedinsanity)

    There’s a wpbitly_allowed_post_status filter in the development branch that will be available for use in the next release. I’ll post back here with instructions on how to use it when I ship the next version, and until then I’m going to sticky this as a reminder for myself.

    Thread Starter dcumberland

    (@dcumberland)

    Thanks fantastic. I really appreciate that you’re continuing to make/keep this plugin great. Thanks so much, and I’ll be on the look out for the update.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP Bitly removes Jetpack's "Get Shortlink" on draft’ is closed to new replies.