Filling ACF fields from frontend form

Hi folks! I’ve just arrived to Bricks (love it!) and have not many dev skills… :smiling_face_with_tear:

I’m working on a website with a CPT with its custom fields. I was wondering if it’s any way to add new posts into this CPT througth a frontend form, without must be logged.

Not sure if it’s a good practice, but clients are clients and them require it as told.

Haven’t find any thread that help me, would you mind? Any chance to do this? Thanks in advance.

Hi

actually ACF Pro has a standard functionality for this:

I added a similar code into a Bricks code element and it works nicely.

This might help you too:

Cheers

Patric

1 Like

Patric, I’ve got this started and partially working, but I’m a bit befuddled on where to put the <?php acf_form_head(); ?> code. I can put it in the custom code box, but when I click update, I get an error about headers already being sent.

Actually, I think I figured it out, put it in the header.php file in the theme files.

I have it directly in a code element in the page without any errors.

My code:

<?php 
acf_form_head();
while ( have_posts() ) : the_post(); 
        acf_form(array(
        'submit_value'  => __('Termin ändern!'),
        'updated_message' => false,
        'fields' => array (
        'termin_id',
        'chochete_anmeldung_zeigen', 
        ),  
    ));
     
 endwhile;
?>

Hey. But when there is a new release of Bricks it will just get written over right?