Last active
October 27, 2022 21:46
-
-
Save roborourke/80b2f8ec9ec88c69fb90 to your computer and use it in GitHub Desktop.
Get subfolder multisite wordpress to work on getpantheon.com hosting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// hack to make pantheon work with subdirectory multisite | |
add_action( 'wpmu_new_blog', function( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { | |
if ( defined( 'SUBDOMAIN_INSTALL' ) && ! SUBDOMAIN_INSTALL ) { | |
$abspath = untrailingslashit( ABSPATH ); | |
$subpath = $abspath . untrailingslashit( $subpath ); | |
if ( ! is_dir( $path ) ) | |
symlink( $abspath, $subpath ); | |
} | |
}, 10, 6 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any idea how to get existing multisite install to work on pantheon? A migrated multisite? I was able to get the sites to load on frontend by defining the WP_CONTENT_URL in wp-config, so that it would load the assets, css, js, img, etc... however the wp-admin doesn't work for the subfolder sites, only the main site.