Support

Account

Home Forums Add-ons Repeater Field Repeater Field not working in fornt-end acf form Reply To: Repeater Field not working in fornt-end acf form

  • Sure,
    I installed a plugin called ACF Front End Plugin, which displayed the repeater field in fine way and also Added new row while clicking the Add Row Button and then to save the fields I used the pre_save_post and save_post hooks.

    //first in functions.php
    add_filter(‘acf/pre_save_post’ , ‘my_pre_save_post’ );
    function my_pre_save_post( $post_id ) {
    global $post;

    $current_id = get_current_user_id();
    $post_id = ‘user_’ . $current_id;

    do_action(‘acf/save_post’, $post_id);

    }
    and then in template file to save it
    if(isset($_POST)){
    // $post_id to save against
    $current_id = get_current_user_id();
    $postID = ‘user_’ . $current_id;

    // update the fields as user meta
    do_action(‘acf/save_post’, $postID);
    }

    Hope it helps for others too.

    Thanks,