From theme() to drupal_render() I'm a Drupal themer, learning how to develop for Drupal. Currently I'm reading a book called Drupal 7 Module Development in which the following code is used.

/**
 * Implements hook_block_view().
*/
function first_block_view($delta = '') {
  if ($delta == 'list_modules') {
    $list = module_list();

    $theme_args = array(
        'items' =&gt; $list,
        'type' =&gt; 'ol'
    );
    $content = theme('item_list', $theme_args);

    $block = array(
        'subject' =&gt; t('Enabled Modules'),
        'content' =&gt; $content,
    );

    return $block;
  }
}


Its a simple module that returns a ordered list of all the enabled modules. Notice they are using the theme() function.

As a themer, I wanted to know more about this function, so I looked it up on drupal.org, and saw this:


  Avoid calling this function directly. It is preferable to replace direct calls to the theme() function with calls to drupal_render() by passing a render array with a #theme key to drupal_render(), which in turn calls theme().


So I tried replacing it with drupal_render(), and came up with this:

/**
 * Implements hook_block_view().
 */
function first_block_view($delta = '') {
  if ($delta == 'list_modules') {
    $list = module_list();

    $theme_args = array(
        '#theme' =&gt; 'theme_args',
        'items' =&gt; $list,
        'type' =&gt; 'ol'
    );
    $content = drupal_render($theme_args);

    $block = array(
        'subject' =&gt; t('Enabled Modules'),
        'content' =&gt; $content,
    );

    return $block;
  }
}


This however, is giving an error: Theme hook theme_args not found.
Am I missing something? I would appreciate any help, and if possible, an explanation of what I did wrong. (since I'm learning this stuff.)

I've seen a similar question posted here, and followed its instruction, but no success.
How to rewrite this theme call to drupal_render
I think there is a typo.

Just replace 

'#theme' =&gt; 'theme_args',


with 

'#theme' =&gt; 'item_list',


There is no theme called "theme_args".