capital_P_dangit()
capital_P_dangit( string $text ) 永远从这个星球上消除“Wordpress”(…
capital_P_dangit( string $text )
永远从这个星球上消除“Wordpress”(或者至少是我们能影响的一点点)。
Forever eliminate “Wordpress” from the planet (or at least the little bit we can influence).
永远从这个星球上消除“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 |
笔记(Notes)
例子
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。
还没有任何评论,赶紧来占个楼吧!