• Resolved ktrusak

    (@ktrusak)


    I am setting up a contact form and am trying to set the form to automatically point to the email of the user who registered the site (their role is set to author). Is there a function or label in wordpress for the user who registered the current site?

    Gravity forms already has a hook to alter where the notification is sent, I am just hoping WordPress has a function built in for ‘site owner’ or ‘registered user’ or something? This is what I tried (I think I am messing up lines 3-6 a bit):

    add_filter("gform_notification_email_1", "change_notification_email", 10, 2);
    function change_notification_email($email, $entry){
        $blogusers = get_users('role=author');
        foreach ($blogusers as $user) {
            return $user->user_email;
        }
    }

    Help is sincerely appreciated on this one, I am not sure where to start looking…

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    There’s no way to see who ‘registered’ the site. You could (like you’re trying) cull a list of people who are on that site as authors, but that’s as good as it’ll get.

    Thread Starter ktrusak

    (@ktrusak)

    Okay, I will try to get that code working then

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Default User/Site Owner label’ is closed to new replies.