Add #theme_wrapper after drupal_render() is called I have a render array:

$element = array(
   '#theme' =&gt; 'custom_theme_func',
);

drupal_render($element);


I have a preprocess function in which I'd like to add theme wrappers to this render array:

function my_module_custom_theme_func(&amp;$element)
{
    $element['theme_wrappers'] = array('some_theme_func');
}


The problem that I'm running into is that some_theme_func() is not being called.  If I add it to the list of theme wrappers before I call drupal_render(), however, it works.
There are two errors in your code:


If you use '#theme' =&gt; 'custom_theme_func' to reference the theme function, Drupal will look for theme_custom_theme_func(), not my_module_custom_theme_func().
The argument a theme function gets is always $variables, an array that in your case probably contains $variables['element'].
What exactly that array contains depends from the definition given in the implementation of hook_theme(). For example, theme_status_report() is defined as:

'status_report' =&gt; array(
  'render element' =&gt; 'requirements', 
  'file' =&gt; 'system.admin.inc',
), 


The array it gets contains $variables['requirements'].  

theme_image() is defined as:

'image' =&gt; array(
  'variables' =&gt; array('path' =&gt; NULL, 'width' =&gt; NULL, 'height' =&gt; NULL, 'alt' =&gt; '', 'title' =&gt; NULL, 'attributes' =&gt; array()),
), 


The array it gets can contain $variables['path'], $variables['width'], $variables['height'], $variables['alt'], $variables['title'], and $variables['attributes'].


As for setting #theme_wrappers, setting them in the theme function doesn't have any effect, as the theme function doesn't receive the $variables array as reference; therefore, it cannot change its content, and pass those changes back to drupal_render().

As zdecibel said, you can use the preprocess function to set the theme wrappers, even if it is probably better to define them directly in the code you shown at the beginning (the first 3 lines), as you are not dynamically changing the theme wrappers. (At least, that is what you shown in your code.)