I felt same problem earlier and used this hackish to prevent calling hidden callback in some cases. hope it will help you
function close_modal_without_callback() {
$('#myModal').off('hidden.bs.modal');//`off` to remove event handler attached with `on`
$('#myModal').modal('hide'); // hide modal
setTimeout(function() { //to add little delay to reattach the event
$('#myModal').on('hidden.bs.modal', function(e) {
hidden_handler(); //handler function
});
}, 1000);
}