Home › Forums › Gutenberg › How to get the id of the current page while in edit mode? › Reply To: How to get the id of the current page while in edit mode?
There isn’t anything in ACF that I know of, and most of the things you can do could also be considered “hokey”
you can try
global $post;
echo $post->post_title;
you can also try looking that the query string
echo get_the_title($_GET['post']);
You may also be able to use
$post = get_queried_object();
I’m not exactly sure which, if any, of the above will work with what you’re trying to do.
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.