admin管理员组

文章数量:1427650

I'm trying to design a form that creates a post, with the help of Advanced Custom Fields (ACF).

The post has a custom post type of 'movie' and has custom fields of type 'relationship' that link to other posts of type 'genre'.

I use this code for the form

<?php
acf_form_head();
?>


<?php
acf_form(array(
    'post_id' => 'new_post',
    'post_title' => true,
    'new_post' => array(
    'post_type' => 'movie',
    'post_status' => 'publish'
    ),
    'submit_value' => 'Create a new movie'
));
?>

which makes a form like this

but 'the Movie Genre' field isn't working, Thanks in advance for your time any help or suggestions are much appreciated.

I'm trying to design a form that creates a post, with the help of Advanced Custom Fields (ACF).

The post has a custom post type of 'movie' and has custom fields of type 'relationship' that link to other posts of type 'genre'.

I use this code for the form

<?php
acf_form_head();
?>


<?php
acf_form(array(
    'post_id' => 'new_post',
    'post_title' => true,
    'new_post' => array(
    'post_type' => 'movie',
    'post_status' => 'publish'
    ),
    'submit_value' => 'Create a new movie'
));
?>

which makes a form like this

but 'the Movie Genre' field isn't working, Thanks in advance for your time any help or suggestions are much appreciated.

Share Improve this question asked May 5, 2019 at 14:16 Ds RedDs Red 12 bronze badges 1
  • Can you clarify "'the Movie Genre' field isn't working"? – nmr Commented May 17, 2019 at 7:27
Add a comment  | 

1 Answer 1

Reset to default 0

If the values do not load there is either an error in JavaScript or an error in PHP during hte AJAX request.

JavaScript errors are usually caused by plugin conflicts. To begin debugging this start disabling other plugins to see if you can clear it up.

PHP errors during AJAX can be found by enabling error logging https://codex.wordpress/WP_DEBUG

本文标签: pluginsCreating posts with acfform() that has a relationship type field