How To Conditionally Include A Short Code Depending On The HTTP_REFERER

I want to show a form at the end of my purchase-confirmation page only in the case where the previous page / HTTP_REFERER is the checkout page. I’ve tried lots of different ideas.

For example, I was hoping the PHP Snippets would solve my problem. But it doesn’t appear to work at all with the newest version of WordPress.

Anyway, I need something like this:

Thank you for your purchase! [edd_receipt]

[insert_php]if( strpos($_SERVER[HTTP_REFERER], “checkout” ) == true ):[/insert_php]
[wpforms id=”123″]
[insert_php] endif; [/insert_php]

Ideas?

Read more here:: How To Conditionally Include A Short Code Depending On The HTTP_REFERER

Leave a Reply

Your email address will not be published. Required fields are marked *