capital_P_dangit()函数是Wordpress函数,永远从这个星球上消除“Wordpress”(或者至少是我们能影响的一点点)。
capital_P_dangit( string $text )
永远从这个星球上消除“Wordpress”(或者至少是我们能影响的一点点)。
Forever eliminate “Wordpress” from the planet (or at least the little bit we can influence).
说明(Description)
为了一个好的函数名违反了我们的编码标准。
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$text | (string) | 必需 | 要修改的文本。 |
返回(Return)
(string)修改后的文本。
源码(Source)
/**
* Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).
*
* Violating our coding standards for a good function name.
*
* @since 3.0.0
*
* @staticvar string|false $dblq
*/
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 );
}
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
3.0.0 | wp-includes/formatting.php:5370 | 1 function | 2 |