Register ACF date field via PHP

Question

I am using the ACF plugin and I register the custom fields via php.
So far I have followed the documentation and I am using this code:

acf_add_local_field_group(array(
'key' => 'group_1',
'title' => 'My Group',
'fields' => array (
    array (
        'key' => 'field_1',
        'label' => 'Sub Title',
        'name' => 'sub_title',
        'type' => 'text',
    )
),
'location' => array (
    array (
        array (
            'param' => 'post_type',
            'operator' => '==',
            'value' => 'post',
        ),
    ),
),
));

I want to add the same way a date picker field. I am trying to change the field type to "date" or "date-picker" but it doesn’t seem to work.
Is it possible to do it?
Thank you

0
marissalianam 2 months 0 Answers 4 views 0

Leave an answer