[wp-hackers] Overwrite bloginfo() function

Claudio Simeone mrbrog at gmail.com
Tue Feb 26 12:27:22 GMT 2008

Hi all,

I'm considering to write a plugin to modify (or overwrite) the default
bloginfo() function without patching system files.

I would write a plugin that "overwrites" the bloginfo function if the
parameter is = 'template_directory" or "wpurl". Since these are values
that they often don't change on production sites, I thought that's is
less explensive for the database to write directly the url or
template_dir values without select them from the DB. This could be
useful on high traffic sites...

Eg. something this

Plugin Name: ...
Description: .......

define('SITE_URL', 'http://www.mysite.com');
define('TEMPL_DIR', 'http://www.mysite.com/wp-content/themes/default');

function bloginfo($show=''){
if ($show='wpurl') {
echo SITE_URL;
} elseif ($show='template_directory') {
} else {
// do the original stuff


I saw there's a function here:

can this be useful for me? Or there's no way to do that i want to do?

thanks in advance,

More information about the wp-hackers mailing list