admin管理员组文章数量:1418104
Looking to update my WP Login Flow open source plugin to prevent using rewrite URLs in things like Lost Password, Login, Register, if the rewrite file does not exist on the server -- but need some help with multisite support.
From my understanding multisite installs will have just a single root .htaccess
or web.config
file, and rewrites are stored in the options table for sub-sites.
For now i'm using these functions below to check for rewrite file (and just return true now for multisite), but i would like to add support for checking multisites
function htaccess_exists(){
if ( is_multisite() ) {
return true;
}
// Ensure get_home_path() is declared.
require_once( ABSPATH . 'wp-admin/includes/file.php' );
$home_path = get_home_path();
$htaccess_file = $home_path . '.htaccess';
return file_exists( $htaccess_file );
}
function iis_web_config_exists() {
if ( is_multisite() ) {
return true;
}
// Ensure get_home_path() is declared.
require_once( ABSPATH . 'wp-admin/includes/file.php' );
$home_path = get_home_path();
$web_config_file = $home_path . 'web.config';
// iis7_supports_permalinks() also checks to make sure IIS7 or above (required for permalinks)
return iis7_supports_permalinks() && file_exists( $web_config_file );
}
Maybe I can just try using ABSPATH
for multisite to check for the files?
Any thoughts or suggestions on how I could accomplish this to work with multisite?
本文标签: permalinksWordPress Multisite ABSPATH and gethomepath() to check for htaccess or webconfig file
版权声明:本文标题:permalinks - WordPress Multisite ABSPATH and get_home_path() to check for htaccess or web.config file 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745172145a2646039.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论