permalinks - WordPress Multisite ABSPATH and get_home_path() to check for htaccess or web.config file

Looking to update my WP Login Flow open source plugin to prevent using rewrite URLs in things like Lost Password, Login,

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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745172145a4614990.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信