Redirect from within a validation?
-
I’m using the validation hook to process a button input that sets a global to determine if the current page tab is shown or hidden. As you might imagine, once the tab is hidden (programmatically not created based on the global) and the browser attempts to return to that page, a “you don’t have permission for this page” error is displayed.
I tried putting a wp_redirect inside the validation function and I also tried doing it in the logic that determines whether or not to display the tab. In both cases, the redirect doesn’t happen and I get the “don’t have permission” error.
Is there a way, as a result of a validation or inside a validation hook, to redirect the user to a different URL? Thanks!
–David
P.S. The purpose of this is to allow users to hide tabs they don’t need anymore. It’s a legacy migration and some tabs are just no longer needed once they’ve completed the migration.
- The topic ‘Redirect from within a validation?’ is closed to new replies.