2012-03-02 5 views

답변

1

이 당신이 찾고있는, 그러나 여기 당신이 페이지의 일부를 예약 할 수있는 플러그인의 또는 포스트 단축 코드를 사용하여 정확히 어떤 경우 확실하지 :

<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/

+0

그래, 시작 됐어, 오늘 저녁에 해봐. – EOB

0

업데이트 된 게시물과 동일한 게시물일까요? 이 경우 단지 함수를 만들고 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 오류 로그를 확인하고 기능이 실제로 제대로 트리거 볼 수 있습니다.

관련 문제