Skip to content

Instantly share code, notes, and snippets.

@CookiesForDevo
Created March 11, 2016 00:39
Show Gist options
  • Save CookiesForDevo/5bd441b268297ba70afa to your computer and use it in GitHub Desktop.
Save CookiesForDevo/5bd441b268297ba70afa to your computer and use it in GitHub Desktop.
WordPress — Get wp-load.php to load WordPress for server CRON job
<?php
$wp_load = substr( dirname( __FILE__ ), 0, strpos( dirname( __FILE__ ), 'wp-content' ) ) . 'wp-load.php';
if ( ! empty( $wp_load ) && file_exists( $wp_load ) ) {
require_once $wp_load;
//cron things
} else {
die('Could not load WordPress');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment