Display custom block to specific content type programmatically I created one custom module, it will create one custom block when it is installed. I want to display it on "product" content type only. Can I do the same with programmatically. It'll save my time. Here is my code.

&lt;?php
function my_module_block_info() {
    $blocks = array();

    $blocks['my_module_config'] = array(
            'info' =&gt; t('My Module'),
    );
    return $blocks;
}


/**
 * Implements hook_block_view().
 */
function my_module_block_view($delta = '') {
    $block = array();

    switch ($delta) {
        case 'my_module_config':
            $my_module_form = drupal_get_form('my_module_form');
            $my_module_form = drupal_render($my_module_form);
            $block['subject'] = '';
            $block['content'] = $my_module_form;
            break;
    }
    return $block;
}
?&gt;
This code should work for you

function my_module_block_info() {
  $blocks = array();
  $blocks['my_module_config'] = array(
    'info' =&gt; t('My Module'),
    'status' =&gt; TRUE,
    'region' =&gt; 'content',
  );
  return $blocks;
}


/**
 * Implements hook_block_view().
 */
 function my_module_block_view($delta = '') {
 $block = array();

 switch ($delta) {
   case 'my_module_config':
     $block['subject'] = '';
     $node = menu_get_object();
     if (isset($node-&gt;type) &amp;&amp; $node-&gt;type == 'product') {
       $my_module_form = drupal_get_form('my_module_form');
       $my_module_form = drupal_render($my_module_form);
       $block['content'] = $my_module_form;
     }
     else {
       $block['content'] = '';
     }
     break;
  }
  return $block;
}