Btw square brackets are the new in php5.4 for short notation of array(). If you are using <5.4 then use array().
i was able to figure it out. For anyone else wondering…
// To get field groups:
$fieldgroups = apply_filters('acf/get_field_groups');
// To get rules:
$location = apply_filters('acf/field_group/get_location', [], $fieldgroup['id']);
// To get fields of group:
$groupFields = apply_filters('acf/field_group/get_fields', [], $fieldgroup['id']);
Values.
I have a spreadsheet with posts and additional fields (custom fields). I want to import this into WP. Not seeing how to do that.
Zach
I checked out the dump from the custom fields export. It looks like it stores all the data from the actual value as a PHP serialization. This creates a problem for what I’m trying to do. I need to bulk import from a csv a custom post type that has custom fields. I’m using your custom fields plugin for the fields. I have plugin that used to import fields with your plugin. It seems like the code has been deprecated since then.
In PHP, how would I get all the fields of a field group along with the rules? Your documentation is very clear on how to do that.
What is the default format i can use for the WP import?
Yes via code. I’m using a plugin from another vendor that needs to be updated.
Zach
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.