WordAds_Cron

WordAds cron tasks.

Defined (1)

The class is defined in the following location(s).

/modules/wordads/php/cron.php  
  1. class WordAds_Cron { 
  2.  
  3. /** 
  4. * Add the actions the cron tasks will use 
  5. * @since 4.5.0 
  6. */ 
  7. function __construct() { 
  8. add_action( 'wordads_cron_status', array( $this, 'update_wordads_status' ) ); 
  9.  
  10. /** 
  11. * Registered scheduled events on activation 
  12. * @since 4.5.0 
  13. */ 
  14. static function activate() { 
  15. wp_schedule_event( time(), 'daily', 'wordads_cron_status' ); 
  16.  
  17. /** 
  18. * Clear scheduled hooks on deactivation 
  19. * @since 4.5.0 
  20. */ 
  21. static function deactivate() { 
  22. wp_clear_scheduled_hook( 'wordads_cron_status' ); 
  23.  
  24. /** 
  25. * Grab WordAds status from WP.com API 
  26. * @since 4.5.0 
  27. */ 
  28. static function update_wordads_status() { 
  29. WordAds_API::update_wordads_status_from_api();