function anno_tinymce_reference_delete() { check_ajax_referer('anno_delete_reference', '_ajax_nonce-delete-reference'); $response = array('result' => 'error', 'refTotal' => 0); if (anno_delete_reference($_POST['post_id'], $_POST['ref_id'])) { $response['result'] = 'success'; $references = get_post_meta(absint($_POST['post_id']), '_anno_references', true); $response['refTotal'] = count($references); } echo json_encode($response); die; }
function anno_tinymce_reference_delete() { check_ajax_referer('anno_delete_reference', '_ajax_nonce-delete-reference'); echo json_encode(anno_delete_reference($_POST['post_id'], $_POST['ref_id'])); die; }