The MU forums have moved to WordPress.org

API create new user account (6 posts)

  1. dwatrous
    Member
    Posted 14 years ago #

    Using the latest version of wpmu.

    I have a membership site and I would like to give users there a free blog as a bonus to their membership. This means that I wouldn't like people to just sign up for a new blog on my blog farm site. I also don't want to have to manually add each new user to the blog site.

    What I was hoping to be able to do was programatically create a user account based on their login to my membership site and then enable users to create new blogs. Please tell if there's some way to do this.

    Thanks.

  2. andrea_r
    Moderator
    Posted 14 years ago #

    Site Admin -> Options and find "Allow new registrations"

    check "Only logged in users can create new blogs."

    Then, as a bonus when they've paid, give them the link to the signup page. When they are logged in, they'll get a greeting and fields to fill out to get their blog.

  3. dholowiski
    Member
    Posted 14 years ago #

    Hi. For different reasons, I have the exact same question. I want to programatically create user accouts (and blogs for the user too actually). andrea_r's answer didn't really answer the question.
    The only way I can think of is to connect to the mysql database and actually create the account but that sounds like a pain in the butt. Does anyone have any suggestions?

  4. andrea_r
    Moderator
    Posted 14 years ago #

    No, your question is different. The OP wanted the users in there first, and then a blog created after they paid.

    When a user signs up in MU, they can have a blog right off the bat when they create their username.

    Do you have a list of users you're trying to add in and want a blog created for each of them automatically?

  5. kheftel
    Member
    Posted 14 years ago #

    Hi,
    I have a similar situation. I want to use a PHP script to create a new username and blog. What are the best API functions to use for this? Thanks!

  6. ssandison
    Member
    Posted 14 years ago #

    If you take a look in /wp-includes/wpmu-functions.php all the necessary functions are in there. I guess you would be interested in wpmu_create_user() and wpmu_create_blog().

    Cheers,

    Steve

About this Topic

  • Started 14 years ago by dwatrous
  • Latest reply from ssandison