I'm using ACF fields and I'm creating a new post, when I try and add the new post to a category it creates a page tag instead any ideas?

                    'post_id' => 'new_post',
                    'field_groups' => array(92), // Used ID of the field groups here.
                    'form' => true,
                    'new_post' => array(
                        'post_status' => 'private',
                        'post_type' => 'post',
                        'post_title' => $_POST["acf"]['field_5d4ee1249329f'],
                        'post_engine_number' => $_POST["acf"]['field_5d500098b573a'],
                        'post_category'  =>  $_POST["acf"]['field_5d4ee1249329f']
                    'return' => '%post_url%',
                    'submit_value' => 'Submit'
  • 1
    post_category need to be a array of categories ID even if there is only one category. – Kaperto Nov 8 '19 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.