When saving post, ensure that non-hierarchical taxonomy input is defined before attempting to parse it.
Taxonomy metaboxes that are disabled for the current user are included in the post.php markup, but do not contain the 'newtag' field, and so should be skipped when looping through the metaboxes to avoid invoking String methods on a variable of type `undefined`. Props MikeNGarrett, A5hleyRich. Fixes #30859. git-svn-id: https://develop.svn.wordpress.org/trunk@31895 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fed67453a1
commit
5d50b55c7e
@ -112,6 +112,11 @@ var tagBox, array_unique_noempty;
|
||||
a = a || false;
|
||||
|
||||
text = a ? $(a).text() : newtag.val();
|
||||
|
||||
if ( 'undefined' == typeof( text ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
tagsval = tags.val();
|
||||
newtags = tagsval ? tagsval + comma + text : text;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user