diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
index ce2c851bc5..9df4e9b7a8 100644
|
a
|
b
|
function wp_basename( $path, $suffix = '' ) { |
| 5078 | 5078 | } |
| 5079 | 5079 | |
| 5080 | 5080 | /** |
| 5081 | | * Forever eliminate "WordPress" from the planet (or at least the little bit we can influence). |
| | 5081 | * Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence). |
| 5082 | 5082 | * |
| 5083 | 5083 | * Violating our coding standards for a good function name. |
| 5084 | 5084 | * |
| … |
… |
function capital_P_dangit( $text ) { |
| 5093 | 5093 | // Simple replacement for titles |
| 5094 | 5094 | $current_filter = current_filter(); |
| 5095 | 5095 | if ( 'the_title' === $current_filter || 'wp_title' === $current_filter ) { |
| 5096 | | return str_replace( 'WordPress', 'WordPress', $text ); |
| | 5096 | return str_replace( 'Wordpress', 'WordPress', $text ); |
| 5097 | 5097 | } |
| 5098 | 5098 | // Still here? Use the more judicious replacement |
| 5099 | 5099 | static $dblq = false; |
diff --git a/tests/phpunit/tests/formatting/CapitalPDangit.php b/tests/phpunit/tests/formatting/CapitalPDangit.php
new file mode 100644
index 0000000000..27411c4cf8
|
-
|
+
|
|
| | 1 | <?php |
| | 2 | |
| | 3 | /** |
| | 4 | * @group formatting |
| | 5 | */ |
| | 6 | class Tests_Formatting_CapitalPDangit extends WP_UnitTestCase { |
| | 7 | function test_esc_attr_quotes() { |
| | 8 | global $wp_current_filter; |
| | 9 | $this->assertEquals('Something about WordPress', capital_P_dangit('Something about Wordpress')); |
| | 10 | $this->assertEquals('Something about (WordPress', capital_P_dangit('Something about (Wordpress')); |
| | 11 | $this->assertEquals('Something about ‘WordPress', capital_P_dangit('Something about ‘Wordpress')); |
| | 12 | $this->assertEquals('Something about “WordPress', capital_P_dangit('Something about “Wordpress')); |
| | 13 | $this->assertEquals('Something about >WordPress', capital_P_dangit('Something about >Wordpress')); |
| | 14 | $this->assertEquals('Wordpress', capital_P_dangit('Wordpress')); |
| | 15 | |
| | 16 | $wp_current_filter = array('the_title'); |
| | 17 | $this->assertEquals('WordPress', capital_P_dangit('Wordpress')); |
| | 18 | } |
| | 19 | } |