Sorry, I just saw the other issue on this exact topic. Please disregard…
I am using the 'form' => false,
option to provide the ACF fields within my own form HTML.
I just added my own plain html field with the id acf-_post_title and name acf[_post_title] and everything worked as expected.
<input type="hidden" id="acf-_post_title" name="acf[_post_title]" value="Anonymous Response">
I provided a default title that worked for me, and then used a bit of jQuery to change the value based on user input to other fields. My example fills in the first and last name fields if they are not empty and if an anonymous checkbox is not checked.
$('#acf-field_590bacbe30591, #acf-field_590bacd630592, #acf-field_590bad1230595').on('change', function() {
var fname = $('#acf-field_590bacbe30591').val();
var lname = $('#acf-field_590bacd630592').val();
var anon = $('#acf-field_590bad1230595').attr('checked');
if ( anon == 'checked' || ( fname == '' && lname == '' ) ) {
$('#acf-_post_title').val("Anonymous Response");
}
else {
$('#acf-_post_title').val("Response from " + fname + " " + lname);
}
});
Here’s a quick workaround plugin:
https://gist.github.com/squarecandy/036290389ba97434b17ab959a0ce9aef
Throw that in your plugins folder, activate, and then use sqcdy_acf_rgb('my_color_field')
in place of the_field('my_color_field')
or sqcdy_get_acf_rgb('my_color_field')
in place of get_field('my_color_field')
.
It just outputs RRR,GGG,BBB so you can use the output in your css like this:
color: rgb(<?php sqcdy_acf_rgb('my_color_field'); ?>);
or with rgba like this:
color: rgba(<?php sqcdy_acf_rgb('my_color_field'); ?>,0.5);
Thanks to everyone who helped solve the conflict with the 3rd party timepicker plugin. With the timestamp support everything is working pretty smoothly now.
Thanks @tlexcellent. This was helpful.
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.