Definition:
function capital_P_dangit( $text ) {}
Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).
Violating our coding standards for a good function name.
Parameters
- $text
Source code
function capital_P_dangit( $text ) {
// Simple replacement for titles
if ( 'the_title' === current_filter() )
return str_replace( 'Wordpress', 'WordPress', $text );
// Still here? Use the more judicious replacement
static $dblq = false;
if ( false === $dblq )
$dblq = _x('“', 'opening curly quote');
return str_replace(
array( ' WordPress', '‘WordPress', $dblq . 'Wordpress', '>Wordpress', '(WordPress' ),
array( ' WordPress', '‘WordPress', $dblq . 'WordPress', '>WordPress', '(WordPress' ),
$text );
}
583

February 11, 2011 


Trackbacks/Pingbacks
[…] Tadlock chronicles the consequences of Matt Mullenweg’s frustrating filter function – capital_P_dangit: […]