Don't show a shortlink button if we don't have one. See #14772.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2010-10-29 13:58:14 +00:00
parent c6491e5db4
commit a532e1d86d
1 changed files with 4 additions and 2 deletions

View File

@ -169,8 +169,10 @@ function wp_admin_bar_blog_separator() {
*/
function wp_admin_bar_bloginfo_menu() {
global $wp_admin_bar;
$wp_admin_bar->add_menu( array( 'id' => 'get-shortlink', 'title' => __( 'Get Shortlink' ), 'href' => '', ) );
$short = wp_get_shortlink( 0, 'query' );
if ( ! empty( $short) )
$wp_admin_bar->add_menu( array( 'id' => 'get-shortlink', 'title' => __( 'Get Shortlink' ), 'href' => '', ) );
}
/**