capital_p_dangit
函数
capital_p_dangit ( $text )
- 参数
-
-
(string)
$text
The text to be modified.- Required: 是
-
(string)
- 返回值
-
- (string) The modified text.
- 定义位置
-
-
wp-includes/formatting.php
, line 5537
-
wp-includes/formatting.php
- 引入
- 3.0.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.
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
);
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。