Support » Plugin: Bit.ly Shortlinks » [Plugin: Bit.ly Shortlinks] The plugin is creating two bit.ly links per page

  • Thank you for this plugin, it’s excellent. There’s just a little bug I’ve noticed.

    When I create a post, even before I save it, the plugin generates a link to the /?p= url rather than the permalink, and saves it to my bit.ly account. When I subsequently publish or title the post, the plugin generates a second bit.ly link — this time to the permalink. As a result, my bit.ly account has two links per page.

    Is there any way of preventing this?

    Thanks!

    C

    http://wordpress.org/extend/plugins/bitly-shortlinks/

Viewing 1 replies (of 1 total)
  • I was having a similar issue, where a permalink would be created before the post was published (or scheduled).
    Given that for some of my content the first title is just a draft, this was causing multiple bit.ly links to be created.

    To solve the problem I slightly modified the plugin, putting the following code right at the beginning of the yoast_bitly_shortlink function:

    $mypost = get_page( $id );
      if ( !in_array($mypost->post_status, array('future', 'publish')) ) {
        return "Post must be published to get a shortlink";
      }

    I don’t know if there is any reason why you’d need a shortcode earlier than that time, maybe Joost can include this patch in the next release of the plugin.

    Riccardo
    [ Signature moderated. ]

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Bit.ly Shortlinks] The plugin is creating two bit.ly links per page’ is closed to new replies.