WordPress.org

Make WordPress Core

Ticket #26850: 26850.6.diff

File 26850.6.diff, 1.1 KB (added by miqrogroove, 7 years ago)

Exclude decimals. Increase priority to favor possessive abbr. vs. quoted numbers.

  • src/wp-includes/formatting.php

     
    100100                // Pattern-based replacements of characters.
    101101                $dynamic = array();
    102102
     103                // '99 '99s '99's (apostrophe)  But never '9 or '999 or '99.0.
     104                if ( "'" !== $apos ) {
     105                        $dynamic[ '/\'(?=\d\d(?:\Z|(?!\d|[.,]\d)))/' ] = $apos;
     106                }
     107
    103108                // Quoted Numbers like "42" or '42.00'
    104109                if ( '"' !== $opening_quote && '"' !== $closing_quote ) {
    105110                        $dynamic[ '/(?<=\A|' . $spaces . ')"(\d[\d\.\,]*)"/' ] = $opening_quote . '$1' . $closing_quote;
     
    108113                        $dynamic[ '/(?<=\A|' . $spaces . ')\'(\d[\d\.\,]*)\'/' ] = $opening_single_quote . '$1' . $closing_single_quote;
    109114                }
    110115
    111                 // '99 '99s '99's (apostrophe)
    112                 if ( "'" !== $apos ) {
    113                         $dynamic[ '/\'(?=\d)/' ] = $apos;
    114                 }
    115 
    116116                // Single quote at start, or preceded by (, {, <, [, ", -, or spaces.
    117117                if ( "'" !== $opening_single_quote ) {
    118118                        $dynamic[ '/(?<=\A|[([{<"\-]|' . $spaces . ')\'/' ] = $opening_single_quote;