capital_P_dangit()

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.0wp-includes/formatting.php:53701 function2
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索