WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#7910 closed defect (bug) (fixed)

Search form should be a template tag

Reported by: technosailor Owned by: technosailor
Milestone: 2.7 Priority: normal
Severity: normal Version:
Component: General Keywords: search template-tag
Focuses: Cc:

Description

The search form rarely changes from theme to theme, so it would be useful for theme developers to simply have a template tag get_search() similar to get_sidebar(), get_header() and get_footer() for use in themes.

This will also serve to standardize some of the annoying nuances of themes. In this patch, the function to display the form is supplied with a filter get_searchform which would allow plugin authors to modify the searchform or theme developers to bundle a more integrated search via the themes functions.php.

Attachments (5)

get_search_tag.diff (2.3 KB) - added by technosailor 6 years ago.
get_search_tag.2.diff (2.3 KB) - added by technosailor 6 years ago.
change to get_search_form to avoid possible collision of function names with query
get_search_tag-theme.diff (614 bytes) - added by technosailor 6 years ago.
Updates default theme to use new tag
get_search_tag.3.diff (5.5 KB) - added by technosailor 6 years ago.
Unified patch wrapping in all patch updates
get_search_tag.4.diff (4.7 KB) - added by technosailor 6 years ago.
Unified patch wrapping in all patch updates

Download all attachments as: .zip

Change History (7)

@technosailor6 years ago

change to get_search_form to avoid possible collision of function names with query

@technosailor6 years ago

Updates default theme to use new tag

@technosailor6 years ago

Unified patch wrapping in all patch updates

@technosailor6 years ago

Unified patch wrapping in all patch updates

comment:1 @ryan6 years ago

  • Milestone changed from 2.8 to 2.7

comment:2 @ryan6 years ago

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

(In [9234]) get_search_form from technosailor. fixes #7910

Note: See TracTickets for help on using tickets.