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

git-svn-id: http://svn.automattic.com/wordpress/trunk@20086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
duck_ 2012-03-02 21:01:51 +00:00
parent 1729a14278
commit 50fea9b10f

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();