Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. <?php
  2.  
  3. if ( defined( 'DOING_CRON' ) ) {
  4. if ( ! get_transient( 'daemon_running' ) ) {
  5. set_transient( 'daemon_running', true );
  6. register_shutdown_function( function () {
  7. sleep( 1 );
  8. set_transient( '_cron_daemon_running', false );
  9. $args = array(
  10. 'timeout' => 0.1,
  11. );
  12. wp_remote_get( site_url( 'wp-cron.php?doing_wp_cron' ), $args );
  13. } );
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement