1

我愿意使用 wordpress 的 blogroll 功能在我的网站上显示合作伙伴列表。我想知道如何使用Descriptionwordpress 链接页面中的字段来接受 html 标签<a><p>

我可以显示description,但它不解释标签。例如,如果我输入描述

This is the description of our partner. His <a href="www.bla.com">Website</a> is cool

然后我会在网站上得到与纯文本相同的文本,没有链接!

我怎样才能做到?

4

1 回答 1

0

有关将来从核心中删除链接并转换为插件的相关核心票证。


Description要在字段中(和字段中)启用 HTML 标记Notes,请使用以下代码:

// Disable the removal of HTML tags
remove_filter( 'pre_link_description', 'wp_filter_kses' );
remove_filter( 'pre_link_notes', 'wp_filter_kses' );

// Enable HTML tags the same way as in posts content
add_filter( 'pre_link_description', 'wp_filter_post_kses' );
add_filter( 'pre_link_notes', 'wp_filter_post_kses' );
于 2013-03-06T00:04:11.403 回答