Looks like the best we can get is to set a default and hope they don’t set it back to None https://github.com/AdvancedCustomFields/acf/issues/278
I can’t get this to work, have you gotten it? No matter what I try it either doesn’t actually make it full width or it shows the option of None or Full. I don’t want any choice and for it to automatically have data-align=”full” attribute.
Needed this again and my original solution didn’t work for some reason. I found an easier way using sibling instead of parents.
// field is coming from select2_ajax_data filter,
// so it's the current field.
// Using $input was breaking because select2 puts the actual input outside of the row.
var fields = acf.getFields(
{
key: 'my_field_key',
sibling: field.$el,
}
);
if ( fields ) {
var first = fields.shift();
var value = first ? first.val() : '';
}
Needed this today and stumbled on this post.
I’m dynamically changing things via select2_ajax_data
based on other field values, so I needed the value of a different field in a repeater row.
This is the idea. Works well enough.
// $input is coming from select2_ajax_data filter,
// so it's the current field input.
var fields = acf.getFields(
{
key: 'my_field_key',
parent: $input.parents( '.acf-row' ),
}
);
if ( fields ) {
var value = fields.shift().val();
}
Just an update that it is 100% possible to create a dynamic block that allows inner blocks. Maybe it wasn’t in the earlier stages but I can confirm it works.
I’ve already let Elliot know and I really hope he can get this in 5.8. It seems very simple since ACF blocks beta already has everything else in place.
https://twitter.com/jivedig/status/1105207424703713280?s=21
If you only deleted your prefixed options, then you missed all of the ‘field_12346782568’ data as well though.
Did you manually clean up? Also, what’s the best method to clean things up since ACF adds the field_
field along with every field? That seems like a very manual process to track them all down.
I’ve never seen that. You may have had some shared terms via an older version of WP, and when the term split happened in WP something broke. I use custom taxonomies on users all the time, and have only ever returned users when using get_objects_in_term()
I don’t think WP_User_Query supports taxonomies yet. I usually have to use https://codex.wordpress.org/Function_Reference/get_objects_in_term
Rock on. This is just what I needed. Thanks.
+1 on term meta. This is vital to ACF (IMO) and the evolution/power of WP core.
I’ve successfully registered a custom taxonomy and assigned it to the ‘user’ object. It actually all works fine. The only issue is there is no default UI for managing the taxonomy. I have CMB2 (ACF may work too) to choose the taxonomy term(s) for the user.
A tip on how to manage the taxonomy:
Also attach the custom taxonomy to another post type (like posts), then you can add the terms, descriptions, etc via the Posts/taxonomy UI and they will show up (via ACF/CMB2) in the user profile.
It’s working well for me this way right now.
I haven’t played with it yet, but recently discovered this plugin as well. I’m researching for a project that will require front end ‘profile’ management with custom fields. I was considering syncing each user with 1 custom post.. but that feels so difficult. I’d much rather just have a custom taxonomy for users. Gonna have a play with this one soon.
Thanks Elliot. A quick test on my main problem site and it seems to be resolved. Will be doing more development on that site later today so I can test further.
Same issue for me on 2 different sites running Pro 5.2.0.
Can anyone confirm Elliot (or other) knows and is working on resolving this?
Hey Trumpeter.. it seems like you’re not fully understanding what’s happening with these filters. ‘download’ in my example is the post type you are posting to, not the custom field.
I’m definitely using ACF Pro for this too.
A lot of people seem to be struggling with this, so I wrote a tutorial explaining it in more detail.. check it out:
http://thestizmedia.com/front-end-posting-with-acf-pro/
I see the confusion.. I was thinking to hook in earlier, and only run the filter based on the conditional…
add_action( 'wp_head', 'prefix_do_the_acf_trickery' );
function prefix_do_the_acf_trickery() {
if ( is_page('page-one') ) {
add_filter('acf/pre_save_post' , 'prefix_page_ONE_acf_pre_save_post', 10, 1 );
}
if ( is_page('page-two') ) {
add_filter('acf/pre_save_post' , 'prefix_page_TWO_acf_pre_save_post', 10, 1 );
}
}
prefix_page_ONE_acf_pre_save_post() {
// Do your thing
}
prefix_page_TWO_acf_pre_save_post() {
// Do your thing
}
then instead of is_page() you could use get_post_type() or whatever makes sense.
Pardon the rough code, just slapped together an example.
MattNPL, how about conditionally using pre_save_post? … so it only fires the right code based on the group ID get_post_type, or similar…
I don’t think pre_save_post will work here. If you see my tutorial, I need to run load_value then wp_update_post to update the title/content.
Part 2 is available now as well… front end post EDITING!
http://thestizmedia.com/front-end-post-editing-with-acf-pro/
I have a working code example earlier in this thread.
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.