0
가 여기 내 함수의에서 전송 헤더를.. 경고 : 헤더 정보를 수정할 수 없습니다 - 이미
class emailer {
function notifyHeart($post_ID) {
$interests = get_user_meta(get_current_user_id(), 'interests');
$to = the_author_meta('user_email', get_current_user_id());
$post = get_post($post_ID);
foreach($interests as $interest) {
if(has_tag($interest, $post)) {
$email = $to;
mail($email, "An article about Heart", 'A new post has been published about heart.');
break;
}
}
}
}
add_action('publish_post', array('emailer', 'notifyHeart'));
을 오류가 게시물을 게시 한 후 다가와서 내가
을 포함하는 경우에만 발생$to = the_author_meta('user_email', get_current_user_id());
나는이 대신
$to = "[email protected]";
없음 경고를 포함하지 않는 경우 나오다. 누구를 생각해?
실제로는 the_content 같은 여러 기능을 통해 사용되는로 워드 프레스로 기억하는 엄지 손가락의 좋은 규칙의()와 get_the_content(). – hansvedo
Gotcha, 고개를 숙여 주셔서 감사합니다. 미래의 마음에 분명히 명심하십시오. – Richard