New home › Forums › Visitor Generated Markers › Troubleshooting › Redirect after Marker submission
Tagged: redirect vgm
- This topic has 6 replies, 3 voices, and was last updated 3 weeks ago by Matthew.
-
AuthorPosts
-
May 25, 2022 at 12:12 pm #73189janoschasenParticipant
Hello,
after a VGM is submitted there happens a redirect to this page: /wp-admin/admin-post.php instead of a reload.
Did i set up something incorrectly or is there a current bug?Best regards,
JanoschMay 25, 2022 at 12:13 pm #73190janoschasenParticipantThis reply has been marked as private.May 27, 2022 at 10:44 am #73211MatthewModeratorHi Janosch,
Thank you for getting in touch with us, we do appreciate your time.
Thank you for the link, thus I have debugged this issue accordingly and found the cause of the issue.
It appears that we called a WordPress function called
wp_safe_redirect()
after the marker has been added/submitted, however it appears that WordPress now does not automatically exit after the function is called, thus requires theexit()
function to be called manually directly afterwards.With that said, please may I ask if you would be able to follow the steps below to edit the core code of the VGM Add-on:
1. Navigate to Plugins -> Plugin File Editor.
2. Select the “WP Google Maps – Visitor Generated Markers Add-on” in the top-right select dropdown.
3. Click the “Select” button.
4. Ensure that the ‘wp-google-maps-ugm.php’ file is selected in the “Plugin Files” navigator on the right-side panel.
5. Scroll down to around line 1082 whereby you should find the ‘wp_safe_redirect()’ function.
6. Add a new line with the following code:exit();
7. Click the “Update File” button.The new code section should appear like this:
// Redirect to this page. wp_safe_redirect($_POST['redirect_to']); exit();
Once this has been done, please may you confirm if the issue has been resolved?
Should you not be comfortable in making these changes, please may I ask if you may reply in a private reply and provide me with your email address so that I may reach out to you directly regarding this?
I look forward to hearing back from you.
Kindest Regards,
MatthewMay 27, 2022 at 8:47 pm #73220janoschasenParticipantHi Matthew,
thanks for the quick answer. The Exit-Function works like a charm!
(the redirect was at line 1058 here – if someone doesn’t find ist search for the “wp_safe_redirect”)Best regards and thx a lot
JanoschMay 30, 2022 at 10:28 am #73225MatthewModeratorHi Janosch,
Thank you for getting back to me and most valued time, I tremendously appreciate it!
I am most happy to hear that issue has been resolved, and it was my great pleasure assisting you with this.
Please may you kindly consider reviewing our plugin at https://wordpress.org/support/plugin/wp-google-maps/reviews/#new-post?
It would really mean the world to me! And if possible, please could I kindly ask you to mention both your name and mine in the review for administrative purposes as this would be a tremendous help?
Should you ever require any further assistance, I am more than happy to help.
Have a fantastic day further!
Kindest Regards,
MatthewJune 11, 2022 at 11:45 pm #73306retailsmarterParticipantThanks so much for posting this fix! The same error is happening on the demo page (https://www.wpgmaps.com/demo/visitor-generated-markers/), FYI. I’m sure you’ll get it sorted and updated soon, but just wanted to add my +1 for help fixing this bug. Thanks for the awesome plugin!
June 14, 2022 at 7:02 am #73316MatthewModeratorHi @retailsmarter,
Thank you for reporting this for our demo and we are happy to hear that this fix has helped you on your site as well.
Have a great day further!
Kindest Regards,
Matthew -
AuthorPosts
- You must be logged in to reply to this topic.