Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#21342 closed enhancement (wontfix)

The admin bar search form is lacking the get_search_form filter

Reported by: chouby's profile Chouby Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.1
Component: Toolbar Keywords:
Focuses: Cc:

Description

The correction is obvious. Just add :
$form = apply_filters('get_search_form', $form);
at line 641 of wp-includes/admin-bar.php

Change History (3)

#1 @SergeyBiryukov
12 years ago

  • Component changed from General to Toolbar
  • Keywords has-patch removed

Since that form is not returned by get_search_form() function, not sure if it's a good idea to use the same filter.

#2 @ocean90
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

get_search_form is for get_search_form() which is reserved for themes and not for the toolbar.


If you want to replace the search from you can remove the existing with

remove_action( 'admin_bar_menu', 'wp_admin_bar_search_menu', 4 );

and then add you can add your own with

add_action( 'admin_bar_menu', 'your_custom_callback_function', 4 );

#3 @Chouby
12 years ago

I understand your point, even if it's not easy for plugin programmers to modify the 3 kinds of search forms provided (searchform.php, get_search_form and the toolbar)... Thank you for your suggestion. I will look at this.

Note: See TracTickets for help on using tickets.