I am trying to create fields that are imported into a theme using PHP, but when I do this there are certain fields which don’t work properly.
When they are saved, they lose their value and look like an empty <input> field with no label.
Here is the code (snippet from the full PHP export) that just does not work:
array (
'key' => 'field_53bbffb33e384',
'label' => 'Comments',
'name' => 'comments',
'prefix' => '',
'type' => 'true_false',
'instructions' => 'If you untick here, comments will be disabled throughout the whole site.',
'required' => 0,
'conditional_logic' => 0,
'message' => 'Enable Comments?',
'default_value' => 0,
),
The strange thing is if I rename it to something like “comments_on” then it works. This also happens to some other fields, and renaming them fixes them, but there seems to be no common reason.
I’m trying to add it to an Options page.
Regards
Shaun