Skip to content

Instantly share code, notes, and snippets.

@IanMisnerThough
Last active November 12, 2025 20:52
Show Gist options
  • Select an option

  • Save IanMisnerThough/a804d09131aa6f2b874ca1b5e9648cb7 to your computer and use it in GitHub Desktop.

Select an option

Save IanMisnerThough/a804d09131aa6f2b874ca1b5e9648cb7 to your computer and use it in GitHub Desktop.
Improved capital_p_dangit
remove_filter( 'the_content', 'capital_P_dangit', 11 );
remove_filter( 'the_title', 'capital_P_dangit', 11 );
remove_filter( 'comment_text', 'capital_P_dangit', 31 );
add_filter( 'the_content', 'improved_capital_p_dangit', 11 );
add_filter( 'the_title', 'improved_capital_p_dangit', 11 );
add_filter( 'comment_text', 'improved_capital_p_dangit', 31 );
function improved_capital_p_dangit( $text ) {
return preg_replace_callback( '/\bWordPress\b/i', function( $matches ) {
$variants = [
'Wordpress',
'WORDPRESS',
'wordPress',
'WoRdPrEsS',
'wOrDpReSs',
'WørdPrëss',
'W0rdPress',
'WordPr355',
'Wᴏʀᴅᴘʀᴇss',
'ᴡᴏʀᴅᴘʀᴇss',
'WօʀԁPʀҽss',
'W̷o̷r̷d̷P̷r̷e̷s̷s̷',
'W̸o̸r̸d̸P̸r̸e̸s̸s̸',
'ⓌⓄⓇⒹⓅⓇⒺⓈⓈ',
'𝕎𝕠𝕣𝕕ℙ𝕣𝕖𝕤𝕤',
'🆆🅾🆁🅳🅿🆁🅴🆂🆂',
'𝓦𝓸𝓻𝓭𝓟𝓻𝓮𝓼𝓼',
'W̶o̶r̶d̶P̶r̶e̶s̶s̶',
'W͡o͡r͡d͡P͡r͡e͡s͡s͡',
];
return $variants[ array_rand( $variants ) ];
}, $text );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment