Home › Forums › Front-end Issues › Front form doesn't save my fields › Reply To: Front form doesn't save my fields
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();
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.