Support

Account

Forum Replies Created

  • <?php
    /*
    Template Name: Form ADD
    */
    acf_form_head();
    get_header(); 
    the_post(); 
    ?>
    
    <div class="acfform">
      <?php acf_form(array(
    	'field_groups' => array(xxxxxxxxx),
    	'post_id'		=> 'xxxxx',
    	'submit_value'		=> 'ADD',
    	'return'		=> '%post_url%',
    	'updated_message'		=> ''
    )); ?>
    </div>
  • <?php
    /*
    Template Name: Form Edit
    */
    acf_form_head();
    get_header(); 
    the_post(); 
    ?>
    
    <div class="acfform">
    <?php
    $post_id = $_GET['post_id']; // get post_id option
    $options = array(
    'post_id'=> $post_id,
    );
    acf_form($options);
    ?>
    <?php if ( is_user_logged_in() ) : ?>
    			<?php /* The loop */ ?>
    			<?php while ( have_posts() ) : the_post(); ?>
    				<?php acf_form(array(
    				'field_groups' => array(xxxxxxxxxxx),
    					'post_id'	=> $post_id,
    					'post_title'	=> false,
    					'return' => '%post_url%',
    					'submit_value'	=> 'Atualizar Anuncio'
    				)); ?>
    			<?php endwhile; ?>
    
    <?php endif; ?>
    </div>
  • I am using this way!
    Edit post url:
    http://website.com/editformpage/?post_id=<?php echo get_the_ID();?>

    
    //form.php template
    <?php if ( is_user_logged_in() ) { ?>
      <?php acf_form(array(
    	'field_groups' => array(xx),
    	'post_id'		=> 'myid',
    	'submit_value'		=> 'Submit',
    	'return'		=> '%post_url%',
    	'updated_message'		=> ''
    )); ?>
    <?php } else { ?>
    Login Form
    <?php } ?>
    //editform.php template
    <?php if ( is_user_logged_in() ) { ?>
    <?php
    $post_id = $_GET['post_id']; // get post_id option
    $options = array(
    'post_id'=> $post_id,
    );
    acf_form($options);
    ?>
    <?php if ( is_user_logged_in() ) : ?>
    <?php /* The loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>
    <?php acf_form(array(
    'field_groups' => array(xx),
    'post_id'	=> $post_id,
    'post_title'	=> false,
    'return' => '%post_url%',
    'submit_value'	=> 'Update'
    )); ?>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php } else { ?>
    Login Form
    <?php } ?>
  • I’m having this same problem:

    Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\blog\wp-includes\general-template.php:594) in C:\xampp\htdocs\blog\wp-includes\pluggable.php on line 1173

    At the time of publishing the post …

Viewing 5 posts - 1 through 5 (of 5 total)