How should I order custom blocks? I have two blocks in a custom module.

function THEME_block_info(){
    $blocks = array();

    $blocks['contact_info'] = array(
        'info' =&gt; t('Contact Info Block'),//admin ui block name
    );
    $blocks['contact_form'] = array(
        'info' =&gt; t('Contact Form Block'),//admin ui block name
    return $blocks;
}

function THEME_block_view($delta = ''){
    $block = array();

    switch($delta){
        case 'contact_form':{
            $block['subject'] = t('');
            $block['content'] = build_contact($delta);
            break;
        }
        case 'contact_info':{
            $block['subject'] = t('');
            $block['content'] = build_contact($delta);
            break;
        }

}


These blocks show up in the admin UI where we are able to order them. However, the order set in the admin UI doesn't work.

How should I set the order of these custom blocks to make it match the one sets in through the UI?
You can use 'weight' for every block.

$blocks['contact_info'] = array(
  'info' =&gt; t('Contact Info Block'),//admin ui block name
  'weight' =&gt; 0,
);

$blocks['contact_form'] = array(
  'info' =&gt; t('Contact Form Block'),
  'weight' =&gt; 1,
);


I hope this will work for you :)