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?
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.
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.