wp-cronで次のように「毎日13時」という指定ではなく、「13時」と「14時」と「15時」などのように複数指定するための書き方を教えて頂けませんでしょうか?
【funcdions.php】
php
1 //Cronへ登録 2 function my_activation(){ 3 if ( ! wp_next_scheduled( 'tweetcron' ) ) { 4 //時差を求める 5 $p = ( current_time( 'timestamp' ) - time( ) ) / 3600; 6 7 //(今日から)毎日タスクを実行する時間を設定する 8 //管理>設定されたタイムゾーンでの時間を設定する(13:00) 9 $my_time = date( 'Y-m-d 13:00:00', current_time( 'timestamp' ) ); 10 11 //時差を引いて、UNIX時間(UTC:秒)に合わせる 12 $task_time = strtotime( -1 * $p." hour", strtotime( $my_time ) ); 13 wp_schedule_event( $task_time, 'daily', tweetcron ,array(strtotime( $my_time ))); 14 } 15 } 16 add_action('wp', 'my_activation');
宜しくお願い致します。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。