WordPress.org

Make WordPress Core

Changeset 4309


Ignore:
Timestamp:
10/04/06 06:08:06 (8 years ago)
Author:
markjaquith
Message:

Allow user replacement of cockney replacement array. fixes #1032

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-includes/functions-formatting.php

    r4240 r4309  
    22 
    33function wptexturize($text) { 
     4    global $wp_cockneyreplace; 
    45    $output = ''; 
    56    // Capture tags and everything inside them 
     
    1718            $curl = str_replace('``', '“', $curl); 
    1819 
    19             // This is a hack, look at this more later. It works pretty well though. 
    20             $cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause"); 
    21             $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause"); 
     20            // if a plugin has provided an autocorrect array, use it 
     21            if ( isset($wp_cockneyreplace) ) { 
     22                $cockney = array_keys($wp_cockneyreplace); 
     23                $cockney_replace = array_values($wp_cockneyreplace); 
     24            } else { 
     25                $cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause"); 
     26                $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause"); 
     27            } 
     28 
    2229            $curl = str_replace($cockney, $cockneyreplace, $curl); 
    2330 
Note: See TracChangeset for help on using the changeset viewer.