미래에 특정 날짜/시간에 이미 게시 된 게시물을 업데이트 할 수 있습니까? 업데이트가 완료 될 때까지 이전 버전이 사이트에 표시되어야합니다.Wordpress 3에서 게시물을 업데이트하도록 예약 하시겠습니까?
가능합니까?
감사합니다.
미래에 특정 날짜/시간에 이미 게시 된 게시물을 업데이트 할 수 있습니까? 업데이트가 완료 될 때까지 이전 버전이 사이트에 표시되어야합니다.Wordpress 3에서 게시물을 업데이트하도록 예약 하시겠습니까?
가능합니까?
감사합니다.
이 당신이 찾고있는, 그러나 여기 당신이 페이지의 일부를 예약 할 수있는 플러그인의 또는 포스트 단축 코드를 사용하여 정확히 어떤 경우 확실하지 :
<p>This paragraph is visible by default.</p>
[schedule on='2012-03-20' at="07:00"]
<p>This paragraph will be published on March 20th at 7 am.</p>
[/schedule]
: 그것은 다음과 같이 작동
http://wordpress.org/extend/plugins/scheduled-content/
업데이트 된 게시물과 동일한 게시물일까요? 이 경우 단지 함수를 만들고 wp_cron.php로 후크, 확인 여기 http://codex.wordpress.org/Function_Reference/wp_schedule_event 문서의 예는 워드 프레스 자신의 크론 기능은 사용으로 (당신의 functions.php에 넣어)이 같은
// first parameter is when it should occur, you can set this for example
// by using php's time(), which will fetch the current time, then add how much
// further in time you want the event to occur (in seconds).
wp_schedule_single_event(time()+600, 'function_that_get_called');
//the above code will run 10 minutes after functions get called.
function function_that_get_called() {
$my_post = array();
$my_post['ID'] = the_post_id; // the ID of the post you wish to update.
$my_post['post_content'] = 'New content for my post!';
wp_update_post($my_post);
}
문제 될 것 누군가가 가장 많이 불에 타 사이트를 방문했지만, 나는 위의 코드를 function.php에 추가하여 저장하고 바로 사이트를 방문하면 트리거 할 것입니다. 함수에 같은 것을 추가해야합니다 :
error_log('my_scheaduled_event triggered!');
그래서 당신은 당신의 PHP 오류 로그를 확인하고 기능이 실제로 제대로 트리거 볼 수 있습니다.
그래, 시작 됐어, 오늘 저녁에 해봐. – EOB