Make WordPress Core

Changeset 4308


Ignore:
Timestamp:
10/04/2006 06:07:48 AM (20 years ago)
Author:
markjaquith
Message:

Allow user replacement of cockney replacement array. fixes #1032

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r4283 r4308  
    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.