Home › Forums › ACF PRO › Add field programmatically to group › Reply To: Add field programmatically to group
Hi @timm
I believe that’s because the new_post
attributes have the wrong values. Could you please debug them like the following?
echo "POST['type']:\n";
var_dump($_POST['type']);
echo "\npost_status:\n";
var_dump($post_status);
Also, could you please set them manually like this:
'new_post' => array(
'post_type' => 'book',
'post_status' => 'published'
),
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.