Support

Account

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(); 
    	?>