Bootstrapping WordPress MultiSite Outsite of WordPress – No $wpdb

You’ll want to include the wp-load.php, not the wp-config.php. Depending on how you’re doing it, you may also have to set $_SERVER variables if they aren’t already set to prevent WordPress from trying to redirect you. For example: $_SERVER = array( “HTTP_HOST” => “http://example.com”, “SERVER_NAME” => “http://example.com”, “REQUEST_URI” => “https://wordpress.stackexchange.com/”, “REQUEST_METHOD” => “GET” );

Installing WP twice in same Directory?

Have you considered setting your main site to a multisite setup? This would allow you to use the same wordpress files from the root and serve a wordpress site under the /seperatesite/ directory without the need for duplicating files. take a look at: http://codex.wordpress.org/Create_A_Network If you need any specific help regarding setting this up then … Read more

Is it possible to have a network of BuddyPress sites, a-la WordPress MU, with single-sign-on? [closed]

BuddyPress is compatible with a WordPress Multisite setup. There are several different ways to set it up. By default, BuddyPress data is stored in a networkwide way. Generally, that means that, within the network of sites, only one site is dedicated to BuddyPress features/content – you might think of this as the “community” site within … Read more

Getting this code to work in Multisite

The Problem: When wp-cron.php is called, it includes only: require_once( dirname( __FILE__ ) . ‘/wp-load.php’ ); so the problem you are facing is that wpmu_delete_blog() is undefined when you call it from your remove_blogs_daily() function. Possible Solution: You therefore need to add this line: require_once( ABSPATH . ‘wp-admin/includes/admin.php’ ); into your code to fix that. … Read more

Global functions on WPMU

What you are looking for is a “MU-Plugin”– “Must-Use Plugin”.. Originally these were called “Multi-User Plugins” and were intended for exactly your purpose– to provide a way for site admins to enable functionality on all sites of an installation. Create a directory at /wp-content/mu-plugins/ and put your PHP file(s) in it. WordPress will load the … Read more

Check if User exists in WordPress Multisite

You can check existing user with “username_exists” WordPress function and insert user using “wp_insert_user” function as below for Network site also: if( username_exists( ‘username’ ) ) { _e( ‘Username already exists’, ‘your-text-domain’ ); } else { _e( ‘Username does not exists.’, ‘your-text-domain’ ); $userdata = array( ‘user_login’ => ‘username’, ‘user_url’ => ‘http://example.com’, ‘user_pass’ => wp_generate_password(), … Read more