wpseek.com
WordPress开发者和主题制作者的搜索引擎
capital_p_dangit › WordPress Function
Since3.0.0
已弃用n/a
› capital_p_dangit ( $text )
| 参数: |
|
| 返回: |
|
| 定义在: |
|
| 文档: |
Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).
Violating our coding standards for a good function name.Related Functions: privacy_ping_filter, user_can_edit_post_date, wp_install_defaults, get_all_page_ids, uninstall_plugin
源码
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
);
}