Title: Cannot create acf table field programmatically
Last modified: August 31, 2016

---

# Cannot create acf table field programmatically

 *  Resolved [slimx](https://wordpress.org/support/users/slimx/)
 * (@slimx)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/cannot-create-acf-table-field-programmatically/)
 * Hi,
 * Great plugin. Saved me a lot of time.
    I’m trying to create a table field programmatically
   but for some reason it’s not working. Here is part of my code.
 *     ```
       register_field_group(array (
               'id' => 'acf_test-table',
               'title' => 'Test table',
               'fields' => array (
                 array (
                   //'key' => 'field_568a92ec26958',
                   'key' => 'test_table',
                   'label' => 'TestTable',
                   'name' => 'test_table',
                   'type' => 'table',
                   'use_header' => 1,
                 ),
                 array (
                   'key' => 'field_5323276db7e18',
                   'label' => 'Email Address',
                   'name' => 'email_address',
                   'type' => 'email',
                   'required' => 1,
                   'default_value' => '',
                   'placeholder' => '',
                   'prepend' => '',
                   'append' => '',
                 ),
               ),
               'location' => array (
                 array (
                   array (
                     'param' => 'post_type',
                     'operator' => '==',
                     'value' => 'post',
                     'order_no' => 0,
                     'group_no' => 0,
                   ),
                 ),
               ),
               'options' => array (
                 'position' => 'normal',
                 'layout' => 'default',
                 'hide_on_screen' => array (
                 ),
               ),
               'menu_order' => 4,
             ));
       ```
   
 * The test e-mail address field is created. However, the table field isn’t.
 * Hope you can help me.
    Thanks, Sharif.
 * [https://wordpress.org/plugins/advanced-custom-fields-table-field/](https://wordpress.org/plugins/advanced-custom-fields-table-field/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [slimx](https://wordpress.org/support/users/slimx/)
 * (@slimx)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/cannot-create-acf-table-field-programmatically/#post-6907930)
 * Just figured out what was wrong.
 * I think the ID chosen for the table field was having some conflict with a previous
   table test.
 * Sorry for the spam. I’ll try to be less anxious next time.
 * Regards.

Viewing 1 replies (of 1 total)

The topic ‘Cannot create acf table field programmatically’ is closed to new replies.

 * ![](https://ps.w.org/advanced-custom-fields-table-field/assets/icon-256x256.png?
   rev=1962986)
 * [Table Field Add-on for ACF and SCF](https://wordpress.org/plugins/advanced-custom-fields-table-field/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-custom-fields-table-field/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-custom-fields-table-field/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-custom-fields-table-field/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-custom-fields-table-field/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-custom-fields-table-field/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [slimx](https://wordpress.org/support/users/slimx/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/cannot-create-acf-table-field-programmatically/#post-6907930)
 * Status: resolved