{"id":11069,"date":"2022-10-10T17:23:13","date_gmt":"2022-10-10T09:23:13","guid":{"rendered":"https:\/\/blog.naibabiji.com\/?p=11069"},"modified":"2022-10-10T17:23:13","modified_gmt":"2022-10-10T09:23:13","slug":"allow-html-in-category-descriptions","status":"publish","type":"post","link":"https:\/\/blog.naibabiji.com\/woocommerce\/allow-html-in-category-descriptions.html","title":{"rendered":"\u5141\u8bb8\u5728WooCommerce\u7684\u5206\u7c7b\u63cf\u8ff0\u91cc\u9762\u63d2\u5165html\u4ee3\u7801\u548c\u56fe\u7247"},"content":{"rendered":"<p>WooCommerce\u4ea7\u54c1\u5206\u7c7b\u53ef\u4ee5\u8bbe\u7f6e\u5206\u7c7b\u63cf\u8ff0\uff0c\u90e8\u5206\u4e3b\u9898\u4f1a\u5728\u524d\u53f0\u8c03\u7528\u663e\u793a\u5206\u7c7b\u63cf\u8ff0\u5185\u5bb9\uff0c\u4e0d\u5c11<a title=\"\u5916\u8d38\u7f51\u7ad9\u6559\u7a0b\" href=\"https:\/\/blog.naibabiji.com\/\" target=\"_blank\" rel=\"noopener\">\u5916\u8d38\u7f51\u7ad9<\/a>\u90fd\u5728\u901a\u8fc7\u4f7f\u7528\u5206\u7c7b\u63cf\u8ff0\u6765\u505a\u9875\u9762SEO\u4f18\u5316\uff0c\u4f46\u662f\u9ed8\u8ba4\u60c5\u51b5\u4e0bWooCommerce\u7684\u5206\u7c7b\u63cf\u8ff0\u53ea\u652f\u6301\u7eaf\u6587\u5b57\uff0c\u4e0d\u80fd\u4f7f\u7528html\uff0c\u4e5f\u4e0d\u80fd\u63d2\u5165\u56fe\u7247\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u4ee3\u7801\u6765\u5b9e\u73b0WooCommerce\u5206\u7c7b\u63cf\u8ff0\u652f\u6301html\u4ee3\u7801\u3002<\/p>\n<blockquote><p>\/**<br \/>\n* Allow HTML in term (category, tag) descriptions<br \/>\n*\/<br \/>\nforeach ( array( &#8216;pre_term_description&#8217; ) as $filter ) {<br \/>\nremove_filter( $filter, &#8216;wp_filter_kses&#8217; );<br \/>\nif ( ! current_user_can( &#8216;unfiltered_html&#8217; ) ) {<br \/>\nadd_filter( $filter, &#8216;wp_filter_post_kses&#8217; );<br \/>\n}<br \/>\n}<\/p>\n<p>foreach ( array( &#8216;term_description&#8217; ) as $filter ) {<br \/>\nremove_filter( $filter, &#8216;wp_kses_data&#8217; );<br \/>\n}<\/p><\/blockquote>\n<p>\u6765\u6e90\u5730\u5740\uff1a<a href=\"https:\/\/woocommerce.com\/document\/allow-html-in-term-category-tag-descriptions\/\" target=\"_blank\" rel=\"noopener\">https:\/\/woocommerce.com\/document\/allow-html-in-term-category-tag-descriptions\/<\/a><\/p>\n<p>\u53e6\u5916\u8fd8\u6709\u4e00\u6b3e\u63d2\u4ef6\u6ca1\u6d4b\u8bd5\uff0c\u611f\u5174\u8da3\u7684\u53ef\u4ee5\u8bd5\u8bd5\u770b\uff1a<a href=\"https:\/\/wordpress.org\/plugins\/allow-html-in-category-descriptions\/\" target=\"_blank\" rel=\"noopener\">Allow HTML in Category Descriptions<\/a><\/p>\n<p><a href=\"https:\/\/edgeone.naibabiji.com\/wp-content\/uploads\/2022\/10\/Snipaste_2022-10-10_17-20-18.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11070\" src=\"https:\/\/edgeone.naibabiji.com\/wp-content\/uploads\/2022\/10\/Snipaste_2022-10-10_17-20-18.png\" alt=\"\u5206\u7c7b\u6dfb\u52a0html\u6743\u9650\" width=\"822\" height=\"362\" \/><\/a><\/p>\n<p>\u4e4b\u540e\u5206\u7c7b\u63cf\u8ff0\u91cc\u9762\u901a\u8fc7html\u4ee3\u7801\u5c31\u53ef\u4ee5\u63d2\u5165\u56fe\u7247\u4e86\u3002<\/p>\n<div id=\"gtx-trans\" style=\"position: absolute; left: 479px; top: 137.469px;\">\n<div class=\"gtx-trans-icon\"><\/div>\n<\/div>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;11069&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;2&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;1.5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;4&quot;,&quot;greet&quot;:&quot;\u7ed9\u672c\u6587\u6253\u5206 post&quot;,&quot;legend&quot;:&quot;1.5\\\/5 - (2 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;\u5141\u8bb8\u5728WooCommerce\u7684\u5206\u7c7b\u63cf\u8ff0\u91cc\u9762\u63d2\u5165html\u4ee3\u7801\u548c\u56fe\u7247&quot;,&quot;width&quot;:&quot;40&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 40px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            1.5\/5 - (2 votes)    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>WooCommerce\u4ea7\u54c1\u5206\u7c7b\u53ef\u4ee5\u8bbe\u7f6e\u5206\u7c7b\u63cf\u8ff0\uff0c\u90e8\u5206\u4e3b\u9898\u4f1a\u5728\u524d\u53f0\u8c03\u7528\u663e\u793a\u5206\u7c7b\u63cf\u8ff0\u5185\u5bb9\uff0c\u4e0d\u5c11\u5916\u8d38\u7f51\u7ad9\u90fd\u5728\u901a\u8fc7\u4f7f\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":11071,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"\u5141\u8bb8\u5728WooCommerce\u7684\u5206\u7c7b\u63cf\u8ff0\u91cc\u9762\u63d2\u5165html\u4ee3\u7801\u548c\u56fe\u7247 - \u5976\u7238\u5efa\u7ad9\u7b14\u8bb0","description":"WooCommerce\u4ea7\u54c1\u5206\u7c7b\u53ef\u4ee5\u8bbe\u7f6e\u5206\u7c7b\u63cf\u8ff0\uff0c\u90e8\u5206\u4e3b\u9898\u4f1a\u5728\u524d\u53f0\u8c03\u7528\u663e\u793a\u5206\u7c7b\u63cf\u8ff0\u5185\u5bb9\uff0c\u4e0d\u5c11 \u5916\u8d38\u7f51\u7ad9 \u90fd\u5728\u901a\u8fc7\u4f7f\u7528\u5206\u7c7b\u63cf\u8ff0\u6765\u505a\u9875\u9762SEO\u4f18\u5316\uff0c\u4f46\u662f\u9ed8\u8ba4\u60c5\u51b5\u4e0bWooCommerce\u7684\u5206\u7c7b\u63cf\u8ff0\u53ea\u652f\u6301\u7eaf\u6587\u5b57\uff0c\u4e0d\u80fd\u4f7f\u7528html\uff0c\u4e5f\u4e0d\u80fd\u63d2\u5165\u56fe\u7247\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u4ee3\u7801\u6765\u5b9e\u73b0WooCommerce\u5206\u7c7b\u63cf\u8ff0\u652f\u6301html\u4ee3\u7801\u3002 \/**"},"footnotes":""},"categories":[405],"tags":[],"class_list":["post-11069","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-woocommerce"],"_links":{"self":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/posts\/11069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/comments?post=11069"}],"version-history":[{"count":0,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/posts\/11069\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/media\/11071"}],"wp:attachment":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/media?parent=11069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/categories?post=11069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/tags?post=11069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}