Ecommerce Shopify WordPress Discussion

how to delete record using WP_List_Table in wordpress

Here is my code when i click on delete button page is reloed. data is not deleted . Can YOu help me? Here is my code when i click on delete button page is reloed. data is not deleted . Can YOu help me? class Job_List extends WP_List_Table { private $table_data; public function prepare_items() { $columns = $this->get_columns(); $hidden = []; $this->_column_headers = [$columns, $hidden]; $data = $this->get_data(); $per_page = 10; $current_page = $this->get_pagenum(); $total_items = count($data); $this->set_pagination_args([ 'total_items' => $total_items, 'per_page' => $per_page, ]); $data = array_slice($data, (($current_page - 1) * $per_page), $per_page); $this->items = $data; } public function process_bulk_action() { if ('delete' === $this->current_action()) { $id = absint($_GET['id']); global $wpdb; $table_name = $wpdb->prefix . 'applied_job_list'; $wpdb->delete($table_name, array('id' => $id), array('%d')); wp_redirect(admin_url('admin.php?page=' . $_GET['page'])); exit; } } public function get_bulk_actions() { $actions = array( 'delete' => 'Delete', ); return $actions; } private function get_data() { global $wpdb; $table_name = $wpdb->prefix . 'applied_job_list'; $results = $wpdb->get_results("SELECT * FROM {$table_name}", ARRAY_A); foreach ($results as &$result) { $experience = 'N/A'; if ($result['experience'] == 0) { $experience = 'Fresher'; } elseif ($result['experience'] == 1) { $experience = '1 Years'; } elseif ($result['experience'] == 2) { $experience = '2 Years'; } elseif ($result['experience'] == 3) { $experience = '3 Years'; } elseif ($result['experience'] == 4) { $experience = '4 Years'; } elseif ($result['experience'] == 5) { $experience = '5+ Years'; } $result['experience'] = $experience; $post_id = $result['post_id']; $post = get_post($post_id); $result['post_id'] = $post->post_title; // Change this line $locations = get_the_terms($post->ID, 'location'); foreach ($locations as $location) { if ($result['location'] == $location->term_id) { $result['location'] = $location->name; break; } } $jobTypes = get_the_terms($post->ID, 'job_type'); foreach ($jobTypes as $jobType) { if ($result['job_type'] == $jobType->term_id) { $result['job_type'] = $jobType->name; break; } } $result['applied_position'] = $post->post_title; $upload_dir = wp_upload_dir(); $file_url = $upload_dir['baseurl'] . '/resume/' . $result['resume']; $result['resume'] = '<a href="' . $file_url . '" download> Download </a>'; $result['action'] = '<a href="?page=' . $_GET['page'] . '&action=delete&id=' . $result['id'] . '" class="delete-link">Delete</a>'; } return $results; } } unction applied_job_application() { $jobListTable = new Job_List(); $jobListTable->prepare_items(); ?> <div class="wrap"> <h1 class="wp-heading-inline">Applied Jobs</h1> <form method="post" > <?php $jobListTable->display(); ?> </form> </div> <?php } when I clcik on deldete button page is relodede I can't see any error . but record is not deleted How can I delete recod and add pagination ?
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.