Home › Forums › Front-end Issues › acf_form deleting bottom rows instead of selected rows › Reply To: acf_form deleting bottom rows instead of selected rows
I’m working on replacing the theme so I’ll have to report back on that, but for the meantime, here is a copy of the JSON for the field group
[
{
"key": "group_5666edefa5155",
"title": "Company Admin (User Role)",
"fields": [
{
"sub_fields": [
{
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": "",
"key": "field_5666ee3fa5fd3",
"label": "Name",
"name": "name",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"readonly": 0,
"disabled": 0
},
{
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"key": "field_5666ee4ba5fd4",
"label": "Email",
"name": "email",
"type": "email",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
}
},
{
"default_value": 0,
"min": "",
"max": "",
"step": "",
"placeholder": "",
"prepend": "",
"append": "",
"key": "field_56788b08dff96",
"label": "Available Units",
"name": "available_units",
"type": "number",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"readonly": 0,
"disabled": 0
},
{
"default_value": "",
"min": 0,
"max": "",
"step": "",
"placeholder": "",
"prepend": "",
"append": "",
"key": "field_56788afadff95",
"label": "Add Units",
"name": "add_units",
"type": "number",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"readonly": 0,
"disabled": 0
},
{
"multiple": 0,
"allow_null": 0,
"choices": {
"Active": "Active",
"Inactive": "Inactive"
},
"default_value": {
"Inactive": "Inactive"
},
"ui": 0,
"ajax": 0,
"placeholder": "",
"return_format": "value",
"key": "field_5666ee50a5fd5",
"label": "Status",
"name": "status",
"type": "select",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"disabled": 0,
"readonly": 0
}
],
"min": 0,
"max": 0,
"layout": "table",
"button_label": "Add Employee",
"collapsed": "",
"key": "field_5666ee11a5fd2",
"label": "Employees",
"name": "employees",
"type": "repeater",
"instructions": "<strong>PLEASE READ CAREFULLY:<\/strong>\r\n<ol>\r\n<li>You may add units or change statuses.<\/li>\r\n<li>Setting an employee's status to <em>Inactive<\/em> will transfer all of their <em>Available Units<\/em> back to your account.<\/li>\r\n<li>An employee MUST be <em>Active<\/em> to add units to their account.<\/li>\r\n<\/ol>",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
}
}
],
"location": [
[
{
"param": "user_role",
"operator": "==",
"value": "company_admin"
}
]
],
"menu_order": 0,
"position": "normal",
"style": "default",
"label_placement": "top",
"instruction_placement": "label",
"hide_on_screen": "",
"active": 1,
"description": "",
"modified": 1452103095,
"local": "json"
}
]
and this is the code I used in my page template
<?php
$current_user = wp_get_current_user();
if(in_array('company_admin', $current_user->roles)):
?>
<section class="pad-50px gray-bg content-wrapper clearfix" id="employees">
<div class="aspira-wrapper">
<h4>Your Employees</h4>
<?php
$args = array('post_id' => 'user_' . get_current_user_id(),
'fields' => array('field_5666ee11a5fd2'),
'return' => site_url('/mycourses'),
'submit_value' => __("Save Changes", 'acf'));
acf_form($args);
?>
</div>
</section>
<?php endif; ?>
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.