让Yoast Breadcrumbs支持中文

修改wp-content/plugins/breadcrumbs/yoast-breadcrumbs.php:

--- wp-content/plugins/breadcrumbs/yoast-breadcrumbs.php        (revision 22)
+++ wp-content/plugins/breadcrumbs/yoast-breadcrumbs.php        (revision 23)
@@ -49,7 +49,7 @@

                                foreach (array('home', 'blog', 'sep', 'singleparent', 'prefix', 'archiveprefix', 'searchprefix', 'breadcrumbprefix', 'breadcrumbsuffix') as $option_name) {
                                        if (isset($_POST[$option_name])) {
-                                               $opt[$option_name] = htmlentities(html_entity_decode($_POST[$option_name]));
+                                               $opt[$option_name] = htmlentities(html_entity_decode($_POST[$option_name], ENT_COMPAT, "UTF-8"),  ENT_COMPAT, "UTF-8");
                                        }
                                }

找到红色部分的行,改为绿色部分的即可。或者复制上面的代码,保存为一个叫做breadcrumbs.path的文件。然后进入Wordpress根目录,运行命令

patch -p0 < /path/to/breadcrumbs.patch
This entry was posted in Programming, WEB Application and tagged , . Bookmark the permalink.

One Response to 让Yoast Breadcrumbs支持中文

  1. Pingback: 让Yoast Breadcrumbs支持中文的方法 | 新媒体实验室

Leave a Reply