• caudillc

    (@caudillc)


    Since Facebook Connect allows the creation of a user without an email address, I have been trying to code to give an error to the user to add on to their profile. What php calls this? Again, I have tried hundreds of options.

    if ($user_email = ”){
    echo “Email Address Missing“;
    }else{}

    I have tried calling out their info too, but have not done it correctly.

Viewing 5 replies - 1 through 5 (of 5 total)
  • esmi

    (@esmi)

    I don’t know anything about Facebook Connect but there’s a typo in your code above.

    if ($user_email = ''){

    should be

    if ($user_email == ''){

    Thread Starter caudillc

    (@caudillc)

    oops – just a typo on the post. the problem has nothing really to do with FB Connect. I just want to check to see if the e-mail field in the database is blank or not. The code above is not looking in the right place…and I am not sure what else to try.

    esmi

    (@esmi)

    get_the_author_email()?

    Not much documentation in it within the Codex other than it is the same as the_author_email(), except it returns rather than displays the author’s e-mail address.

    Thread Starter caudillc

    (@caudillc)

    it is not necessarily the author – more so the logged in user…

    i think it may need some variation of this, but i am not certain about it:

    $current_user = wp_get_current_user();
    $user_id = $current_user->ID;

    The codex does list the get_currentuserinfo as one way of accessing this information as well. See below:

    http://codex.wordpress.org/Function_Reference/get_currentuserinfo

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Check if email is null’ is closed to new replies.