Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Hacks
    In reply to: Re-ordering metaboxes
    Thread Starter joselov

    (@joselov)

    I found the solution by myself.
    To anyone that is having the same problem, rather than remove_meta_box and add_meta_box, simply include this:

    // Global the $wp_meta_boxes variable (this will allow us to alter the array)
    global $wp_meta_boxes;
    
    // Then we make a backup of your widget
    $my_widget = $wp_meta_boxes['dashboard']['normal']['core']['{widget id here}'];
    
    // We then unset that part of the array
    unset($wp_meta_boxes['dashboard']['normal']['core']['{widget id here}']);
    
    // Now we just add your widget back in
    $wp_meta_boxes['dashboard']['side']['core']['{widget id here}'] = $my_widget;

    inside a function and ‘add_action’ with ‘add_meta_boxes’ hook.

    I find this here.

    Thread Starter joselov

    (@joselov)

    I just found a solution.
    The problem was I had a function to prevent drag of metaboxes and that was generating the conflict. This was made a conflict with the ‘add new terms’ function to taxonomies (hierarchical or not).

Viewing 2 replies - 1 through 2 (of 2 total)