Thanks @acf-support !
You info let me to use REQUEST_URI instead 🙂
Referer did return the prev url when visiting, or nothing if directly visited.
Referer return:
http://www.domain.com/old_path/
Request return:
/current_real_path/
url_to_postid the return:
id: 48
id: 115 (correct)
Well, if any one finds a better way to do this, let us know here.
My solution to the problem:
* Start session on the page with included form in it.
* Set $_SESSION variable data with get_the_ID().
* In acf/pre_save_post start session, and sett field val with Session data.
ie. $_POST[‘acf’][‘field’] = $_SESSION[‘static_page_id’];
Hi, @acf-support thanx for quick answer.
Thats what I’ve done, but u can always edit values in html code, I need to set the ID in code, not from hidden input field, because you can always change value=”old” to value=”new”.
Somehow i need to get the page_id from the page that has acf_form included in it, and user cant be able to change it.
Is the only way to set like $_SESSION value and then when saving fetch it?