Changeset 9711 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/class-plugin.php
- Timestamp:
- 04/09/2020 06:54:12 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/class-plugin.php
r9616 r9711 47 47 48 48 add_action( 'init', [ $this, 'respect_robots_txt' ], 9 ); 49 50 add_action( 'init', [ $this, 'cron_tasks' ] ); 49 51 } 50 52 … … 58 60 // ?gp_route=robots.txt is here, as GlotPress ultimately is the router for the request. 59 61 add_rewrite_rule( '^robots\.txt$', 'index.php?robots=1&gp_route=robots.txt', 'top' ); 62 } 63 64 /** 65 * Some pages rely upon a regular cron task to update the stats rather than live updates. 66 */ 67 function cron_tasks() { 68 if ( ! wp_next_scheduled ( 'wporg_gp_stats_cache_waiting_strings' ) ) { 69 wp_schedule_event( time(), 'twicedaily', 'wporg_gp_stats_cache_waiting_strings' ); 70 } 71 add_action( 'wporg_gp_stats_cache_waiting_strings', [ __NAMESPACE__ . '\Routes\Stats', 'cache_waiting_strings' ] ); 60 72 } 61 73
Note: See TracChangeset
for help on using the changeset viewer.