roots / multisite-url-fixer

Fixes WordPress issues with home and site URL on multisite when using Bedrock
MIT License
59 stars 19 forks source link

Fix /wp added to sites admin url when multisite is not a subdomain install #2

Closed ptrckvzn closed 7 years ago

ptrckvzn commented 7 years ago

Proposed fix for https://github.com/roots/multisite-url-fixer/issues/1

This conditional won't append /wp to admin url when not a subdomain install and not the main site. I haven't tested it enough, but it seems to work. I will keep testing on my current project.

QWp6t commented 7 years ago

Instead of unnecessary nesting, the statements can be combined.

Something like this:

if (substr($url, -3) !== '/wp' && (is_main_site() || is_subdomain_install())) {
JulienMelissas commented 7 years ago

Thanks for this! I'll be honest in that I don't have a subdirectory multisite install I can test so I'm going to have to take your word for it 😄

Does it work everywhere else?

greatislander commented 7 years ago

Tested this on a subdirectory install and it works great!