Home Forums Front-end Issues ACF in user profile


ACF in user profile

  • Hi I am trying to pull a list of users filtered out by a Taxonomy field made in ACF. I have set the field up in ACF and it appears in the profile page as expected. However I want to pull this list out on the front end if the field matches UK. I tried the below:

    $my_acf_checkbox_field_arr = get_field('field_5d936a7fc6621');
    $finduser = get_users(
                    'role' => 'customer',
                    'meta_query' => array(
                            'key' => 'field_5d936a7fc6621',
                            'value' => 'UK',
                            'compare' => '=='
    foreach ( $findDealers as $user ) {
        echo '<div>' . esc_html( $user->user_email ) . '</div>';

    This doesn’t seem to work. I can bring all users back with the customer role fine, but when trying to use the ACF field as a key it doesn’t work. Am I doing it wrong?

    Any advice appreciated

  • 'key' => 'field_5d936a7fc6621',

    needs to be your field name, not the field key.

  • Ah perfect that sorted it thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘ACF in user profile’ is closed to new replies.