Home › Forums › Backend Issues (wp-admin) › Fields vanishing in wp-admin › Reply To: Fields vanishing in wp-admin
OK, I just exported the 10 test fields to PHP and copied the ‘fields’ portion of the array (and not the ‘locations’ part) into my theme config.php
The second I uploaded that PHP file I hit update on the fields group and BOOM, 1 field left.
So I can create fields, just not use them?
Here is the code:
if(function_exists("register_field_group")){
register_field_group(array (
'id' => 'acf_template-one-a',
'title' => 'Template One: A',
'fields' => array (
array (
'key' => 'field_56a2ce14c3f0d',
'label' => 'one',
'name' => 'main_content_text_color',
'type' => 'color_picker',
'required' => 1,
'default_value' => '#000000',
),
array (
'key' => 'field_56a2ce42c3f0e',
'label' => 'two',
'name' => 'conversion_text_color',
'type' => 'color_picker',
'required' => 1,
'default_value' => '#000000',
),
array (
'key' => 'field_56a2f4376cc20',
'label' => 'three',
'name' => 'another_damn_field',
'type' => 'text',
'instructions' => 'blah blah blah',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_56a2f4d283faa',
'label' => 'four',
'name' => 'four',
'type' => 'text',
'instructions' => 'grrrrr',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_56a30600484a1',
'label' => 'five',
'name' => 'five',
'type' => 'image',
'save_format' => 'object',
'preview_size' => 'thumbnail',
'library' => 'all',
),
array (
'key' => 'field_56a3061ef00f1',
'label' => 'six',
'name' => 'six',
'type' => 'image',
'save_format' => 'object',
'preview_size' => 'thumbnail',
'library' => 'all',
),
array (
'key' => 'field_56a30657f81a1',
'label' => 'sevin',
'name' => 'sevin',
'type' => 'wysiwyg',
'required' => 1,
'default_value' => 'foo',
'toolbar' => 'full',
'media_upload' => 'yes',
),
array (
'key' => 'field_56a3066fdf65c',
'label' => 'eight',
'name' => 'eight',
'type' => 'wysiwyg',
'default_value' => '',
'toolbar' => 'full',
'media_upload' => 'yes',
),
array (
'key' => 'field_56a306cdc3924',
'label' => 'nine',
'name' => 'nine',
'type' => 'color_picker',
'required' => 1,
'default_value' => '#ff0000',
),
array (
'key' => 'field_56a306ea011a1',
'label' => 'ten',
'name' => 'ten',
'type' => 'color_picker',
'required' => 1,
'default_value' => '#00ff00',
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'landing-page',
),
array (
'param' => 'template_id',
'operator' => '==',
'value' => $key,
)
),
),
'options' => array (
'position' => 'normal',
'layout' => 'no_box',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}
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.