WordPress.org

Ready to get started?Download WordPress

Forums

How to get $admin_email on network activated multisite (2 posts)

  1. Mike Challis
    Member
    Posted 1 year ago #

    My contact form plugin "Fast Secure Contact Form" needs to get $admin_email for the default contact form Mail To recipient.
    Currently I use $admin_email = get_option('admin_email');

    One user who has network activated multisite said it is not pulling each site admin.

    Is this the correct code then?
    Will it always work?

    if (function_exists('is_multisite') && is_multisite()) {
             $admin_email = get_site_option( 'admin_email' );
    } else {
             $admin_email = get_option('admin_email');
    }

    Thanks for any help.

  2. Mike, that looks right.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.