Bail from AJAX success callback if wp_ajax_add_tag() returns errors. Props solarissmoke. Fixes #20086.

git-svn-id: https://develop.svn.wordpress.org/trunk@20086 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jon Cave 2012-03-02 21:01:51 +00:00
parent 762b3bc702
commit b80111d67c
1 changed files with 2 additions and 2 deletions

View File

@ -33,9 +33,9 @@ jQuery(document).ready(function($) {
return false;
$.post(ajaxurl, $('#addtag').serialize(), function(r){
$('#ajax-response').empty();
$('#ajax-response').empty();
var res = wpAjax.parseAjaxResponse(r, 'ajax-response');
if ( ! res )
if ( ! res || res.errors )
return;
var parent = form.find('select#parent').val();