Ticket #4516: general-template-php.diff

File general-template-php.diff, 1.4 KB (added by jhodgdon, 6 years ago)

Patch for general-template.php that adds $filter arg to get_bloginfo function (and takes filtering out of bloginfo function)

  • E:/EclipseWork/WordPressDev/wp-includes/general-template.php

     
    6060 
    6161 
    6262function bloginfo($show='') { 
    63         $info = get_bloginfo($show); 
    64  
    65         // Don't filter URL's. 
    66         if (strpos($show, 'url') === false && 
    67                 strpos($show, 'directory') === false && 
    68                 strpos($show, 'home') === false) { 
    69                 $info = apply_filters('bloginfo', $info, $show); 
    70                 $info = convert_chars($info); 
    71         } else { 
    72                 $info = apply_filters('bloginfo_url', $info, $show); 
    73         } 
    74  
    75         echo $info; 
     63        echo get_bloginfo($show, true); 
    7664} 
    7765 
    7866/** 
     
    8169 * without "// DEPRECATED" are the preferred and recommended ways  
    8270 * to get the information. 
    8371 */ 
    84 function get_bloginfo($show='') { 
     72function get_bloginfo($show='', $filter=false) { 
    8573 
    8674        switch($show) { 
    8775                case 'url' : 
     
    153141                        $output = get_option('blogname'); 
    154142                        break; 
    155143        } 
     144    if( $filter ) { 
     145                // Don't filter URL's. 
     146                if (strpos($show, 'url') === false && 
     147                        strpos($show, 'directory') === false && 
     148                        strpos($show, 'home') === false) { 
     149                        $output = apply_filters('bloginfo', $output, $show); 
     150                        $output = convert_chars($output); 
     151                } else { 
     152                        $output = apply_filters('bloginfo_url', $output, $show); 
     153                } 
     154    } 
     155 
    156156        return $output; 
    157157} 
    158158