[wp-trac] [WordPress Trac] #14851: Add ¨searchform-{name}.php¨ support
WordPress Trac
wp-trac at lists.automattic.com
Tue Sep 14 16:25:02 UTC 2010
#14851: Add ¨searchform-{name}.php¨ support
-------------------------+--------------------------------------------------
Reporter: ramiy | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Template | Version: 3.1
Severity: normal | Keywords: need-patch
-------------------------+--------------------------------------------------
Comment(by ramiy):
The new '''get_search_form()''' should look like '''get_header()''',
'''get_footer()''' and '''get_sidebar()''' functions.
{{{
function get_search_form( $name = null ) {
do_action( 'get_search_form', $name );
$templates = array();
if ( isset($name) )
$templates[] = "searchform-{$name}.php";
$templates[] = "searchform.php";
// Backward compat code will be removed in a future release
if ('' == locate_template($templates, true))
load_template( ABSPATH . WPINC . '/theme-
compat/searchform.php');
}
}}}
And we need to add new file "wp-includes/theme-compat/searchform.php" for
backward compat:
{{{
<form role="search" method="get" id="searchform" action="<?php home_url(
'/' ); ?>">
<div><label class="screen-reader-text" for="s"><?php __('Search
for:'); ?></label>
<input type="text" value="<?php echo get_search_query(); ?>"
name="s" id="s" />
<input type="submit" id="searchsubmit" value="<?php
esc_attr__('Search'); ?>" />
</div>
</form>
}}}
that is it !
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14851#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list