{"id":2030,"date":"2010-08-02T08:05:27","date_gmt":"2010-08-02T07:05:27","guid":{"rendered":"http:\/\/www.bitvolution.com\/?p=870"},"modified":"2010-08-02T08:05:27","modified_gmt":"2010-08-02T07:05:27","slug":"wordpress-spelling-auto-correction-now-fixed","status":"publish","type":"post","link":"https:\/\/www.tomfotherby.com\/blog\/index.php\/2010\/08\/wordpress-spelling-auto-correction-now-fixed\/","title":{"rendered":"WordPress spelling auto-correction now fixed"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.tomfotherby.com\/blog\/wp-content\/uploads\/2009\/12\/WordpressLogo_blue-m.png?resize=100%2C100&#038;ssl=1\" alt=\"Wordpress Logo\" width=\"100\" height=\"100\" class=\"alignleft size-full wp-image-611\" style=\"padding: 20px\" \/><\/p>\n<p>In WordPress 3.0, my WordPress logo image (<em>on the left<\/em>) broke. So I <a href=\"http:\/\/core.trac.wordpress.org\/ticket\/13971\">opened a bug<\/a> and six weeks and 100 bug comments later, I have upgraded to 3.01 and it is working again. Thanks guys!<\/p>\n<p>The reason why the logo image was broken was quite interesting(?)&#8230; In v3.0 WordPress automatically started auto-correcting Word<strong>p<\/strong>ress to Word<strong>P<\/strong>ress (i.e. Word-lowercase-p-ress to Word-uppercase-P-ress) and because my image file name was called &#8220;Word<strong>p<\/strong>ressLogo_blue-m.png&#8221;, the auto-correction was breaking the link. Auto-correction shouldn&#8217;t cause links to break and it seems that v3.01 fixes it.<\/p>\n<p>The filter function that does this auto-correction is called &#8220;<em>capital_P_dangit<\/em>&#8221; &#8211; The WordPress guys are obviously pretty frustrated by this spelling mistake!<\/p>\n<p><strong>Old filter (v3.0):<\/strong><\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\nfunction capital_P_dangit( $text ) {\n       return str_replace( 'Wordpress', 'WordPress', $text );\n}\n<\/pre>\n<p><strong>New filter (v3.01):<\/strong><\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\nfunction capital_P_dangit( $text ) {\n        \/\/ Simple replacement for titles\n        if ( 'the_title' === current_filter() )\n                return str_replace( 'Wordpress', 'WordPress', $text );\n        \/\/ Still here? Use the more judicious replacement\n        static $dblq = false;\n        if ( false === $dblq )\n                $dblq = _x('&#8220;', 'opening curly quote');\n        return str_replace(\n                array( ' WordPress', '&#8216;WordPress', $dblq . 'Wordpress', '&gt;Wordpress', '(WordPress' ),\n                array( ' WordPress', '&#8216;WordPress', $dblq . 'WordPress', '&gt;WordPress', '(WordPress' ),\n        $text );\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In WordPress 3.0, my WordPress logo image (on the left) broke. So I opened a bug and six weeks and 100 bug comments later, I have upgraded to 3.01 and it is working again. Thanks guys! The reason why the logo image was broken was quite interesting(?)&#8230; In v3.0 WordPress automatically started auto-correcting Wordpress to [&hellip;]<\/p>\n","protected":false},"author":52,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[79],"tags":[98,87],"class_list":["post-2030","post","type-post","status-publish","format-standard","hentry","category-technical","tag-bug","tag-wordpress"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2030","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=2030"}],"version-history":[{"count":0,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2030\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=2030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=2030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=2030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}