Changeset 9720 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/class-plugin.php
- Timestamp:
- 04/14/2020 04:55:52 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
r9711 r9720 47 47 48 48 add_action( 'init', [ $this, 'respect_robots_txt' ], 9 ); 49 50 add_action( 'init', [ $this, 'cron_tasks' ] );51 49 } 52 50 … … 60 58 // ?gp_route=robots.txt is here, as GlotPress ultimately is the router for the request. 61 59 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' ] );72 60 } 73 61
Note: See TracChangeset
for help on using the changeset viewer.