Discussion on Quick and easy Post creation for ACF Relationship Fields PRO

Bazalt

Bazalt supports this item

Supported

21 comments found.

I’m registering the fields and field groups via PHP instead of using the ACF interface. Do you have any documentation on how to enable the on-the-fly post creation on a field using PHP?

Simply specify ‘acf_relationship_create’ => 1, in your field declaration:
if( function_exists('acf_add_local_field_group') ):

acf_add_local_field_group(array (
    [...],
    'fields' => array (
        array (
            [...]
            'type' => 'relationship',
            'acf_relationship_create' => 1,
            [...]
        ),
    ),
    [...]
));
endif;
by
by
by
by
by
by