And is it possible with an array ?
like this :
‘meta_query’ => array(
array(
‘key’ => ‘radio_field_name’,
‘value’ => [‘1′,’2’],
‘compare’ => ‘IN’
)
I need to make it work this way because It’s possible that my user won’t search by this meta_field, so I need to get them all
Hm..
simpler :
How to search on a radio ACF field with WP_Query ?
This is simple:
1 / My users have a ‘pieds’ field (radio) which they can set to Gauche / Droite
2 / I have a homemade searchform, and when form is submitted I’m making a wp_query request with args on the post informations.
3 / My ‘pieds’ searchfield is not working, I don’t know how to get users depending on the radio field. What should I put in my wp_query ? I need to use the same request when searchfield is set or no. (If not set get all users, if set get only users where meta is corresponding”
PRoblem is that I’m coding a search system.
So there is 3 possibilities :
I’m searching for post who have meta ‘pieds’ set to ‘gauche’ or ‘droite’ for when radio is not checked at all
I’m searching post who have meta pied set to ‘gauche’
I’m searching post who have meta pied set to ‘droite’
How can I do something like this in a meta_query ?
No this is not what I’m talking about.
I’m asking, how in my register form I can display acf field depending on rôle selected on the form.
I can’t edit the rôle selection field because it’s the wordpress one, not a acf field.
I don’t need php solution but ajax or js solution, or acf core solution.
Right here :
https://lebonfoot.fr/register/
while footballeur rôle is not selected, all the ‘informations joueur’ bloc shoul not be displayed.
Moreover, every conditionnal logic between fields are not working, look like acf javascript is not called at all on this page ?
This is all my template file :
<?php
acf_form_head();
get_header();
$author = wp_get_current_user();
$author_id = get_current_user_ID();
?>
<?php
$options = array(
‘post_id’ => ‘user_’.get_current_user_ID(), // $user_profile,
‘field_groups’ => array(115),
‘submit_value’ => ‘Enregistrer’,
‘updated_message’ => __(“Profil mis à jour”, ‘acf’),
);
acf_form( $options );
?>
<?php
get_footer();
?>
As you can see there’s nothing wrong with this template file.
@acf-support hey wassup ? Are you here ?
@acf-support Hi, I didn’t succeed to solve my problem. Maybe you’ll need more informations ?
Hi @acf-support , yes this is the first function in my php file. More over, after submitting my form the url I’m redirected to is this one : myurl.com/?updated=true
My acf_form_head() is loaded before my get_header() so it should not be the problem :/
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.