There are two more possible ways
-
Use the browser’s history API to manipulate the URL displayed at the address bar/ history.
-
Use AJAX
Redirection is the best solution for 100% browser support and it is probably the easiest to implement. You don’t need to use any hook with that just do the processing without generating output and then redirect back to the page. Something like
if (isset($GET['posttodelete'])) {
delete post
wp_redirect(utl with 'posttodelete' stripped out of it);
} else
normal loop;
But your users might prefer the AJAX solution which requires much more coding but gives the best user experience.
Related Posts:
- Using action hooks inside of a shortcode
- Redirect users on specific post category or category page
- Enclosing Shortcode Within Another Enclosing Shortcode Breaks Output Functionality
- How can I collect and output all attributes of all executed ShortCodes?
- A good hook to check authorization and redirect?
- Which hook should be used to add an action containing a redirect?
- Redirect function inside a Shortcode
- Why are you using add_action for shortcode?
- How can I put a wp_redirect into a shortcode?
- Redirect logged in users if they are on a specific page
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- after login that will redirect user role into a page
- Pros and cons of actions over shortcodes
- template_redirect to accompany with a shortcode
- manipulate a plugins shortcode
- Print shortcode in custom action hook not where the shortcode is entered
- wp_redirect() not working on form submission with init hook
- Remove and restore one shortcode
- Firing a function AFTER redirect
- passing parameters to do action from shortcode to wp_footer
- Convert HTML Script to Shortcode [closed]
- How to redirect if a background request is still being executed
- Login form from shortcode doesn’t redirect after successful login
- How to wp_redirect on ‘init’ hook on condition of current post id?
- WordPress redirect redirecting too many times or not at all
- Redirect no product url’s to static url
- Use another action instead of the shortcode API to display the last time a user logged in
- redirect if shortcode exists
- Modifying the wordpress login page and then referencing it with a shortcode problem
- What hook to use to redirect based on $post
- contact form 7 :create shortcode usable in email message [closed]
- Set redirect for need login
- ‘Conflict’ with action deleted_post and is_admin()
- How to create shortcode for auto login after registration
- Members only Passthrough
- Add an access code form to call a unique page based on page without registration
- Cannot modify header information – headers already sent
- Hook into existing shortcodes to manipulate the attributes?
- WordPress Multisite: Adding actions to only one site
- Run javascript code after wp_login hook?
- Get all posts containing a shortcode
- Videos via the video shortcode are always 640px wide?
- How to: How do I make my own shortcodes without plugins?
- How to get post ID in post_updated action hook?
- Create a shortcode in WordPress, again
- gutenberg widget outputting paragraph marks
- Is there a Woocommerce hook that fires when applying a coupon but before checking if it’s valid?
- How to make shortcode output display where I choose
- How to get total number of shortcodes in the wordpress application?
- How do I redirect /search/ to ?s=
- WordPress display image link in shortcode
- Remove action from shortcode
- stop shortcode stripping in category and archive pages
- How does one insert a variable value into a “myCRED plugin shortcode [closed]
- Hooking into the init action will fire it too frequently?
- Nested Code Snippets [closed]
- How do I display “Hello username” if logged-in on the homepage
- Adding a Cookie Session to Shortcode Content
- Calling plugin function inside custom plugin for onclick event
- Shortcode function executed twice?
- add widget to page content (using shortcode)
- Pagination for a page created by the shortcode “Product”
- How to pass variables to custom filter from multiple functions
- wp_editor in thickbox
- Placing tags on wordpress visual editor using shortcodes
- Default Attributes in Shortcode Not Working
- Replacement for gallery_shortcode function not taking all attributes
- WooCommerce: after install hook
- how can i pass this attribute in this shortcode?
- Display a form partially with a shortcode
- Changing where my author box is printed
- What is the action hook to use if you want to capture the new password during password change?
- How to create a custom shortcode for custom login form?
- Need to return shortcode text instead of the output
- Image Caption Shortcode Broken upon update
- update_option_{$option} not working (do function after options are saved)
- Shortcode not working in CPT taxonomy
- To know whether insert shortcode in custom meta box
- Shortcodes not working in custom page
- Get label in user meta query
- remove_action – pre_get_posts – does not restore original query
- Check get_post value after wp-admin login
- How to fix transparency in product sliders / featured products on home page?
- Short code format for cat tagging when posting from email
- Check if redirected from a specific page template
- Problem in creating a shortcode form custom post type slider
- What is the best way to include a template file within a shortcode?
- Shortcode templates
- Create plugin/function to catch XML-data via Shortcode
- Why My slider shortcode display above header
- Does anyone recognize shortcode ig_special_heading?
- How to scroll to a shortcode-generated anchor
- Shortcode conversion to hrml when post is published
- Shotcode error on functions
- add_action failed to display function by a plugin
- Shortcode for displaying the user’s first name?
- Can I prevent wordpress adding and tags to autoembeds
- Shortcode – Display inline icon before text [closed]
- Why does my shortcode query not working with search term
- Sidebar inside page conten