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,
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.