Pregunta

I'm using advanced custom fields plugin for front end post with acf_form() passing $args. This is the form, there is another part in functions.php where we initialize wp_insert_post().

    <?php 

    $args = array(
        'post_id' => 'new',
        'field_groups' => array(1, 2, 3, 4)
    );

    acf_form( $args ); 

    ?>

</div><!-- #content -->

I have a field group named 'Details'. My question is, how to pass data or field to that arguments ('fields_group' => array()) for displaying the fields? I know this is pretty basic, but i'm stuck.

¿Fue útil?

Solución

Check your field group URL. It looks like: ../wp-admin/post.php?post=2309&action=edit

2309 is what you need.

So change your code to:

$args = array(
    'post_id' => 'new',
    'field_groups' => array(2309)
);

Good luck!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top