Created
June 7, 2022 11:57
-
-
Save runezero/84cc684923214d84844840ea24404282 to your computer and use it in GitHub Desktop.
[Get referrer url] Get the referrer url and previous page id from the current page parameters #wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //get the referrer url | |
| wp_get_referer() | |
| //get the post_id from the referrer url | |
| url_to_postid(wp_get_referer()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment