관리-도구
편집 파일: cron.php
<?php defined( 'ABSPATH' ) || die( "Can't access directly" ); /** * Daily */ function arcade_daily_cron_job_function() { // Clear wp do_pings event wp_clear_scheduled_hook('do_pings'); clear_old_pngs(); } add_action('arcade_daily_action_hook', 'arcade_daily_cron_job_function'); /** * Hourly */ function arcade_hourly_cron_job_function() { } add_action('arcade_hourly_action_hook', 'arcade_hourly_cron_job_function'); /* * EVERY 15 Mins */ function arcade_15min_cron_job_function() { } add_action('arcade_15min_action_hook', 'arcade_15min_cron_job_function'); /* * EVERY 5 Mins */ function arcade_5min_cron_job_function() { } add_action('arcade_5min_action_hook', 'arcade_5min_cron_job_function'); /* * EVERY 3 Minutes */ function arcade_every_3mins_cron_job_function() { arcade_game_importer(); } add_action('arcade_3min_action_hook', 'arcade_every_3mins_cron_job_function'); /* * EVERY Minutes */ function arcade_every_mins_cron_job_function() { add_action('wp_loaded', 'arcade_game_importer'); } add_action('arcade_every_mins_action_hook', 'arcade_every_mins_cron_job_function'); /* * INTERVALS */ function arcade_add_cron_recurrence_interval( $schedules ) { $schedules['every_15_mins'] = array( 'interval' => 1500, 'display' => 'Every 15 Minutes', ); $schedules['every_5_mins'] = array( 'interval' => 300, 'display' => 'Every 5 Minutes', ); $schedules['every_3_mins'] = array( 'interval' => 180, 'display' => 'Every 3 Minutes', ); $schedules['every_mins'] = array( 'interval' => 60, 'display' => 'Every Minutes', ); return $schedules; } add_filter( 'cron_schedules', 'arcade_add_cron_recurrence_interval' ); // schedule the wordpress refresh event function arcade_cron_activation() { if ( !wp_next_scheduled( 'arcade_daily_action_hook' ) ) { wp_schedule_event( time(), 'daily', 'arcade_daily_action_hook'); } if ( !wp_next_scheduled( 'arcade_hourly_action_hook' ) ) { wp_schedule_event( time(), 'hourly', 'arcade_hourly_action_hook'); } if ( ! wp_next_scheduled( 'arcade_15min_action_hook' ) ) { wp_schedule_event( time(), 'every_15_mins', 'arcade_15min_action_hook' ); } if ( ! wp_next_scheduled( 'arcade_5min_action_hook' ) ) { wp_schedule_event( time(), 'every_5_mins', 'arcade_5min_action_hook' ); } if ( ! wp_next_scheduled( 'arcade_3min_action_hook' ) ) { wp_schedule_event( time(), 'every_3_mins', 'arcade_3min_action_hook' ); } if ( ! wp_next_scheduled( 'arcade_every_mins_action_hook' ) ) { wp_schedule_event( time(), 'every_mins', 'arcade_every_mins_action_hook' ); } } add_action('wp', 'arcade_cron_activation');