WordPress.org

Make WordPress Core

Changeset 15377


Ignore:
Timestamp:
07/08/10 19:35:29 (5 years ago)
Author:
markjaquith
Message:

More judicious Wordpress-to-WordPress correction, to avoid bungling reasonable URLs. fixes #13971

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/default-filters.php

    r15254 r15377  
    8989// Format WordPress 
    9090foreach ( array( 'the_content', 'the_title', 'comment_text' ) as $filter ) 
    91     add_filter( $filter, 'capital_P_dangit' ); 
     91    add_filter( $filter, 'capital_P_dangit', 11 ); 
    9292 
    9393// Format titles 
  • trunk/wp-includes/formatting.php

    r15355 r15377  
    28262826 * @since 3.0.0 
    28272827 */ 
     2828 
    28282829function 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 
    28302842} 
    28312843 
Note: See TracChangeset for help on using the changeset viewer.