WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Tweetbacks] Hack to identify custom shorturls: site.com/?p=postid (Add to core?)

[Plugin: Tweetbacks] Hack to identify custom shorturls: site.com/?p=postid (Add to core?)

  • Hi,

    All the “Tweet This” plugins out there are totally bloated, so I wanted my own simple tweet this function call:

    <a href="http://twitter.com/home/?status=<?php the_title(); ?>: <?php echo get_bloginfo('url') . '/?p=' . get_the_ID(); ?>">Tweet This</a>

    Very simple eh? It tweets the title of the post, and your URL in the format of “http://mywebsite.com/?p=4571” where 4571 is the id of the post. Works fine.

    Problem is: TweetBacks doesn’t pick up this URL.

    I’ve tried to add a hack to the plugin to search for this URL, and while I haven’t tested it, I figured I’d write it down here in hopes the author will add something like this to the core:

    Edit “tweetbacks.php”.

    At line 413, insert this:

    // Hack to add custom shorturls
    if (!isset($shorturls['shortpermalink'])) {
    	$shorturls['shortpermalink'] = get_bloginfo('url') . '/?p=' . get_the_ID();
    }

    This should add another array entry to the list of URLs to search for.

    http://wordpress.org/extend/plugins/tweetbacks/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Tweetbacks] Hack to identify custom shorturls: site.com/?p=postid (Add to core?)’ is closed to new replies.
Skip to toolbar