Drupal and “WordPress”

A small number of people will chuckle at this:

<?php
/* modules/capitalP/capitalP.module */
function capitalP_filter($op, $delta = 0, $format = -1, $text = '') {
  switch ( $op ) {
    case 'list' :
      return array(0 => 'capitalP');

    case 'description' :
      return 'Forces the capital "P" in WordPress. To bypass the filter, use quotes: "Wordpress" or \'Wordpress\'.';

    case 'prepare' :
      return $text;

    case 'process' :
      return preg_replace('/(?<!["\'])Wordpress(?!\.?["\'])/', 'WordPress', $text);
 }
}
?>

Published by

Andy Skelton

Code Wrangler @ Automattic youtube.com/AndySkelton

4 thoughts on “Drupal and “WordPress””

Comments are closed.