Uses
Uses | Description |
---|---|
wp-includes/l10n.php: _x() | Retrieve translated string with gettext context. |
wp-includes/plugin.php: current_filter() | Retrieve the name of the current filter or action. |
Forever eliminate “Wordpress” from the planet (or at least the little bit we can influence).
Violating our coding standards for a good function name.
(string) (Required) The text to be modified.
(string) The modified text.
File: wp-includes/formatting.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( '“', 'opening curly double quote' ); } return str_replace( array( ' Wordpress', '‘Wordpress', $dblq . 'Wordpress', '>Wordpress', '(Wordpress' ), array( ' WordPress', '‘WordPress', $dblq . 'WordPress', '>WordPress', '(WordPress' ), $text ); }
Version | Description |
---|---|
3.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/capital_p_dangit