• Hi –

    I run a family friendly site with user profile functionality. I have set user profiles to not show up automatically, and I would like to be notified when they are filled out so I can approve and activate them.

    I found a bit of code in an old forum that was supposed to do this, and put it between php brackets in functions.php but it doesn’t work for me:

    function user_profile_update($userid) {
    $userdata = get_userdata($userid);
    $message = "A user profile has been updated\n\n"
    $message .= print_r($userdata,true);
    @wp_mail(get_option('admin_email'), 'User Profile Update', $message);
    }
    add_action('profile_update','user_profile_update');

    I get this message:
    Parse error: syntax error, unexpected T_VARIABLE in /home/content/67/6403867/html/wp-content/themes/iblogpro4_dev/functions.php on line 51

    Any ideas? Am I doing something wrong? Thanks!

Viewing 1 replies (of 1 total)
  • Looks like it’s missing a closing semi-colon on line 3,needs to be:

    $message = "A user profile has been updated\n\n";

    I added that and the code is working on one of my client’s websites using WordPress 3.0.4.

Viewing 1 replies (of 1 total)
  • The topic ‘Notify Admin when user updates profile’ is closed to new replies.