我有一个函数,它需要4个参数来发送电子邮件,如果我简单地调用该函数,它就会工作,但当我尝试从schedule\\u single\\u event调用它时,它就不工作了。代码如下:
function send_fake_reminder($email, $other_person_id, $formatted_day, $formatted_time){
add_filter(\'wp_mail_content_type\',create_function(\'\', \'return "text/html"; \'));
$user_subject_eval = "Reminder for Your Lesson at ".$formatted_time." on ".$formatted_day;
$user_message_eval = "<p>Please make sure that you have their Skype address added. </p><p>Enjoy your lesson!</p></div></div>";
$user_headers_eval = "From: Exlogue <[email protected]>";
wp_mail( $email, $user_subject_eval, $user_message_eval, $user_headers_eval);
}
add_action(\'send_fake_reminder\',\'send_fake_reminder\', 10, 4);
$teacher_email = \'[email protected]\';
$current_user_id = \'\';
$teacher_formatted_day = \'\';
$teacher_formatted_time = \'\';
$now = time();
//this works!
send_fake_reminder($teacher_email, $current_user_id, $teacher_formatted_day, $teacher_formatted_time);
// this doesn\'t work :(
$schedule = wp_schedule_single_event( $now, \'send_fake_reminder\', array($teacher_email, $current_user_id, $teacher_formatted_day, $teacher_formatted_time) ) ;
为什么日程安排不起作用?