Advertisements

wp_admin_bar_search_menu

Definition:
function wp_admin_bar_search_menu( $wp_admin_bar ) {}

Add search form.

Parameters

  • $wp_admin_bar

Source code

function wp_admin_bar_search_menu( $wp_admin_bar ) {

	if ( is_admin() )

		return;



	$form  = '<form action="' . esc_url( home_url( '/' ) ) . '" method="get" id="adminbarsearch">';

	$form .= '<input class="adminbar-input" name="s" id="adminbar-search" tabindex="10" type="text" value="" maxlength="150" />';

	$form .= '<input type="submit" class="adminbar-button" value="' . __('Search') . '"/>';

	$form .= '</form>';



	$wp_admin_bar->add_menu( array(

		'parent' => 'top-secondary',

		'id'     => 'search',

		'title'  => $form,

		'meta'   => array(

			'class'    => 'admin-bar-search',

			'tabindex' => -1,

		)

	) );

}

17414

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: