Opened 18 years ago
Closed 18 years ago
#5567 closed enhancement (fixed)
Search widget doesn't use searchform.php
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 2.6 | Priority: | normal |
| Severity: | normal | Version: | 2.3.2 |
| Component: | Template | Keywords: | search widget has-patch tested |
| Focuses: | Cc: |
Description
The search widget doesn't use rthe standard searchform.php
I've found two tickets about the search widget, but none of them suggests the most logical solution to the probnlem, namely to make the widget use searchform.php.
It might be that this is a conscious choice because not all themes have a searchform.php. But then it would be logical to make it an option on the search widget option button (use searchform.php: tickbox).
Attachments (4)
Change History (22)
#6
@
18 years ago
- Keywords tested added; needs-testing removed
- Milestone changed from 2.6 to 2.5
Works fine for me, both with a theme's searchform.php and with the default one when the theme has no searchform.php file.
#7
@
18 years ago
- Owner changed from DerFichtl to ionfish
Attached an improved patch which doesn't reveal the origin of the search form publicly and has more WordPressy syntax.
#8
@
18 years ago
+1 to this, however it would be nice if the default search box had an id of "searchsubmit" on the submit button.
<input type="submit" id="searchsubmit" value="<?php echo attribute_escape(__('Search')); ?>" />
This is in line with the existing searchform.php file in the default theme, and makes styling of the submit button possible.
#9
@
18 years ago
Sorry Otto, I'm not sure I follow. The patch makes the search widget use either the theme's searchform.php or the default theme's searchform.php if the theme doesn't have one. If the default theme's searchform.php has an id of "searchsubmit" then search widgets will get that simply in virtue of them using the same source file.
#10
@
18 years ago
- Status changed from new to assigned
Any more comments or a chance of getting this in for 2.5?
#12
@
18 years ago
- Milestone changed from 2.6 to 2.5.2
Any chance of this getting into 2.5.2 already?
#14
follow-up:
↓ 15
@
18 years ago
It's not uncommon for people to delete the default theme. If the current theme doesn't supply a search form, let's just emit one and forgo looking at the default theme.
#15
in reply to:
↑ 14
@
18 years ago
Replying to ryan:
It's not uncommon for people to delete the default theme. If the current theme doesn't supply a search form, let's just emit one and forgo looking at the default theme.
There's several places in the core code where it looks at the default theme for stuff like this. I refer you to get_header, get_footer, get_sidebar...
We often say on the support forums that deleting the default theme is not recommended because of that fact.
And quite frankly, I think that it *is* uncommon for people to delete the default theme.
So I'm going to go with leaving it to look for one in the default theme directory, because of all those reasons.
#16
@
18 years ago
With the advent of WP_CONTENT_DIR, it will become more common. I don't have the default theme in my WP_CONTENT_DIR.
get_header() and friends have the advantage that a theme almost never calls them if it doesn't also supply the corresponding files. The same cannot be said for a widget.
+1
The default theme has a searchform.php which the widget should default to if the current theme has no searchform.php file.