If you were to use this on a website like http;//example.com/test/testing/, you would get results like these:
如果要在 http; // example.com/test/testing / em>之类的网站上使用此功能,则会得到以下结果: p>- Before: http;//example.com/test/another-test/#anchor
- 之前 strong>:http; // example.com/test/another-test/#anchor li>
- After: ../another-test/#anchor
- 之后: strong>:../ another-test /#anchor li>
ul>
li>
- Before: http;//example.com/wp-content/themes/twentyten/style.css
- 之前 strong>:http; // example.com/wp-content/themes/twentyten/style.css li>
- After: /wp-content/themes/twentyten/style.css
- 之后 strong>:/wp-content/themes/twentyten/style.css li>
ul>
li>
- Before: https;//example.com/wp-content/themes/twentyten/style.css
- 之前 strong>:http s em>; // example.com/wp-content/themes/twentyten/style.css li>
- After: https;//example.com/wp-content/themes/twentyten/style.css
- 之后: strong>:http s em>; // example.com/wp-content/themes/twentyten/style.css li>
ul>
li>
- Before: http;//google.com/test/
- 之前 strong>:http; // google.com/test / li>
- After: //google.com/test/
- 之后 strong>://google.com/test / li>
ul>
li>
- Before: ../../../../../../../../#anchor
- 之前 strong>:../../../../../../../../# anchor li>
- After: /#anchor
- 之后: strong> /#anchor li>
- After (
$output_type=1
): ../../#anchor - 之后 strong>(
$ output_type = 1 code>): strong> ../../# anchor li>
ul>
li>
ol>
All string parsing. 所有字符串解析。 No directory browsing.
否 em>目录浏览。 strong> p>If you're looking for a plugin that will automatically convert all URLs on your WordPress site, instead check out my other plugin, WP-HTML-Compression.
org / extend / plugins / wp-html-compression /“> WP-HTML-Compression strong>。
Before you copy this code and add it into your own, keep in mind that there will probably be future updates.
在复制此代码并将其添加到自己的代码之前 strong>,请记住,将来可能会有更新。Keeping the code within an installed plugin will make sure that you’re notified.
将代码保存在已安装的插件中可确保您收到通知。 p>