Best way to develop multisite and deploy on another server?

I always develop the webiste locally on my machine with the setup mydomain.dev and using svn or git to save versions of the code. The next step is to put it on a test domain like stage.mydomain.com and after that mydomain.com I use this to change the url:s in the database: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ Its a search … Read more

Wildcard subdomain for the same site

In WordPress you can easily do this with sub-directories like example.com/user1 Sub-domain & URL Strategy Having username.domain.com will prevent you in the future from having your own sub-domains like shop.example.com and will plague you if you wanted to use www.example.com or just http://example.com Finally … what if some user wants to use expletives or special … Read more

How to individually set WP_DEBUG on a sub-directory multisite?

You can do this by adding some code to wp-config.php $request_uri = $_SERVER[‘REQUEST_URI’]; $debug_dirs = array (‘/debug-dir1/’,’/debug-dir2/’); // list of directories to turn on debugging foreach ($debug_dirs as $debug_dir) { if (!strncmp($request_uri,$debug_dir,strlen($debug_dir))) { define(‘WP_DEBUG’, true); } } define(‘WP_DEBUG’, false); // debug off by default

WP-Admin not working properly at WordPress multisite with subdirectories

If you installed WordPress Multisite starting with version 3.0 to 3.4.2, you’ve got the correct .htaccess file contents. However, if you started with a newer version (3.5 or higher)—and I’m assuming you did, if you’ve just installed WordPress Multisite recently—your .htaccess file should look like this: RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] # … Read more

What is the best way to load the WP environment in a subdomain of my multisite WordPress install?

Use the defines to make it pick the site you want it to pick. You can define these four to setup the $current_site values properly: DOMAIN_CURRENT_SITE, PATH_CURRENT_SITE, SITE_ID_CURRENT_SITE, BLOG_ID_CURRENT_SITE. If you check the wpmu_current_site() function in ms-load.php, you’ll see that it uses those to create the $current_site global. You may or may not have to … Read more

Add new column to sites page

here is a modified version of your class that should work: class Add_Blog_ID { public static function init() { $class = __CLASS__ ; if ( empty( $GLOBALS[ $class ] ) ) $GLOBALS[ $class ] = new $class; } public function __construct() { add_filter( ‘wpmu_blogs_columns’, array( $this, ‘get_id’ ) ); add_action( ‘manage_sites_custom_column’, array( $this, ‘add_columns’ ), … Read more

Changing Multisite themes on mass

I wouldn’t recommend to use update_option for this task. Why? Because themes/plugins may use switch_theme action and it won’t get run in such case. And this action is pretty important – it will allow you to save your widgets for example… Another problem with Fuxias answer is that she uses template_directory hook. But there is … Read more

Inherit plugin settings to new site in Multisite

Nice Question! But I’ll leave for the asker and for the reader the task of finding the plugin options name. This can be used for any plugin/theme that relies in a single/serialized value in the wp_options table. If it’s not a single value, it’s another task… In this example, I’m using WP-Pagenavi option_name. Action hook … Read more

Perform action on WPMU blog deletion

Yes, inside /wp-admin/includes/ms.php there is the action hook delete_blog. This test prevents a blog deletion: add_action( ‘delete_blog’, ‘prevent_blog_delete_wpse_82961’, 10, 2 ); /** * @param int $blog_id Blog ID * @param bool $drop True if blog’s table should be dropped. Default is false. */ function prevent_blog_delete_wpse_82961( $blog_id, $drop ) { wp_die( ‘aborting delete_blog’ ); }