// Handle bulk delete action if (isset($_POST['action']) && $_POST['action'] === 'delete' && !empty($_POST['pfqt_selected'])) { $selected_indexes = array_map('intval', $_POST['pfqt_selected']); $questions = get_option('product_faq_questions', []); foreach ($selected_indexes as $index) { if (isset($questions[$index])) { unset($questions[$index]); } } update_option('product_faq_questions', array_values($questions)); // reindex echo '
Selected questions deleted.