wpmu

Wordpress WPMU Login consistency across multisite network

冷暖自知 提交于 2019-12-02 06:31:08
问题 I'm working on a WPMU multisite install but have run into a wee problem. I create a user during a signup process on my primary domain. With something like the following. $username = 'myname-'.time(); $user_id = wpmu_create_user($username,'anypassword','example@gmail.com'); add_user_to_blog(1, 5, 'subscriber'); $user = wp_signon(array( "user_login" => $username, "user_password" => 'anypassword', "remember" => true )); What I do is create the user, and then assign it to the primary domain only,

Wordpress WPMU Login consistency across multisite network

久未见 提交于 2019-12-02 01:21:17
I'm working on a WPMU multisite install but have run into a wee problem. I create a user during a signup process on my primary domain. With something like the following. $username = 'myname-'.time(); $user_id = wpmu_create_user($username,'anypassword','example@gmail.com'); add_user_to_blog(1, 5, 'subscriber'); $user = wp_signon(array( "user_login" => $username, "user_password" => 'anypassword', "remember" => true )); What I do is create the user, and then assign it to the primary domain only, and the log the user in with wp_signon. However, when visiting a subsite of the network on a sub

How to call wordpress functions in custom php script

◇◆丶佛笑我妖孽 提交于 2019-11-28 03:41:11
I have a Php script I want to use for creating a new blog in WPMU. I am having trouble calling wordpress functions like wpmu_create_user and wpmu_create_blog . My hope is to get this script running as a cron job from command line and pick up new blog creation requests from an external db, create a new blog using the wordpress functions and update the db with new blog info. include wp-load.php file (in the root of your wordpress installation) in your php script file like so, require_once("/path/to/wordpress/wp-load.php"); you will have to provide the abspath of the wp-load file, now you can use

How to call WordPress functions in a custom PHP script

断了今生、忘了曾经 提交于 2019-11-27 05:10:41
问题 I have a PHP script I want to use for creating a new blog in WPMU. I am having trouble calling WordPress functions like wpmu_create_user and wpmu_create_blog. My hope is to get this script running as a cron job from the command line and pick up new blog creation requests from an external db, create a new blog using the WordPress functions and update the database with the new blog information. 回答1: include wp-load.php file (in the root of your wordpress installation) in your php script file