Make WordPress Core


Ignore:
Timestamp:
01/11/2011 10:45:14 PM (14 years ago)
Author:
ryan
Message:

Expand shortlink menu when clicked. Fix displayed of shortlinks when rel shortlink is missing. Props koopersmith. fixes #16155

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/admin-bar.php

    r17234 r17263  
    140140
    141141    $short = wp_get_shortlink( 0, 'query' );
    142 
    143     if ( ! empty( $short) )
    144         $wp_admin_bar->add_menu( array( 'id' => 'get-shortlink', 'title' => __( 'Shortlink' ), 'href' => $short ) );
     142    $id = 'get-shortlink';
     143
     144    if ( empty( $short ) )
     145        return;
     146   
     147    $html = '<input class="shortlink-input" type="text" readonly="readonly" value="' . esc_attr( $short ) . '" />';
     148   
     149    $wp_admin_bar->add_menu( array(
     150        'id' => $id,
     151        'title' => __( 'Shortlink' ),
     152        'href' => $short,
     153        'meta' => array( 'html' => $html ),
     154    ) );
    145155}
    146156
Note: See TracChangeset for help on using the changeset viewer.