Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Dear ACF users.
The support forum will be temporarily closed from Friday 24th May until Wednesday 29th May. Over this period, I will be taking some time away from work(ish) and focusing on producing better documentation!Please use the search forms below (and google) to find documentation and previous discussions. There are loads of useful articles which I'm sure will help you out!
I apologize for the inconvenience. Thanks, Elliot
issue with the acf_form array
-
There is a problem with the acf_form(array) function.
My below notes are with the ***** .
$features = array(
'post_id' => $post->ID, // post id to get field groups from and save data to
'field_groups' => array(56), // this will find the field groups for this post (post ID's of the acf post objects)
'form_attributes' => array( // attributes will be added to the form element
'class' => ''
),
'return' => add_query_arg( 'updated', 'true', get_permalink() ), // return url
'html_field_open' => '<h3>Title test 1</h3><div class="field">', // field wrapper open****** THIS DO NOT WORK ***
'html_field_close' => '</div>', // field wrapper close
'html_before_fields' => '<h3>Title test2</h3>', // html inside form before fields ****** THIS WORKs ***
'html_after_fields' => '', // html inside form after fields
'submit_value' => 'Update Slider', // value for submit field
'updated_message' => 'Slider updated.', // default updated message. Can be false to show no message
);
Even though the html_before_fields works, it seems to be showing outside the meta-box. -
Hi @samjco
Thanks for the bug report.
Thinking about it, I should take that parameter out as the .field div needs to stay as is for the JS to work.
Would it be beneficial to have an html_field_prepend and html_field_append ? -
I would think so. :)
Because the reason why I am using them is because I wanted to add h3 tag title to each meta-box, above it each metabox. However, I also wanted to add a show/hide function within the meta-box itself, this way I can show and hide metaboxes based on click instead having all of them showing. This will only work if I am able to put a div around each metabox that I wish to hide/show. -
Hi @samjco
The html_field_prepend and html_field_append params would allow you to insert HTML into the field div, not the metabox.
I'n the next version I'll be adding in an h3 heading for the metabox title and I'll also include some new params for the html!
Cheers -
Oh, sorry read it wrong :P
But yes... I think the only reason I would use those params is to add temporary hints.. or perhaps adding timed "New field" stickers! LOL. But I'm pretty sure by keeping it, we'll find something to do with it.
-
BTW. Thanks for ACF. I have tried and mixed many custom fields plugins to make my web apps, but your plugin takes the cake!
I spoke at many WordCamps.
This is by far my best plugin ever! :)