diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
index ce2c851bc5..9df4e9b7a8 100644
--- a/src/wp-includes/formatting.php
+++ b/src/wp-includes/formatting.php
@@ -5078,7 +5078,7 @@ function wp_basename( $path, $suffix = '' ) {
 }
 
 /**
- * Forever eliminate "WordPress" from the planet (or at least the little bit we can influence).
+ * Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).
  *
  * Violating our coding standards for a good function name.
  *
@@ -5093,7 +5093,7 @@ 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 );
+		return str_replace( 'Wordpress', 'WordPress', $text );
 	}
 	// Still here? Use the more judicious replacement
 	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
--- /dev/null
+++ b/tests/phpunit/tests/formatting/CapitalPDangit.php
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_CapitalPDangit extends WP_UnitTestCase {
+	function test_esc_attr_quotes() {
+        global $wp_current_filter;
+        $this->assertEquals('Something about WordPress', capital_P_dangit('Something about Wordpress'));
+        $this->assertEquals('Something about (WordPress', capital_P_dangit('Something about (Wordpress'));
+        $this->assertEquals('Something about &#8216;WordPress', capital_P_dangit('Something about &#8216;Wordpress'));
+        $this->assertEquals('Something about &#8220;WordPress', capital_P_dangit('Something about &#8220;Wordpress'));
+        $this->assertEquals('Something about >WordPress', capital_P_dangit('Something about >Wordpress'));
+        $this->assertEquals('Wordpress', capital_P_dangit('Wordpress'));
+
+        $wp_current_filter = array('the_title');
+        $this->assertEquals('WordPress', capital_P_dangit('Wordpress'));
+    }
+}
