True. That should be a part of an update.
It took me 1h to check all website, and function before knowing it was an ACF bug.
Elliot, maybe you can create a small update fix in 5.8.2 and publishing it quickly no ?
Thank you for your support. I will make some teste of performance once finish.
Making this topic solve, and thank you again John for your support.
Ok. Apparently, i got buddyform bitching with acf form. I did desactivate buddyform, and working fine.
Thank you for the respond.
Actually i did solve the issue by storing an array in a meta and query the array using compare ‘LIKE’ with wp_query metaquery wish is working fine as im looking for specifics concatenate value/string.
It’s working. Is there is any contradictions to use this method ?
Thank you for your respond John.
So, based on your advised, i did create an hidden field to put an array with my value in it, wish im planning to query after. Here it is.
Any hint to query this array after ?
// Insérer les dimension des pneus dans une meta array.
function my_acf_save_post( $post_id ) {
$post_type = get_post_type($post_id);
if ($post_type != 'pneu') {
return;
}
if( have_rows('dimensions_av', $post_id) ):
while( have_rows('dimensions_av') ): the_row();
$largeur_pneu = get_term( get_sub_field('pneu_av_largeur'), 'largeur_pneu' );
$hauteur_pneu = get_term( get_sub_field('pneu_av_hauteur'), 'hauteur_pneu' );
$diametre_pneu = get_term( get_sub_field('pneu_av_diametre'), 'diametre_pneu' );
$size_pneu[] = $largeur_pneu->name.'/'.$hauteur_pneu->name.'-'.$diametre_pneu->name;
//echo $size_pneu;
endwhile;
endif;
if( have_rows('dimensions_ar', $post_id) ):
while( have_rows('dimensions_ar') ): the_row();
$largeur_pneu = get_term( get_sub_field('pneu_ar_largeur'), 'largeur_pneu' );
$hauteur_pneu = get_term( get_sub_field('pneu_ar_hauteur'), 'hauteur_pneu' );
$diametre_pneu = get_term( get_sub_field('pneu_ar_diametre'), 'diametre_pneu' );
$size_pneu[] = $largeur_pneu->name.'/'.$hauteur_pneu->name.'-'.$diametre_pneu->name;
//echo $size_pneu;
endwhile;
endif;
update_field('tailles_pneu', $size_pneu ,$post_id);
//var_dump($size_pneu);
//die;
}
// run before ACF saves the $_POST['acf'] data
add_action('acf/save_post', 'my_acf_save_post', 10);
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’re hard at work on ACF 6.1, and Beta 1 is now available 🚀
— Advanced Custom Fields (@wp_acf) March 16, 2023
This release includes custom post type and taxonomy registration, an improved experience when selecting field types, PHP 8.1 and 8.2 compatibility, and more!
Let’s take a look 🧵https://t.co/Y0WcAT11l4
© 2023 Advanced Custom Fields.
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.