Skip Navigation

[Resolved] Is there a way to force Toolset metaboxes to top or bottom of screen

This support ticket is created 3 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 2 voices.

Last updated by caroleM-4 3 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#2204607

Hello,

I would like to be able to force some of Toolset metaboxes (custom field & relationships) to be always at the top of the list and others always at the bottom when editing a custom post or at least to be able to set their default position and keep it as long as user does not move them as well as keep user defined position properly because I noticed that they actually change position very often, no matter if user did move them or not, which is quite annoying as some of them are needed on a regular base and other ones are just informational or less needed.

Is there a way to achieve that without getting into too much complications ?

Thanks in advance for your help.

#2205097

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Carole,

Thank you for getting in touch. This section is managed by wordpress core itself and the only way it can be done is by rearranging them on the backend.

There doesn't seem to be an alternative way of doing it.

Thanks,
Shane

#2205791

Thanks for the feedback Shane but I really needed at least to get part of Toolset meta boxes to the advanced context to avoid getting editors lost so I ended up using :

function reorder_metaboxes(){
  global $post, $wp_meta_boxes;
  $post_type = get_post_type( $post );

  foreach ( $wp_meta_boxes[ $post_type ]['normal']['high'] as $key => $metabox ) {
    if ( 'wpcf-group-zzz-' === substr( $key, 0, 15 ) || $key === 'wpseo_meta') {

      unset( $wp_meta_boxes[$post_type]['normal']['high'][$key] );

      if ( empty( $wp_meta_boxes[$post_type]['advanced'] ) ) {
        $wp_meta_boxes[$post_type]['advanced'] = [];
      }
      if ( empty( $wp_meta_boxes[$post_type]['advanced']['low'] ) ) {
        $wp_meta_boxes[$post_type]['advanced']['low'] = [];
      }
      $wp_meta_boxes[$post_type]['advanced']['low'][$key] = $metabox;
    }
  }
}
add_action( 'add_meta_boxes', 'reorder_metaboxes', 999 );

This allows me to move all Toolset meta boxes with name prefixed by ZZZ to the advanced context with low priority as well as Yoast one which is added first and thus plays the separator role at the top of the section which is perfect in our case. Of course it won't apply for users who defined custom order but that's ok for me as the goal is essentially to target users who won't.

As for the fact that meta boxes ordering is part of the core functionalities, I perfectly agree, but Toolset ones are declared by Toolset which means it would be relatively easy to allow us to define their context and priority in the field groups settings.

Could be a nice feature addition for a future version 🙂

#2206375

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Carole,

In such a case to get this added you will need to submit a feature request by going to the link below and filling out the form with the details of the request.
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

Once you've done this the request will be logged and reviewed by our development team.

Thanks,
Shane

#2206379

Ok, thanks.