返回介绍

iis7_supports_permalinks()

发布于 2017-09-11 00:57:45 字数 2222 浏览 1192 评论 0 收藏 0

iis7_supports_permalinks()

Check if IIS 7+ supports pretty permalinks.


description


返回值

(bool) Whether IIS7 supports permalinks.


源代码

File: wp-includes/functions.php

function iis7_supports_permalinks() {
	global $is_iis7;

	$supports_permalinks = false;
	if ( $is_iis7 ) {
		/* First we check if the DOMDocument class exists. If it does not exist, then we cannot
		 * easily update the xml configuration file, hence we just bail out and tell user that
		 * pretty permalinks cannot be used.
		 *
		 * Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When
		 * URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'.
		 * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs
		 * via ISAPI then pretty permalinks will not work.
		 */
		$supports_permalinks = class_exists( 'DOMDocument', false ) && isset($_SERVER['IIS_UrlRewriteModule']) && ( PHP_SAPI == 'cgi-fcgi' );
	}

	/**
	 * Filters whether IIS 7+ supports pretty permalinks.
	 *
	 * @since 2.8.0
	 *
	 * @param bool $supports_permalinks Whether IIS7 supports permalinks. Default false.
	 */
	return apply_filters( 'iis7_supports_permalinks', $supports_permalinks );
}

更新日志

Versiondescription
2.8.0Introduced.

相关函数

Uses

  • wp-includes/functions.php: iis7_supports_permalinks
  • wp-includes/plugin.php: apply_filters()

Used By

  • wp-admin/includes/network.php: network_step2()
  • wp-admin/includes/misc.php: iis7_save_url_rewrite_rules()
  • wp-admin/includes/misc.php: got_url_rewrite()
  • wp-includes/canonical.php: redirect_canonical()

User Contributed Notes

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文