mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Add some filtering. Props jhodgdon. see #4516
git-svn-id: https://develop.svn.wordpress.org/trunk@5998 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -60,19 +60,7 @@ function wp_meta() {
|
||||
|
||||
|
||||
function bloginfo($show='') {
|
||||
$info = get_bloginfo($show);
|
||||
|
||||
// Don't filter URL's.
|
||||
if (strpos($show, 'url') === false &&
|
||||
strpos($show, 'directory') === false &&
|
||||
strpos($show, 'home') === false) {
|
||||
$info = apply_filters('bloginfo', $info, $show);
|
||||
$info = convert_chars($info);
|
||||
} else {
|
||||
$info = apply_filters('bloginfo_url', $info, $show);
|
||||
}
|
||||
|
||||
echo $info;
|
||||
echo get_bloginfo($show, 'display');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,7 +69,7 @@ function bloginfo($show='') {
|
||||
* without "// DEPRECATED" are the preferred and recommended ways
|
||||
* to get the information.
|
||||
*/
|
||||
function get_bloginfo($show='') {
|
||||
function get_bloginfo($show = '', $filter = 'raw') {
|
||||
|
||||
switch($show) {
|
||||
case 'url' :
|
||||
@@ -153,6 +141,20 @@ function get_bloginfo($show='') {
|
||||
$output = get_option('blogname');
|
||||
break;
|
||||
}
|
||||
|
||||
$url = true;
|
||||
if (strpos($show, 'url') === false &&
|
||||
strpos($show, 'directory') === false &&
|
||||
strpos($show, 'home') === false)
|
||||
$url = false;
|
||||
|
||||
if ( 'display' == $filter ) {
|
||||
if ( $url )
|
||||
$output = apply_filters('bloginfo_url', $output, $show);
|
||||
else
|
||||
$output = apply_filters('bloginfo', $output, $show);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user