How can I insert a variable from a preprocess function in template.php to Block Body in admin Seems like a pretty easy thing to do, but I am having a hard time in using a variable from function theme_preprocess_block(&amp;$variables, $hook) in template.php in a Block body in admin.

For example, in template.php, I have:-

function theme_preprocess_block(&amp;$variables, $hook) {
  $variables['theme_url'] =  base_path().drupal_get_path('theme', variable_get('theme_default', NULL));

}


From here, I want to use theme_url variable in Block Body in admin as shown:-



It's not happening through the shown way. Any idea how I can achieve that?

Thanks.
You can't do that.

The block content doesn't ahve access to variables you add in the block preprocess function.
The block preprocess function code runs after the block content has been generated.

Since you have a PHP block just add that code from your preprocess function directly to it.

So put this at the top of your block content:

$theme_url = base_path() . drupal_get_path('theme', variable_get('theme_default', NULL));