BBPressでは「bbp_kses_allowed_tags」を書くとトピックのHTMLにタグがエスケープされると聞いたのですが(https://gist.github.com/jaredatch/5645033)、次の書き方はどこか間違っていますでしょうか?
php
1function ja_filter_bbpress_allowed_tags() { 2 return array( 3 // Links 4 'a' => array( 5 'href' => array(), 6 'title' => array(), 7 'rel' => array() 8 ), 9 // Quotes 10 'blockquote' => array( 11 'cite' => array() 12 ), 13 // Code 14 'code' => array(), 15 'pre' => array(), 16 // Formatting 17 'em' => array(), 18 'strong' => array(), 19 'del' => array( 20 'datetime' => true, 21 ), 22 // Lists 23 'ul' => array(), 24 'ol' => array( 25 'start' => true, 26 ), 27 'li' => array(), 28 // Images 29 'img' => array( 30 'src' => true, 31 'border' => true, 32 'alt' => true, 33 'height' => true, 34 'width' => true, 35 ) 36 ); 37} 38add_filter( 'bbp_kses_allowed_tags', 'ja_filter_bbpress_allowed_tags' );
ユーザーが作るトピックに
「<li>朝</li><li>昼</li><li>夜</li>」
と入力して投稿されたときに、
・朝
・昼
・夜
と出力されるのではなく、
<li>朝</li><li>昼</li><li>夜</li>とエスケープしてそのまま出力させたいです。
あなたの回答
tips
プレビュー