I have found a simpler way to solve this.
Duplicate the field group which is collapsed.
Edit the name of the collapsed group to something (which sorts alphabetically behind the duplicated group). I use (collapse).
Remove (copy) from the name of the duplicated group.
Then removed the collapsed group.
The free version of ACF does NOT return $_POST[‘acf’], hence why it didn’t work in Keith’s case.
I was not aware of this… and it took some debugging to find out… another good reason to go ACF Pro 😉
My bad I think… You may email me at info [at] berryplasman [dot] com or add me on skype rubbervisions
like I said, it’s hard to say… but I wouldn’t mind taking a peek at your code if you would like my help… I have some time for it now…
I’ll send you my contact info in a PM.
No…. it’s hard to say without seeing it… I’d love to try and help you more in-depth, outside of this forum, but that means you have to email me your contact info @ berryplasman.com
Then your values (left part of : ) need to have the exact name/value as the name of your taxonomy.
how have you defined you radio options ? With or without the : ?
I don’t think this is the best place to store email addresses like this.
Why not use acf/save_post and then add it to the wp_options table as an array ?
You have to define your options as “value : label, where value is then your taxonomy id. For example, for Sex I have 3 options:
1 : Woman
2 : Man
3 : Trans
This returns an id.
Whereas if you define it like this:
woman
man
trans
or
woman : [anything except the word woman]
man : [anything except the word man]
trans : [anything except the word trans]
then it returns a string.
So it depends on what value $posted_roles is.
If it’s an ID, you need to change this
$term_id = get_term_by( 'name', $posted_roles, 'asproducts_cats' );
to
$term_id = get_term_by( 'id', $posted_roles, 'asproducts_cats' );
which should then match your taxonomy id of course.
So how did you define your options ?
@mrkeithy it depends on what the output is of $_POST['acf']['field_59154e83efb0e']
In my case it’s an ID. So look up the options for field ‘field_59154e83efb0e’ and make sure they return IDs and not strings.
This needs no further replies. Other issues have risen, which I’ll post in another topic.
Ok, I now know why it happened.
I created my website, with an ACF front-end form.
For it I created an ACF group.
I now installed WPML, created a translated page for the form and I copied the group I made before (I didn’t translate it as stated before).
If I now edit that specific post type in the admin, I have 2 ACF groups, 1 for each language. And I edited in the first one, because the group is so big, I didn’t see there was another one beneath it.
So now I’m thinking I do need to translate the form(s). Is that correct ?
I came to a similar conclusion and ended up with this:
if ( is_page( 'edit-ad' ) ) {
if ( isset( $_GET['id'] ) ) {
$ad_id = $_GET['id'];
$location_values = get_field( 'sd_city_selector', $ad_id );
$field['instructions'] = '<strong>Your location is: ' . $location_values['cityNameAscii'] . ' (' . $location_values['countryCode'] . ')</strong>';
}
}
I wanted to populate a message field, but for space I decided to use the instructions field instead.
I’m sorry if I continue on this instead of creating a new topic, but i’m exactly looking to do the same. For me load_field updates the message in the back-end instead of doing it on the fly.
I wrote a placeholder in themessage text, which gets replaced with the value I set in the function. Maybe I understand the function incorrectly, but I thought this function was meant to override the message value before being displayed, but not store it, since it’s different per user/post.
I would start by checking the jquery version of the template, see which it is using.
Then (in your theme) try to deactivate all plugins except ACF and activate them by one by one and test it after each activation. Maybe a plugin causes it.
If nothing changes, try deactivating parts/functions in your theme until you found ‘the culprit’.
have you tried switching to a default WP theme ?
I retract my message… There was a small mu plugin which I overlooked which had a function which removed it when ACF was active.
Thanks… your answer made me think about it and I’m happy the way it is now 😉 so i’ll leave it, thanks.
Is there a way to counter it ? Because the link didn’t provide a solution (yet).
nope… all works…
my permalink is domain.tld/post-type/acf_field/title
sorry to say but you have been misinformed. I have created my own custom permalinks with the custom post type in it as well as acf values.
you are wrong, there is a way…. and why don’t you just unsubscribe and leave it open for others are looking for a solution ?
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.