Well different plugins give different short URLs ?? Like I use Yourls, and my theme shows me the short URL.
However to add whatever WP thinks the short URL is to your toolbar, you need a function… I tested it briefly and it works. Make a file called my-shorturl.php
and put this in it:
<?php
/*
Plugin Name: Short URL Toolbar
Description: Show 'shortURL' in the toolbar bar.
Version: 1
Author: Me
*/
function show_short_url_toolbar ( $wp_admin_bar) {
global $wp_admin_bar;
if (is_singular() ) {
$short_url = wp_get_shortlink();
$wp_admin_bar->add_menu(array( 'id' => 'my-shorturl', 'title' => __('ShortURL'), 'href' => '#' ));
$wp_admin_bar->add_menu(array( 'id' => 'my-shorturl-slug', 'parent' => 'my-shorturl', 'title' => $short_url, 'href' => $short_url ));
}
}
add_action ('admin_bar_menu', 'show_short_url_toolbar', 90);
Then put that file in the mu-plugins folder on your server (if you don’t have one, make one, it’s the same level as your plugins and themes folders).