Home Forums ACF PRO Adding my custom fields to existing front-end post/update form Reply To: Adding my custom fields to existing front-end post/update form

  • I’ve just revisited this and thought I’d share in detail how I did it. It’s an application of John’s thinking.

    My problem to begin with was I wanted to add a repeating field to the job submission form of WP Job Manager (specifically in Listify – should work across other themes)

    Create your field group containing the repeating fields and grab the field group ID. You can find this in the URL of the edit field group page for your field group under Custom Fields.

    In your theme or child theme, create a folder called job_manager, and copy in job-submit.php from plugins/wp-job-manager/templates. This will be used instead of the default job submission form.

    Paste in the following code where you would like the repeating field to appear. I chose line 51 so it would appear after all other fields. I haven’t tested other locations but I guess it should work.

    <?php acf_form(array(
        'post_id'	=> $job_id,
        'field_groups' => array(your field group ID num here),
        'form' => false,
        'return' => '' // do not redirect, let WP Job Manager take care of it
    )); ?>

    Without using a blank return you get issues with the page not redirecting to the proper URL and display submission success messages.

    I had issues with acf_form_head() so am adding it in functions.php. You could always add a check to just add it if on a certain URL, using a template etc. Simply though:

    add_action( 'init', 'acf_head_add' );
    function acf_head_add(){

    Hope that helps.