0

我有这个函数,除了它抛出关于函数第 4 行的通知外,它可以工作。通知上写着“只有变量应该通过引用传递......”我在第 4 行做错了什么?谢谢!

//EMAIL_ADMIN
//Sends email to site admin if email testing services fail.
//Only occurs if both primary and secondary services have failed.
//Calls no other function.
//Called by test_email function.
//***************************************************************

function email_admin($email){
    global $full_site_url;//used in links.
    global $site_title;//used in confirmation messages.
    $caller = next(debug_backtrace())['function']; //assigns calling function name to $caller.
    
    if ($caller == 'alt_test_email'){
        //used in email message to provide links for checking services.
        $primary_service = 'http://www.quickemailverification.com';//used in email message.
        $secondary_service = 'http://www.neverbounce.com';//used in email message.

        $to = get_bloginfo('admin_email');
        $subject = 'EMAIL TESTING SERVICES HAVE FAILED!';
        $message = 'Both email testing services have failed. Go to ' . $primary_service . ' and ' . $secondary_service . '.';
        dw_send_email($to, $subject, $message);//call email sending function.
    }
    
    if ($caller == 'unsubscribe'){
        $to = get_bloginfo('admin_email');
        $subject = $site_title . " unsubscribe";
        $message = $email . " has unsubscribed.";
        dw_send_email($to, $subject, $message);//call email sending function.
    }
    
    if ($caller == 'subscribe_form_display'){
        $to = get_bloginfo('admin_email');
        $subject = "New " . $site_title . " subscriber";
        $message = $email . " has subscribed to " . $site_title . ".";
        dw_send_email($to, $subject, $message);//call email sending function.
    }
}
4

0 回答 0