Example #1
0
/**
 * AJAX handler for removing users from a post for a given type
 */
function annowf_remove_user($type)
{
    check_ajax_referer('anno_manage_' . $type, '_ajax_nonce-manage-' . $type);
    $response['message'] = 'error';
    if (isset($_POST['user_id']) && isset($_POST['post_id'])) {
        if (anno_remove_user_from_post($type, absint($_POST['user_id']), absint($_POST['post_id']))) {
            $response['message'] = 'success';
        }
    }
    return $response;
}
Example #2
0
function annowf_remove_user_from_post($type, $user_id, $post_id)
{
    return anno_remove_user_from_post($type, $user_id, $post_id);
}