Ticket #13971: 13971-more-judicious.002.diff
| File 13971-more-judicious.002.diff, 1.4 KB (added by , 16 years ago) |
|---|
-
wp-includes/default-filters.php
88 88 89 89 // Format WordPress 90 90 foreach ( array( 'the_content', 'the_title', 'comment_text' ) as $filter ) 91 add_filter( $filter, 'capital_P_dangit' );91 add_filter( $filter, 'capital_P_dangit', 11 ); 92 92 93 93 // Format titles 94 94 foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description' ) as $filter ) { -
wp-includes/formatting.php
2825 2825 * 2826 2826 * @since 3.0.0 2827 2827 */ 2828 2828 2829 function capital_P_dangit( $text ) { 2829 return str_replace( 'Wordpress', 'WordPress', $text ); 2830 // Simple replacement for titles 2831 if ( 'the_title' === current_filter() ) 2832 return str_replace( 'Wordpress', 'WordPress', $text ); 2833 // Still here? Use the more judicious replacement 2834 static $dblq = false; 2835 if ( false === $dblq ) 2836 $dblq = _x('“', 'opening curly quote'); 2837 return str_replace( 2838 array( ' Wordpress', '‘Wordpress', $dblq . 'Wordpress', '>Wordpress', '(Wordpress' ), 2839 array( ' WordPress', '‘WordPress', $dblq . 'WordPress', '>WordPress', '(WordPress' ), 2840 $text ); 2841 2830 2842 } 2831 2843 2832 2844 ?>