Closed michaelw85 closed 1 month ago
$_POST['postId']
is not defined and even if defined it's not fallback for [_url]
.
Sorry, I just noticed the post ID is coming from custom code in my WP setup. I assumed it was there by default. 🤦 I should use a clean WP setup for this kind of work.
Do you agree that the code needs to be refactored to not rely on $_SERVER['HTTP_REFERER']
? It is not something we should rely on but would rather be something for a fallback in my opinion.
I know HTTP_REFERER
is not reliable and look for alternatives.
When you run your website on a server with a referrer policy set to no-referrer special mail tag
_url
will return the ajax url, which I believe will never be useful for an admin. I've added a fallback for this scenario to use the post url instead.Issue mentioned by other users: https://wordpress.org/support/topic/special-mail-tag-_url-returns-wrong-url/