Support

Account

Home Forums Backend Issues (wp-admin) Filter the priority of meta boxes

Solved

Filter the priority of meta boxes

  • Hi!

    Is it somehow possible to change the priority of meta boxes on the post screen from high to low? Maybe with a filter?

  • Hi @johan

    All ACF field groups are given a ‘high’ priority, but you can use the menu_order to move them around. This is a setting in each field group.

    Thanks
    E

  • Yes that’s correct but I have meta boxes from other plugins that also have their priority set to high and I would like to have all afc meta boxes last.

    It would have been a quick fix if I could have filtered the priority to low, but after a closer look it seems like that’s not possible.

    Do you know of any other way to achieve this? I was thinking about removing them with remove_meta_box() and then add them again with add_meta_box() but would that be safe?

  • Hi @johan

    The code that ACF uses to add the mtabox can be found on line 200 of core/controllers/post.php.

    Perhaps I should add in some filters for the position and priority?

    Cheers mate, I’ll ad it the to-do and let you know how I get on.

    For now, perhaps you can add in a custom filter for the time being?

    Thanks
    E

  • He Elliot

    It’s already possible to change the position so it might be a bit overkill to have a filter for that. But to either have a filter for the priority or possibility even to choose it in the administration where you can choose the position today, probably would not hurt.

    I’m leaning towards hard coding in apply_filters('afc_meta_box_priority', $priority) for now or use the $wp_meta_boxes array to reorder the meta boxes.

    Anyway thanks for all your help and again for an awesome plugin!

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

The topic ‘Filter the priority of meta boxes’ is closed to new replies.