• Resolved forexfilms.com

    (@forexfilmscom)


    I’m trying to schedule a function to be called hourly and set the event when the plugin is activated and remove it when it is deactivated. The function to run is feed_loader(). My code is below. It isn’t running the function so I must be doing something wrong. What is it?

    register_activation_hook(__FILE__, 'aggregator_activation');
    register_deactivation_hook(__FILE__, 'aggregator_deactivation');
    
    add_action('feed_loader_hook', 'feed_loader');
    
    function aggregator_activation()
    {
    	wp_schedule_event(time(), 'hourly', 'feed_loader');
    }
    
    function aggregator_deactivation()
    {
    	wp_clear_scheduled_hook('feed_loader');
    }

The topic ‘Schedule running Functions’ is closed to new replies.