Home › Forums › Add-ons › Repeater Field › Front End at to Repeater Field › Reply To: Front End at to Repeater Field
Hi John,
Cheers for the help, I didn’t realise acf have a form. I solved it another way, by using ajax.
<?php
// This allows our page to have wordpress knowledge
define('WP_USE_THEMES', false);
require_once('../../../wp-load.php');
$userid = $_REQUEST['userid'];
$email = $_REQUEST['email'];
$username = $_REQUEST['username'];
$pageid = $_REQUEST['pageid'];
$attendFB = $_REQUEST['attendFB'];
$update_field = new WP_Query('showposts=1&post_type=tribe_events&orderby=date&order=ASC&p='.$pageid );
while ($update_field->have_posts()) : $update_field->the_post();
the_title();
//get attending rows
if( have_rows('attending') ){
$gallery = get_field( 'attending' );
} else {
$gallery = array();
}
// add to existing array
$gallery[] = array(
'user_id' => $userid,
'name' => $username,
'email' => $email
);
// save new array
update_field("field_identifier", $gallery, get_the_ID());
endwhile; wp_reset_query();
?>
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.