函数原型
capital_P_dangit( string $text ): string
函数描述
Forever eliminate “Wordpress” from the planet (or at least the little bit we can influence).
是否弃用
未弃用
函数参数
-
$text
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. |

