Example #1
0
            SP_Sync_Manager()->do_index_loop();
            if (SP_Sync_Meta()->running) {
                $this->schedule_reindex();
            }
        }
        /**
         * Schedule the next indexing iteration.
         */
        public function schedule_reindex()
        {
            if (!wp_next_scheduled('sp_reindex')) {
                wp_schedule_single_event(time() + 5, 'sp_reindex');
            }
        }
        /**
         * Cancel the indexing process.
         */
        public function cancel_reindex()
        {
            wp_clear_scheduled_hook('sp_reindex');
            SP_Sync_Meta()->stop('save');
        }
    }
    function SP_Cron()
    {
        return SP_Cron::instance();
    }
    if (defined('DOING_CRON') && DOING_CRON) {
        SP_Cron();
    }
}
 /**
  * Cancel reindexing.
  */
 public function cancel_reindex()
 {
     SP_Cron()->cancel_reindex();
 }