• Resolved caiocrcosta

    (@caiocrcosta)


    Hello! Why is the default Label Placement of new Field Groups set to Left instead of Top? I was wondering what was the rationale behind this decision as the “Left” layout creates an entire column just for the field labels. Usually I’d rather use as much whitespace as possible for the fields, so this forces me to (remember to) set the label placement of each new field group back to “Top”, as it’s default for vanilla ACF.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello @caiocrcosta,

    Thanks for the feedback. Left aligned fields are designed for complex field groups which have many fields. The UI keeps things more clean, and clearly separate field labels from actual fields input. It’s a more sophisticated version of the native WP admin screens (label on left, input on right). https://i.imgur.com/c7ZGZsf.png

    That’s also why ACF native Field Group UI use this layout, because it’s easier for the user to understand the UI. https://i.imgur.com/bPIO2rP.png

    Have a nice day!

    Regards.

    Thread Starter caiocrcosta

    (@caiocrcosta)

    Hello @hwk-fr, thanks for the quick reply! It all makes sense now. I’m marking this as resolved since my question was answered, but I’d like to say I’d rather have an option (or a hook, perhaps) to make all fields have their labels default to Top instead. Here’s hope this makes sense and, if it does, you have some time in the future to implement something like this. Thanks again!

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Good news, there’s already a hook to reset the default label placement when adding a new field group 🙂

    You can use the following code in your functions.php file:

    
    add_filter('acf/validate_field_group', 'my_acf_field_group_default_label_placement', 20);
    function my_acf_field_group_default_label_placement($field_group){
        
        // Bail early early if it's not a new field group
        if(acf_maybe_get($field_group, 'location'))
            return $field_group;
        
        // Default label placement: Top
        $field_group['label_placement'] = 'top';
        
        return $field_group;
        
    }
    

    Have a nice day!

    Regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Label Placement is set to left by default — why?’ is closed to new replies.