WordPress.org

Make WordPress Core

Ticket #13971: 13971-more-judicious.diff

File 13971-more-judicious.diff, 1.9 KB (added by markjaquith, 9 years ago)
  • wp-includes/default-filters.php

     
    8787}
    8888
    8989// Format WordPress
    90 foreach ( array( 'the_content', 'the_title', 'comment_text' ) as $filter )
    91         add_filter( $filter, 'capital_P_dangit' );
     90foreach ( array( 'the_content', 'comment_text' ) as $filter )
     91        add_filter( $filter, 'capital_P_gosh_dangit', 11 );
     92add_filter( 'the_title', 'capital_P_dangit' );
    9293
    9394// Format titles
    9495foreach ( 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

     
    28202820
    28212821/**
    28222822 * Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).
     2823 * Replaces all instances.
    28232824 *
    28242825 * Violating our coding standards for a good function name.
    28252826 *
    28262827 * @since 3.0.0
    28272828 */
     2829
    28282830function capital_P_dangit( $text ) {
    28292831        return str_replace( 'Wordpress', 'WordPress', $text );
    28302832}
    28312833
     2834/**
     2835 * Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).
     2836 * More selective version that tries to avoid cases where a URL might be bungled.
     2837 *
     2838 * Violating our coding standards for a good function name.
     2839 *
     2840 * @since 3.0.1
     2841 */
     2842function capital_P_gosh_dangit( $text ) {
     2843        static $dblq = false;
     2844        if ( false === $dblq )
     2845                $dblq = _x('“', 'opening curly quote');
     2846        return str_replace(
     2847                array( ' Wordpress', '‘Wordpress', $dblq . 'Wordpress', '>Wordpress', '(Wordpress' ),
     2848                array( ' WordPress', '‘WordPress', $dblq . 'WordPress', '>WordPress', '(WordPress' ),
     2849        $text );
     2850}
     2851
    28322852?>