• Resolved wprunner

    (@wprunner)


    Hello,

    I would like to have an option added for “URL Shortener”. It is possible to use WordPress local URLs as a short URL for tweeting. Even when using pretty permalinks the WP ugly URLs can still work and redirect to the pretty ones.

    The URL would look like this:
    http://mydomain.com/?p=123

    The “Tweet This” plugin has such feature but I don’t use it and don’t really like this plugin.

    I would like to have this feature added to the WP Tweet Button plugin. It is perfect for me except for the lack of support for Local URLs.

    Thanks.

    http://wordpress.org/extend/plugins/wp-tweet-button/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Tanin

    (@0xtc)

    The plugin already has this for WP3 and up. All you have to do is select the “WordPress 3 shortener function” as the shortener. What WP version are you running?

    Thread Starter wprunner

    (@wprunner)

    Hello,

    I use WP3.

    Actually, that is what I thought the “WordPress 3 shortener function” does but it didn’t !!!

    I saw the URL, it uses WordPress’s own URL shortner service wp.me
    Test it and see the twitter URL argument (url=)

    Are you using the WordPress.com Stats plugin? By default, it adds a filter to get_shortlink which replaces local short URLs with wp.me short URLs. You can disable this in the WordPress.com Stats options.

    My plugin Tweet This does the same thing if you are not using local URLs. You can disable this by unchecking “Pass shortened URLs to WordPress via the get_shortlink filter if the URL service is not set to Local” in the Advanced Options section of the Tweet This options.

    Thread Starter wprunner

    (@wprunner)

    Hi,

    Yes of course I am using the WordPress.com Stats plugin, who doesn’t ? lol

    unchecked that in the options page of that plugin and it worked, thanks 🙂

    Though, the www. prefix will still bug me, a modified version of the function should be used to eliminate it if a blog uses the www.

    I haven’t looked at WP Tweet Button, but if you just replace all instances of get_bloginfo('url') with str_replace('www.', '', get_bloginfo('url')) it will work if the plugin author uses get_bloginfo('url'). Tweet This does.

    Plugin Author Tanin

    (@0xtc)

    Have you tried removing the WWW in your General settings (WordPress address)?

    He wants to use the www prefix elsewhere but not use it on short URLs.

    Plugin Author Tanin

    (@0xtc)

    In that case I would suggest adding this at the end of your theme’s functions.php

    remove_filter('get_shortlink', 'wpme_get_shortlink_handler', 10, 4);
    add_filter('get_shortlink','tw_strip_www',10,1);
    function tw_strip_www($content){
    	$str = str_replace('http://www.','http://',$content);
    	$str = str_replace('https://www.','https://',$str);
    	return $str;
    }

    The first line disables the wp.org shortener and the rest removes the www.

    Plugin Author Tanin

    (@0xtc)

    I went ahead and added them both as options. It’ll be included in the next release.

    Thread Starter wprunner

    (@wprunner)

    Thank you 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: WP Tweet Button] Use WP local URLs (own domain)’ is closed to new replies.