Support

Account

Home Forums General Issues Add custom field to group field by code

Solving

Add custom field to group field by code

  • I am using wordpress 4.1 with ACF v4. I have a custom post type with custom fields added and need add a new custom field each time a new category is added. If i add the category “Sedan” automaticly i have to add the custom field “Sedan” in the group. Can I do this with the plugin functions? Or I have to do this with code, with inserts in database? Thanks in advance!!

  • Rolling your own field would probably be your best bet. Take a look at Awesome ACF. They have a lot of cool new fields to get you started. For what you’re looking for the Taxonomy Selector would be a good starting point. It has a method (get_taxonomies) that pulls current taxonomies into the custom field settings for selection.

  • Hi, thanks for response.
    I have this group fields
    And i need add new pair of fields each time a new category is added.
    This categories are added by a external software using the woocommerce API.

  • For that I would want to run everything through local JSON. Then tie into the WP create_category hook. Each time a new category is created, parse the json from the local file and update it. ACF will then pull the data from that json file instead of from the DB.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Add custom field to group field by code’ is closed to new replies.