bloginfo

bloginfo is a hook that is run on all items that are echoed using the bloginfo() function (note: but not get_bloginfo()).

Context:

File: wp-includes/template-functions-general.php
function bloginfo($show='') {
    $info = get_bloginfo($show);
    $info = apply_filters('bloginfo', $info, $show);
    echo convert_chars($info);
}

Two parameters are passed. The first holds the actual data returned by the get_bloginfo() call, and the second holds the name of the bloginfo() field being requested.

This hook can pass multiple parameters. In order to get additional parameters (up to 2 for this hook) passed to your function, you will have to hook in like this: add_filter('bloginfo', 'your_function', 10, 2); where 10 is your function's priority, and 2 is the number of parameters you want your function to accept. Note that your function should only return the first parameter.

This hook is a filter which means that information is passed through it, and then used by WordPress. Your function needs to accept that information, and return it. Using add_filter('bloginfo', 'your_function'); helps you to remember this distinction. When you are passing an ID, it is assumed that you will return the ID as it was given to you. With filters that pass strings or arrays, you may manipulate the information before passing it along.