Taxonomy: Consider HTML5 input types when resetting form values after adding a new tag.

When adding a new tag, the form is reset by clearing values for `input[type=text]` and `textarea`s.  However, the reset doesn't account for any HTML5 input types, like `number` or `url`, that may be added by plugins or themes.

This change updates the form resetting jQuery to clear any values from `input` types that are not hidden and neither a `checkbox` nor `radio` type.

Props stevegrunwell.
Fixes #48030.

git-svn-id: https://develop.svn.wordpress.org/trunk@52953 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
David Baumwald 2022-03-18 20:10:43 +00:00
parent 735e913200
commit d35c8e8543

View File

@ -155,7 +155,7 @@ jQuery( function($) {
form.find( 'select#parent option:selected' ).after( '<option value="' + term.term_id + '">' + indent + term.name + '</option>' );
}
$('input[type="text"]:visible, textarea:visible', form).val('');
$('input:not([type="checkbox"]):not([type="radio"]):visible, textarea:visible', form).val('');
});
return false;