Understand hierarchy, You don’t need to redirect as form are posting values on same page.
function process_bulk_action() {
// Some security check code here
// Get the bulk action
$action = $this->current_action();
if ($action == 'bulk_trash') {
// Code for the "delete process"
$delete_ids = esc_sql($_POST['bulk-delete']);
//loop over the array of record ids
foreach($delete_ids as $id) {
self::delete_item($id);
}
// show admin notice
echo '<div class="notice notice-success is-dismissible"><p>Bulk Deleted..</p></div>';
}
}
another method is prepare_items
public function prepare_items() {
// first check for action
$this->process_bulk_action();
// then code to render your view.
}
Related Posts:
- Why is wp_redirect() preferable to a standard PHP header redirect?
- Headers already sent – WordPress core
- Perform a redirect after user action
- header and wp_redirect not working. cannot modify header information warning
- How do I redirect the browser to 404 page, if no posts are found in home page
- wp_redirect() doesn’t work
- wp_redirect() function is not working
- Redirect page URL to home URL without using a plugin
- WordPress HTTPS redirect loop
- Password change when the user login first time
- Stop unwanted WP redirection to new url
- wp-login.php — redirect logged in users to custom URL
- Redirect to “All Posts” after post update or publish in Block Editor
- Redirect user after login/registration globally
- Redirecting old site links to new site
- Redirect to login page
- Temporary redirect prevents getting $_POST array
- I want to redirect the url to the previous page
- Creating intro page in wordpress
- How to redirect only if page doesn’t exists
- How To Only Allow Users To View Their Own Buddypress Profiles? [closed]
- Disabling the X-Redirect-By response header
- How to auto login after registration? [duplicate]
- Code to create a redirection after login?
- How do I redirect /search/ to ?s=
- WordPress Global Redirect
- Why does wp_redirect strip out %0A (url encoded new line character) and how do I make it stop?
- How to redirect to home page after registration?
- Redirect the non-www version of the site to the www
- Redirect Logged In User if page is wp-login.php and $_Get[‘level’] = X
- WordPress Redirect Not Working – AJAX Callback Response Not Picked Up
- How to use Regex to add to a url?
- Redirect first category archive page to normal page
- Stuck In a Redirect Loop
- How to set 301 redirection after moving WordPress blog?
- Adding rewrite rule dynamically for search results redirecting to 404 URL
- Force WordPress to load from site’s hostname
- How to redirect if a background request is still being executed
- How To Redirect /url.html to /url?
- I get redirected too many times only in wp-admin?
- How can i resolve 301 redirection Issue on my website?
- Redirect user to previous page after signup from custom form
- Get query parameters from external url and make a redirection
- wordpress_redirect returns different headers for HEAD and GET requests
- Remove #wpcf7-f2450-o1 with Contact form 7 redirect [closed]
- How to pass a message using template_redirect
- Show different page for first time user
- Redirect outside WP after login
- HTML Redirect to WP pages
- Why does the $_GET parameter ?search forward the front-page to the archive/blog page
- store URL global before we redirect
- wp_redirect () doesn’t work in nginx?
- Redirect Attachment Page to Attachment
- How to redirect from one WP site to another
- WP_List_table with form of method=GET redirects to wrong url after submit
- How do I write a subdomain redirect?
- Is this a correct usage of ob_start() in my WordPress project?
- How to fix automatic redirects?
- Create header.php redirect in WordPress and with WPML
- Redirect User to login page
- Missing domain http://./wp-… in redirects
- Redirecting simple big problem
- Date based redirects of posts that no longer exist
- Redirect Page ID, based on logged-in User Role
- How to redirect a child page to its parent page?
- Bulk redirect all post
- WordPress multi domain: page redirect to main domain whenever WordPress do the URL guessing issue
- Applying ‘middleware’ to a url before redirecting? Does WP have built in mechanism for this?
- How can I prevent caching of wp_redirect?
- Debugging issue with redirection in WordPress
- Add base folder to CPT and 301
- How do redirect user back to previous page when on certain pages?
- Keep the old referrer after failed login
- Re-Direct ALL Users to the Home Page IF not logged in
- How to redirect if 404 error in wordpress then redirect 404.php url
- Redirect to dashboard user once you click on Publish page
- ERR_TOO_MANY_REDIRECTS when switching from good database to old database
- Redirect to /404/
- Redirect Category Media ‘URL’ when clicked
- How to automatically redirect category pages (301) when changing the location of a category in the hierarchy
- wordpress automatic URL ‘page’ parameter rewrite
- Make custom post type archive for administrator only
- How to 301 redirect sub domain post URL to root domain
- Why https://www. SUBdomain is redirected by WP to https://MAINdomain
- Redirect not work
- wp_redirect leading to an infinite loop
- How to redirect new registrars to a custom registration page instead of WP default registration page?
- redirect after account activation for forum using bbpress and buddypress
- using wp_rewrite but keep the original url in the address bar
- How to redirect 404s that generated for css&JS files?
- Force SSL on a single page which is used as iFrame
- Redirect based on $_GET parameters
- Headers already sent error after upgrading wordpress to 4.2.2
- noheader on the user/frontend side
- Redirect to a subdirectory frontpage using without using a WP plugin- what files to edit, and how?
- problem redirecting users to page on login
- Create a 301 Redirect automatically when adding %category% in the permalink
- Other pages fine but wp-admin showing ERR_TOO_MANY_REDIRECTS Error
- Forcing header cache control in 404 pages
- Post Migration Site Migration Redirects All Known Solutions Attempted