Home › Forums › General Issues › Exported PHP register_field_group location variables › Reply To: Exported PHP register_field_group location variables
This problem can be solved by doing this…
function pass_post_id_as_string() {
global $post;
$post_id = $post-> ID;
$post_id_as_string = (string)$post_id;
return $post_id_as_string;
}
add_action('wp_head', 'pass_post_id_as_string');
in the location part of the array (see above) set the value as the function.
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.