My function gets called twice even though I only call it once
-
I’ve been working on this for hours now and the usual answers don’t apply in my case.
I’ve created a shortcode in functions.php (of the theme) to return information for display, but the function also calls another method I’ve created which sends an email (by calling mail() internally). Users are receiving the email twice and the logs show the methods are getting called twice.
The page where the shortcode is used (once!) is https://auracolors.com/quiz-results/ and the URL is reached by a redirect that usually appends a key to specify which info to display. Either way, my method is still called and calls the email function.
I’ve tried running test code as suggested by the host here: https://support.rackspace.com/how-to/test-php-mail-functionality/
and *that* email only gets sent/received once, so I know it’s something on the site.Can anyone suggest how to proceed?
- The topic ‘My function gets called twice even though I only call it once’ is closed to new replies.