|
楼主 |
发表于 2013-12-6 19:28:44
|
显示全部楼层
本帖最后由 jeffseo 于 2013-12-6 19:33 编辑
换其它WP的版本也还是这样,
另外Maximum number of links per article:这个值也没读成功,设置10个TAG,文章中仍然会把所有TAG都链接上。
看代码似乎都没什么问题,
其它用simple tags的哥们也是这样的吗- // there should always be at least one token, but check just in case
- $anchor_level = 0;
- if (isset($tokens) && is_array($tokens) && count($tokens) > 0) {
- $i = 0;
- foreach ($tokens as $token) {
- if (++$i % 2 && $token != '') { // this token is (non-markup) text
- if ($anchor_level == 0) { // linkify if not inside anchor tags
- if (preg_match($match, $token)) { // use preg_match for compatibility with PHP 4
- $j++;
- if ($j <= SimpleTags_Plugin::get_option_value('auto_link_max_by_tag') || SimpleTags_Plugin::get_option_value('auto_link_max_by_tag') == 0) {// Limit replacement at 1 by default, or options value !
- $token = preg_replace($match, $substitute, $token); // only PHP 5 supports calling preg_replace with 5 arguments
- }
- $must_tokenize = true; // re-tokenize next time around
- }
- }
- } else { // this token is markup
- if (preg_match("#<\s*a\s+[^>]*>#i", $token)) { // found <a ...>
- $anchor_level++;
- } elseif (preg_match("#<\s*/\s*a\s*>#i", $token)) { // found </a>
- $anchor_level--;
- }
- }
- $filtered .= $token; // this token has now been filtered
- }
- $content = $filtered; // filtering completed for this link
- }
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|