When to load auto-login code?

I ended up using the ‘plugins_loaded’ action or state from http://codex.wordpress.org/Plugin_API/Action_Reference: In my main plugin file I have: include_once( ‘lib/class-my-auth.php’ ); // your class file here add_action( ‘plugins_loaded’, ‘My_Auth::auto_login’ ); In lib/class-my-auth.php: <?php class My_Auth { private static $successfully_connected_Main_to_WP = false; public static function auto_login() { $username = …; // Integrate with main site to … Read more

How Access Multiple WordPress sites with a single login

In both wp-config.php files, change the following defines: define(‘COOKIE_DOMAIN’, ‘.test.oursite.com’); define(‘COOKIEHASH’, md5(‘test.oursite.com’)); to: define(‘COOKIE_DOMAIN’, ‘.oursite.com’); define(‘COOKIEHASH’, md5(‘oursite.com’)); Go to test.oursite.com/wp-admin/ and login as an administrator. Go to Users -> Your Profile and click on Update Profile button. Now go to forums.oursite.com/wp-admin/. You should be logged in there. If synchronization plugins in mu-plugins for both sites … 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

Bypassing wp_signon with a cookie that I have

Don’t need no cookies. WordPress automatically bypasses it for you if you pass an user (the one you need to login) object, fire this function on init (I think): $user_to_login = get_user_by( ‘id’, 1 ); // Check if user exists if( $user_to_login ) { wp_set_auth_cookie( $user_to_login->ID, False ); /** * Fire up the login process. … Read more

How do I set up single sign on for multiple WP installs across the same domain?

Let your blogs share the same user table. In your blogs wp-config.php files add: define(‘CUSTOM_USER_TABLE’, $table_prefix . ‘my_users’); define(‘CUSTOM_USER_META_TABLE’, $table_prefix . ‘my_usermeta’); Important note from Codex: Please note that permissions in the user_meta tables are stored with the table prefix of the site. So in the CUSTOM_USER_META_TABLE one must have entries for each site using … Read more