Advertisements

wp_admin_bar_shortlink_menu

Definition:
function wp_admin_bar_shortlink_menu( $wp_admin_bar ) {}

Provide a shortlink.

Parameters

  • $wp_admin_bar

Source code

function wp_admin_bar_shortlink_menu( $wp_admin_bar ) {

	$short = wp_get_shortlink( 0, 'query' );

	$id = 'get-shortlink';



	if ( empty( $short ) )

		return;



	$html = '<input class="shortlink-input" type="text" readonly="readonly" value="' . esc_attr( $short ) . '" />';



	$wp_admin_bar->add_menu( array(

		'id' => $id,

		'title' => __( 'Shortlink' ),

		'href' => $short,

		'meta' => array( 'html' => $html ),

	) );

}

10593

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: