0

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?

<?php 
                acf_form(array(
                    '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'
                ));
            ?>
  • post_category need to be a array of categories ID even if there is only one category. – Kaperto Nov 8 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.