How can I inspect $element variable in theme function?
If dpm($element) isn't returning output at that stage, you can log the data instead (temporarily) to the watchdog log.

e.g:

watchdog('dev', '&lt;pre&gt;' . var_export($element, 1) .'&lt;/pre&gt;');


You can then view it at Admin > Reports > Recent log entries