Email::get_admin_emails( string $opt )

Description #

Get admin emails to notify based on option.

Parameters #

  • $opt
    string (Required) Option key.

Source #

File: addons/email/email.php

	public function get_admin_emails( $opt ) {
		$current_user = wp_get_current_user();

		if ( ap_opt( $opt ) ) {
			$admin_emails = explode( ',', preg_replace( '/\s+/', '', ap_opt( 'email_admin_emails' ) ) );
			// Don't bother if current user is admin.
			if ( empty( $admin_emails ) || in_array( $current_user->user_email, $admin_emails, true ) ) {
				return false;
			}

			return $admin_emails;
		}

		return false;
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment