function toUpperBlogDescription($info, $show) {
if ($show == 'blogdescription') {
$info = strtoupper($info);
}
return $info;
}
add_filter('bloginfo', 'toUpperBlogDescription')
Off the top of my head, something like that minus the error if any.
Thread Starter
fncll
(@fncll)
This gives an error looking for the second argument for toUpperBlogDescription…
I’m not sure if this code actually is doing what I am wanting to do, which is change the specific call to bloginfo(‘description’) rather than every instance of the bloginfo() function (which is built-in to PHP)
function toUpperBlogDescription($info, $show) {
if ($show == 'description') {
$info = strtoupper($info);
}
return $info;
}
//add_filter('filter_name', 'filter_func', priority, number of arguments)
add_filter('bloginfo', 'toUpperBlogDescription', 10, 2);
The filter function toUpperBlogDescription is indeed invoked for every call to bloginfo; however, only if you retrieve the description then the output is converted to uppercase.
Thread Starter
fncll
(@fncll)
Thanks! That did it. That last parameter when you call add_filter (the number of arguments) wasn’t shown on the wiki pages I was using… and it of course makes all the difference 🙂
I’m going to fix/update the wiki pages when I go back.