Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#19152 closed defect (bug) (fixed)

Remove/fix ToDo in wp_admin_bar_search_menu()

Reported by: ocean90's profile ocean90 Owned by: azaozz's profile azaozz
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.3
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

function wp_admin_bar_search_menu( $wp_admin_bar ) {
	$form  = '<div id="adminbarsearch-wrap">';
	$form .= '<form action="' . home_url() . '" method="get" id="adminbarsearch">';
	$form .= '<input class="adminbar-input" name="s" id="adminbar-search"';
	$form .= 'type="text" value="" maxlength="150" placeholder="' . esc_attr__( 'Search' ) . '" />';
	$form .= '<input type="submit" class="adminbar-button" value="' . __('Search') . '"/>';
	$form .= '</form>';
	$form .= '</div>';

	$wp_admin_bar->add_menu( array(
		'id'    => 'search',
		'title' => $form,
		'href'  => '#',
		'meta'  => array(
			'class'   => 'admin-bar-search',
			// @TODO: Replace me with something far less hacky
			'onclick' => 'if ( event.target.value != "Search" ) { return false; }',
		),
	) );
}

Seems like the onclick thing isn't needed anymore. Patch will remove it.

Attachments (1)

19152.patch (494 bytes) - added by ocean90 13 years ago.

Download all attachments as: .zip

Change History (2)

@ocean90
13 years ago

#1 @azaozz
13 years ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In [19159]:

Do the ToDo in wp_admin_bar_search_menu(), props ocean90, fixes #19152

Note: See TracTickets for help on using tickets.