функция
since 3.0.0
capital_P_dangit()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
capital_P_dangit( string $text ): string
Описание
Нарушаем наши стандарты кодирования ради хорошего имени функции.
Оригинал (английский)
Violating our coding standards for a good function name.
Параметры
$text
string
обязательный
Текст для изменения.
Возвращаемое значение
string
Исходный код
wp-includes/formatting.php:5698
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 | Introduced. |

