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.


  • $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 );




  1. WordPressing its Luck « COM585 - November 7, 2011

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

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: