Exemple #1
0
                    $msg = "Can't delete item(s) because it contains one or more item(s)";
                    set_alert($type, $msg);
                } else {
                    $_update->delete_category($post_cat_id);
                    $page = 'self';
                    $type = 'success';
                    $msg = "Item(s) has been successfully removed";
                    set_alert($type, $msg);
                }
            }
        } else {
            if ($action == 'visibility') {
                foreach ($cat_id as $post_cat_id) {
                    $post_cat_id = filter_var($post_cat_id, FILTER_SANITIZE_NUMBER_INT);
                    if ($option == 'yes') {
                        $_update->update_category_visibility(1, $post_cat_id);
                    } else {
                        if ($option == 'no') {
                            $_update->update_category_visibility(0, $post_cat_id);
                        }
                    }
                    $page = 'self';
                    $type = 'success';
                    $msg = "Changes has been saved";
                    set_alert($type, $msg);
                }
            }
        }
        safe_redirect($page);
    }
}