Alright, I’m pretty sure this has been done before.

Scenario: I need to access bloginfo() function from inside a script block on my custom theme.

Solution (partial): A partial solution to this is easily remedied with minimal code. However, this solution only allows default bloginfo() to be retrieved.

The following function goes inside your theme’s functions.php file: