Thanks @hube2
Those are excellent suggestions and is exactly what I’m looking for. Thank you. I didn’t know about 1)!
@hube2 I don’t need to get the post ID of the new post only of the page the form is embedded in
Hi Dorn
Thanks for the question and follow up answer
I have a similar problem where I am trying to get the ID of the page containing the form. However, the form creates new posts so the post_id returns as 0. Has anyone found a way of retrieving.
I have tried
$post_id = $_POST['post_id'];
$url = 'https://' . $_SERVER[ 'HTTP_HOST' ] . $_SERVER[ 'REQUEST_URI' ];
$current_post_id = url_to_postid( $url );
get_queried_object_id()
global $post;
$post_id = $post->ID;
etc...
I have also tried adding additional parameters to the function but alas....
All return 0. Is what I’m attempting actually possible?
Thanks
Is it possible to apply conditional login if the form is being displayed on the front end (as opposed to the user admin page).
Essentially I need to change the Information field text depending on whether front end or backend (i.e. message to admin or message to user)
Hi
I’m interested by this thread as I have a related issue. I have created a front end ACF form that uses an ACF field group that allows users to update business details in their my-account pages. However, this is all stored in usermeta which doesn’t bode well when trying to output a listing of all business on a directory page as it is difficult to sort properly. I now want to separate this data from usermeta so I have created a CPT called Business Listings but how do I get this linked to ACF form on at a user level?
Thanks
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.