The MU forums have moved to WordPress.org

Trying to use wpmu_validate_user_signup(); not working! (5 posts)

  1. JsonB123
    Member
    Posted 14 years ago #

    I'm just trying to use the Wordpress MU function <?php wpmu_validate_user_signup($user_name, $user_email); ?> as described on: http://codex.wordpress.org/WPMU_Functions/wpmu_validate_user_signup. I keep getting the error: Fatal error: Call to undefined function username_exists() in /home/myhome/public_html/mysite/wp-includes/wpmu-functions.php on line 985

    I'm calling the function at the top of my file (which is in the template) like so:
    $result = wpmu_validate_user_signup($_POST['fullname'], $_POST['email']); and I'm not sure where I'm going wrong here. The error isn't very descriptive...and I know the function exists...it's there! Can anyone help?

  2. JsonB123
    Member
    Posted 14 years ago #

    UPDATE:

    I've commented out the lines in wp-includes/wpmu-functions.php (it makes me feel sad to modify a core file...but it's just temporary, I swear!) from lines 985-990 and the function works again...and by works I mean everything works besides checking if the email or username exist already.

    It seems that the two functions username_exists() and email_exists() are not working properly. I've not touched ANY core files so I'm almost 100% positive it's not the install. I really need to figure out what's happening with these two functions. They are both located in wp-includes/registration.php.

    I copied both of those functions out and into my theme's functions.php file and uncommented the core file wp-includes/wpmu-functions.php and it works again...so I guess this will have to do for now!

    I'd like to resolve this the right way though.

  3. JsonB123
    Member
    Posted 14 years ago #

    No one has any idea? This is happening for me when I try to use wpmu_create_user too...

    This is getting frustrating.

  4. andrea_r
    Moderator
    Posted 14 years ago #

    What exactly are you trying to do?

    you have to call other functions before using wpmu_validate_user_signup. Have you looked at wp-signup.php to see how it's using it?

  5. JsonB123
    Member
    Posted 14 years ago #

    Hi andrea_r,

    I'm calling this function to create a new user and attach them to a new blog outside of the Wordpress Dashboard using information they fill out using a specific form.

    I have read through wpmu-edit.php and user-new.php as well as wp-signup.php and I think I have solved my issue. I needed to include the wp-includes/registration.php file. Without doing so I was getting the error: PHP Fatal error: Call to undefined function username_exists() in /.../.../.../wp-includes/wpmu-functions.php on line 1276

    I am now loading this file along with wp-load.php at the top of the php file I'm calling these functions from. So far it's working...is this the wrong way to go about handling the Wordpress API outside of a template or plugin?

About this Topic

  • Started 14 years ago by JsonB123
  • Latest reply from JsonB123