It seems like multiple instances are currently supported according to this Github thread, which among it’s examples shows Gutenberg blocks in widgets…
https://github.com/WordPress/gutenberg/issues/20590
Unfortunately, my lack of familiarity with coding for Gutenberg leaves me unsure what to do with this information.
It seems like multiple instances are currently supported according to this Github thread, which among it’s examples shows Gutenberg blocks in widgets…
https://github.com/WordPress/gutenberg/issues/20590
Unfortunately, my lack of familiarity with coding for Gutenberg leaves me unsure what to do with this information.
I’ve figured out that I need to use the following code…
However, while the code runs on new fields added via repeaters, it does not run on fields during the initial load.
I’ve opened a new thread more in line with the issue I am facing…
acf.addAction('new_field/type=url', function(field){
field.$el.find('input[type=url]').on('blur', function(e){
var val = $(this).val();
if((!(val.indexOf('://') !== -1)) && (val.length !== 0)){
$(this).val('http://' + val);
}
});
});
@hube2, Are you sure you’re not thinking of the Link field type?
My question relates to the URL input field.
Essentially I’d just like to add a default http:// protocol if one is not entered instead of failing validation.
The aim is to adjust for users who assume http://www.whatever.com is a valid URL.
In the upcoming 5.7 you can turn off validation via:
window.acf.validation.active = false;
You also need to set the attribute formnovalidate to true on the submit button to avoid html5 validation.
acf.validation.active is a javascript variable so you need to change it with javascript.
In 5.7.0-beta3 I’m able to disable the javascript validation by changing the value of acf.validation.active to false.
This combined with acf_reset_validation_errors() allows me to submit incomplete forms conditionally, ignoring required fields.
@bru500, Did you ever figure this out.
I’m trying to do something similar, although acf_reset_validation_errors isn’t working for me. It posts but nothing saves and the front end gets hung up on required fields.
Any ideas?
I’ve additionally tried circumventing validation using
add_filter(‘acf/validation_value’, __return_true());
This doesn’t seem to work for required fields on the acf_form as well.
That’s scss btw, but could easily be changed to a standard color value.
Here’s what I wound up with for repeaters, I have yet to tackle flexible content fields.
.acf-repeater .acf-row:nth-child(odd) > .acf-row-handle.order,
.acf-repeater .acf-row:nth-child(odd) > .acf-row-handle.remove
{
background: darken(#f4f4f4, 3%);
}
I know this is an old thread, but any update on this?
Much thanks for the detailed information! I’ll take a look at this over the next couple days and see if I can get it working.
Thanks
Thanks,
Could you push a release for this? I’m concerned about clients who may have updated their plugin and are now experiencing issues.
With the number of sites we do it’s not feasible to manually track down and update all the sites affected.
Do you have any suggestions of articles/resources to learn more about WordPress performance on high traffic sites?
@jibbius Works for me to! Thanks.
I’d love to see this in the core plugin! It just makes sense and would be great for other common structures like addresses.
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.