I’m not sure you can import serialized data.
But if you can, ACF stores a serialized array of string values representing the IDs.
Your first array
array(0 => "651", 1 => "649")
would be serialized by ACF as
a:2:{i:0;s:3:"651";i:1;s:3:"649";}
what type of field is the sub field “color”?
There will be no change in performance between get_field() and the_field()
yes, a copy will only go into the child theme folder if it is edited.
the other thing you are seeing has to do with the order that the field groups are added when the load point is added.
If the load point for the parent is added in a way that causes them to be loaded first then this field group will override the version in the child theme. You can sync them and save them but this will ultimately not have any effect. Any changes to the field group in the child theme will only be visible when editing the group and have no affect on the field group when editing content.
The condition I described happens when the parent theme json files are loaded after the child theme json files. This is what will normally happen.
The difference is cause by where in the array of load points the parent theme load point is added.
After looking into this, the best I can come up with is to add an acf/save_post action.
In this action you get a list of the images for the gallery
// this will get unformatted value of gallery
// an array of attachment post IDs
// see https://www.advancedcustomfields.com/resources/get_field/
$gallery = get_field('gallery_field_name', $post_id, false);
Then loop over this list of ID, get the attachment post using get_post(), change the “post_parent” value and then use wp_update_post() to save the changes.
Notes: An attachment can only go “attached” to a single post
You must remove your action, inside of the action, before calling wp_update_post(). If you don’t then you create an infinite loop because acf/save_post is triggered by calling that function.
add_action('acf/save_post', 'your_function_name');
function your_function_name($post_id) {
remove_filter(('acf/save_post', 'your_function_name');
}
the feature you are referring to is part of the ACF Extended plugin. You should to talk to the developers of that plugin.
json files in the parent theme, if they are included by adding a json load point do not need t be synced into the database to work. If you don’t want these field groups to be synced then they should not be synced.
Once a field group is synced from the parent theme a copy of that group is saved in that acf-json folder in the child theme if it exists. Once this happens the field group is forever disconnected from the parent theme.
The “private” setting in the json file should be added to prevent syncing of the parent theme groups you do not want to allow editing of. This is explained on this page https://www.advancedcustomfields.com/resources/synchronized-json/
If they have already been synced they will need to be deleted from the database for the child theme site.
Log into your account, go to Licenses, next to the license there is a ling to manage activation, this will list all sites it is used on.
That is what you were looking for.
There is a folder in your theme .../block/content_rows/
In this folder there is a php file for each of your layouts
{$layout_name}.php
To add a layout you need to create a new php file in that folder with a name that matches your new layout name. Then you need to add code to that new file that will be used to display the content of your layout.
Because the options are saved as options and the fields on the page are saved in post meta for that page.
If you want the options to be eitiable on both the page and the options page then you can set the “post_id” argument when creating the options page to the post ID of the page. This will cause all options saved on that options page to be saved to the post_meta for that post ID instead of in options. Changing the post ID for options page after the options are save will cause ACF to ignore that previously saved values.
Usually, when you create an options page it is because you want to edit the values separability from a page.
A field groups field values are unique to the place where they are edited… a page, a post, a user, an options page.
Does the text contain anything like ampersands, single or double quotes, less then or greater than, anything else the might be converted to html entities by wp_kses?
If this it the case it could be a false positive and you should probably contact support so that they can look into it and correct.
You are going to have to look/search the forum. ACF form is not designed to load via AJAX. There have been people that have tried this in the past. I seem to remember that there may have been a solutions.
Uploads cannot be attached to a user. Uploads are attached to posts by using the post_parent value of the post. This does not exist for users.
Have you added acf_form_head() correctly?
Yes, you just need to change the_field()
to echo get_field()
and the_sub_field()
to echo get_sub_field()
I was told by the developers that it will not affect get_field() or get_sub_field().
It looks like you have nested repeater fields. You need to use nested have_rows() Loops, or you need to access the nested value in the array from your get_sub_field() call.
$rows[0]['level_one_links'][0]['menu_items'][0]['link_to']
There is a Min/Max setting for each layout, you may have missed it. This is to set minimum and maximum number of times the layout can be used.
You will have to manually delete the CPTs from the other plugin and then recreate them in ACF. You’ll probably want to back up you site before you do this.
I’m not a fan myself of retroactively changing a site. If the site is working I would leave it the way it is unless there was some overriding reason that it needed to be changed.
Somewhere in your theme’s PHP code there is a loop, see this page https://www.advancedcustomfields.com/resources/flexible-content/
In that loop the code is doing something based on the name of the layout. You will have to add new code for your new layout and how you add this code will depend on how the previous developer coded the theme.
You will need to figure out what the error is. While the error might happen when you activate ACF it may not be ACF that is causing the error and could be something else.
It’s been a while since this plugin was updated but it may still work. https://github.com/DavidWells/debug-plugin-activation-errors
I would suggest trying out this plugin https://wordpress.org/plugins/what-the-file/
This does appear to be a bug because all ACF relationship type fields expect that the stored array will be an array of stings for the ID values.
The developers do not monitor this forum for bugs. Yes, I know the forum title says “Bug Reports” but this was created many, many years ago when the developer managed this forum.
You should contact the developers directly or open a ticket under your account.
You would have to build a query to get the “posts” in the “term(s)” that you want to display. https://developer.wordpress.org/reference/classes/wp_query/
Given the information provided, if I was building something like this I would not be using a repeater to list all of the shops in a mall. I would:
Have a CPT for Malls, each mall would be a different post in this post type
Have a CPT for the stores/shops/whatever you want to call it. Each store would have it’s own post.
There would be a one-to-many bidirectional relationship between the mall and the stores. A post object field on the store post to select the mall and a relationship field on the mall post to select the stores in that mall. I would use my plugin to create this bidirectional relationship because it is beyond what the ACF relationship field can do.
I would have a custom taxonomy for selecting the type of store/shop/whatever
I would have a value in the store to indicate what floor the store is on.
If the same operator can be located in multiple malls I would also have a custom post type for this with a one-to-many relationship between the operator and store post types.
Because you are using Elementor, I would be using Elementor Pro’s theme builder and/or templates to build the templates for showing pages on this site. Using the post widget using a custom query to show the archive pages of of the various post types.
Given the information I have I don’t know any reason that the shortcodes would not work in a text widget if that text widget is use on the same page as the shortcode widdget.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.