• Resolved mwojtaszek

    (@mwojtaszek)


    I use a simple filter consisting of several checkboxes. They refer to checkboxes ACF fields. In my ACF checkboxes I have a list of choices in the “value : label” format.
    In the filter I use on my site though I see the values are being displayed, not the labels which I expected.

    Is there a way to have the labels displayed in the filter, not the values?

    Thanks in advance for your advice!

    Marek

    • This topic was modified 2 years, 11 months ago by mwojtaszek.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • I also use this plugin and faced the same problem.
    In addition, my filter labels are not updated when new ones are added to AСF choices and updated. For more details please send me to [email protected]

    Ilya

    Plugin Author stepasyuk

    (@stepasyuk)

    Hello @mwojtaszek and @ikazyamov

    Thank you for using the plugin and sorry for the late reply.
    In your cases you can add desired labels to your filters by custom fields with this code example:

    add_filter('wpc_filter_post_meta_term_name', 'wpc_custom_term_name', 20, 1);
    function wpc_custom_term_name($term_name)
    {
        if( $term_name === 'value_1'){
            $term_name = 'Label 1';
        }
    
        if( $term_name === 'value_2'){
            $term_name = 'Label 2';
        }
        // repeat this condition for every filter term 
    
        return $term_name;
    }

    Unfortunately for the moment Filter Everything “does not know” what labels is used in ACF.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to display labels, not values?’ is closed to new replies.