Opened 8 years ago
Last modified 6 years ago
#38424 new defect (bug)
Custom form taxonomy field doesn't clear after added...
Reported by: | SGr33n | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | Cc: |
Description
Hi,
I was adding a new taxonomy field via the action {$taxonomy}_add_form_fields.
Anyway if the input type is 'url', after added the new taxonomy the form field doesn't clear itself, and in the url field will remain the inserted value.
This doesn't happen if the input type = text.
Thanks.
Attachments (4)
Change History (9)
#1
@
8 years ago
- Keywords has-patch 2nd-opinion added
- Milestone changed from Awaiting Review to Future Release
#2
@
8 years ago
Thanks, I also added number, email and tel, that also should be harmless. Anyway, since atm I don't have svn, I modified your patch via text editor, I hope it works.
#4
@
7 years ago
- Keywords 2nd-opinion removed
- Version changed from 4.7 to 2.9
Not sure why the current code checks also for :visible
; what about just resetting the form? E.g.:
form[0].reset()
- any field within the form would be reset, even the custom ones added via filters
- this would also preserve radio buttons and checkboxes that may set their own default values
Note: See
TracTickets for help on using
tickets.
The JS has targeted
type="text"
only since [11676]. https://core.trac.wordpress.org/browser/tags/4.6.1/src/wp-admin/js/tags.js?marks=66#L66I don't think we can drop
input
because it has the potential to mess with radio buttons and checkboxes that may set their own default values. Addingtype="url"
to the selector seems harmless, though. See 38424.diff.Anyone see a problem with this?