WordPress at a glance

capital_P_dangit() WP 1.0

Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).

Violating our coding standards for a good function name.

  • Static. String/false. $dblq

No Hooks.

Return

String. The modified text.

Usage

capital_P_dangit( $text );
$text(string) (required)
The text to be modified.

Code of capital_P_dangit: wp-includes/formatting.php VER 4.9.8

<?php
function capital_P_dangit( $text ) {
	// Simple replacement for titles
	$current_filter = current_filter();
	if ( 'the_title' === $current_filter || 'wp_title' === $current_filter )
		return str_replace( 'Wordpress', 'WordPress', $text );
	// Still here? Use the more judicious replacement
	static $dblq = false;
	if ( false === $dblq ) {
		$dblq = _x( '&#8220;', 'opening curly double quote' );
	}
	return str_replace(
		array( ' Wordpress', '&#8216;Wordpress', $dblq . 'Wordpress', '>Wordpress', '(Wordpress' ),
		array( ' WordPress', '&#8216;WordPress', $dblq . 'WordPress', '>WordPress', '(WordPress' ),
	$text );
}

Related Functions

From category: Formatting

No comments
    Hello, !     Log In . Register