Change scheduling frequence
-
Hi guys,
I need to have an events import every 5 minutes.
I tried adding this in my function.phpfunction isa_add_every_five_minutes( $schedules ) { $schedules['every_five_minutes'] = array( 'interval' => 300, 'display' => __( 'Every 5 Minutes') ); return $schedules; } add_filter( 'cron_schedules', 'isa_add_every_five_minutes' );and changed this in fb-sch.php:
<?php add_action( 'wp', 'fbe_cron_setup_schedule' ); function fbe_cron_setup_schedule() { if ( !wp_next_scheduled( 'fbe_cron_hourly_event' ) ) { wp_schedule_event( time(), 'every_five_minutes', 'fbe_cron_hourly_event'); //wp_schedule_event( time(), 'hourly', 'fbe_cron_hourly_event'); } } add_action( 'fbe_cron_hourly_event', 'fbe_cron_do_this_hourly' ); function fbe_cron_do_this_hourly() { // Check for new events every hour $pages = get_option("facebook_pages"); $location = array_filter(explode(",",$pages)); foreach ($location as $loc){ fbe_facebook_sdk($loc,get_option("app_id"),get_option("app_secret")); } update_option('fbe_cron_date', time()); } ?>But it doesn’t work 🙁
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Change scheduling frequence’ is closed to new replies.