Support

Account

Forum Replies Created

  • This part:

    <?php	
    acf_register_form(array(
    'id'		    	=> 'mytest',
    'post_id'	    	=> $id,
    'form' => false,
    'post_title'		=> false,
    'post_content'  	=> false,
    'uploader'      	=> 'basic',
    'field_groups' => array(2135),
    ));
    acf_form('mytest');
    ?>

    is called inside this part

     <form method="POST" action="" enctype="multipart/form-data" id="stm_sell_a_car_form">
    
            <?php if ($car_edit){ ?>
                <input type="hidden" value="<?php echo intval($vars['id']); ?>" name="stm_current_car_id"/>
                <input type="hidden" value="update" name="stm_edit"/>
            <?php } else { ?>
                <input type="hidden" value="adding" name="stm_edit"/>
            <?php } ?>
    
            <?php do_action('stm_vin_auto_complete_require_template'); ?>
    
            <?php stm_listings_load_template('add_car/title', $vars); ?>
    
            <?php stm_listings_load_template('add_car/step_1', $vars); ?>
    
            <?php stm_listings_load_template('add_car/step_2', $vars); ?>
    
            <?php stm_listings_load_template('add_car/step_3', $vars); ?>
    
            <?php stm_listings_load_template('add_car/step_4', $vars); ?>
    
            <?php stm_listings_load_template('add_car/step_5', $vars); ?>
    
            <?php stm_listings_load_template('add_car/step_6', $vars); ?>
    
        </form>
  • Thanks for your reply John.

    acf_form() is called inside my form, but it still not register my field …

  • Form process:

    <?php
    if (!defined('ABSPATH')) {
        exit; // Exit if accessed directly
    }
    
    acf_form_head();
    
    get_header();
    
    $car_edit = false;
    
    if (!empty($_GET['edit_car']) and $_GET['edit_car']) {
        $car_edit = true;
    }
    
    $restricted = false;
    
    if (is_user_logged_in()) {
        $user = wp_get_current_user();
        $user_id = $user->ID;
        $restrictions = st_get_post_limits($user_id);
    } else {
        $restrictions = st_get_post_limits('');
    }
    
    if ($restrictions['posts'] < 1) {
        $restricted = true;
    }
    
    $vars = array();
    if ($car_edit): 
      
        if (!empty($_GET['item_id'])) {
            $item_id = intval($_GET['item_id']);
        $vars = array(
            'id' => $item_id
        );}
    		endif;
     ?>
    <div>
    <form method="POST" action="" enctype="multipart/form-data" id="car_form">
    <?php if ($car_edit): ?>
    <input type="hidden" value="<?php echo intval($item_id); ?>" name="current_car_id"/>
    <?php endif; ?>
    
    <?php load_template('add_car/stp1', $vars); ?>
    ...
    <button type="submit" class="enabled" data-load="edit" >Save</button
    </form>
    </div>
    
    <?php
    get_footer();
Viewing 3 posts - 1 through 3 (of 3 total)