In the WordPress build for our company, there is a need to transfer data when previewing a page. To streamline this process, my boss wants to override the default functionality of the preview button by opening a new tab and passing the necessary data through a POST request.
However, I am facing challenges in figuring out how to achieve this and whether it is even possible. Using AJAX is not an option as the data needs to be passed to the new page, leaving me unsure of other solutions.
My current workaround involves dynamically creating a hidden form on the post edit page, which I can populate and submit via JavaScript when the preview button is clicked. However, this method seems unconventional and I am uncertain if it is possible to submit a form to a new tab.
I would greatly appreciate any advice on how to effectively handle this situation.