Created
March 11, 2016 00:39
-
-
Save CookiesForDevo/5bd441b268297ba70afa to your computer and use it in GitHub Desktop.
WordPress — Get wp-load.php to load WordPress for server CRON job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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