Is there a way to set the order of fields when appending fields to an existing metabox?
Right now, they show at the bottom of the metabox and I'd like them to show at the top.
<?php
add_filter( 'rwmb_meta_boxes', 'MYPREFIX_register_meta_boxes', 20 );
function MYPREFIX_register_meta_boxes( $meta_boxes ) {
global $meta_boxes;
foreach ( $meta_boxes as $k => $meta_box ) {
if ( isset( $meta_box['id'] ) && 'metaboxname' == $meta_box['id'] ) {
// Add custom fields to the "metaboxname" meta box
$meta_boxes[$k]['fields'][] = array(
'name' => __('Use Title', 'myid' ),
'id' => 'myid-use-title',
'clone' => false,
'type' => 'checkbox',
'std' => FALSE,
);
$meta_boxes[$k]['fields'][] = array(
'name' => __('Use Header', 'myid' ),
'id' => 'myid-use-header',
'clone' => false,
'type' => 'checkbox',
'std' => TRUE,
);
}
}
// Return edited meta boxes
return $meta_boxes;
}
?>