Will I add a function to allow you to search a repeater field for a specific row value?
No, this is a bit out of scope for the ACF plugin
Does this solve your question?
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 think I have miss0understood your original question due to the language barrier.
Are you asking how to export / import custom field objects?
Or are you asking hoe to export / import custom field values?
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.
Before to buy this add-on, have some questions.
1. Does the plugin custom fields supports shortcodes?
2. Can i import custom fields data using bulk import?
Kindly reply
with regards
Selvam.S
WP has an export / import tool built in. You can access this via Tools -> Import
You can export ACF to this .xml format via Custom Fields->Export.
You will also find instructions on that page
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
Hi,
How to either import posts with the custom fields?
ACF uses a post type and custom field metadata to save all the custom field objects.
This means you can use the export feature in ACF to obtain a .xml file which you can import into a WP install via the default WP import tool!
Or how to get all fields of a field group?
Are you asking how via code?
Elliot –
Here is the full section of code.
<?php if(get_field('pro_perf')) {
while(has_sub_field('pro_perf')) {
$date_id = 1;
echo '<p> ' . get_sub_field('pro_perf_date') . '<br /> ';
if(get_sub_field('pro_perf_time_repeat')) {
while(has_sub_field('pro_perf_time_repeat')) {
if($date_id <= 1 ) {
$date_tags = get_sub_field('pro_perf_time_tag');
if($date_tags) {
foreach($date_tags as $date_tag) {
$t_data = get_option("event_tag_$date_tag->term_id_term_color");
echo $t_data;
echo '<span class="tagbox" style="background:' . $color . ';">' . $date_tag->slug . '</span>';
}
echo '<a class="date" href="' . get_sub_field('pro_perf_time_link') . '">' . get_sub_field('pro_perf_time') . '</a>';
} else {
echo '<a class="date" href="' . get_sub_field('pro_perf_time_link') . '">' . get_sub_field('pro_perf_time') . '</a>';
}
} else {
$date_tags = get_sub_field('pro_perf_time_tag');
if($date_tags) {
foreach($datetags as $datetag) {
echo '<span class="tagbox"> ' . $date_tag->slug . ' </span>';
}
echo ' | <a class="date" href="' . get_sub_field('pro_perf_time_link') . '">' . get_sub_field('pro_perf_time') . '</a>';
} else {
echo ' | <a class="date" href="' . get_sub_field('pro_perf_time_link') . '">' . get_sub_field('pro_perf_time') . '</a>';
}
}
$date_id ++;
}
}
echo '</p>';
}
}?>
Also, to answer your other questions, in my rushed state to post, I did not see the code button as an option. I am also fairly new to forums like this and the truth is it was just laziness and frustration but in the future I will make sure to properly address those issues and be a better community member.
Hi,
You have 2 options:
1. Use jQuery to find the prev / next data from the DOM and generate the HTML on page load
or
2. Don’t use the has_sub_field while loop, instead use a more basic PHP foreach of for loop so you can use the ‘index’ to find the prev (index-1) and next (index+1) rows
Does that help?
Also, as this is the new support forum (currently in beta) I have a few questions for you if you don’t mind:
Thanks
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.