Cron fixes from masquerade. #2425
git-svn-id: https://develop.svn.wordpress.org/trunk@3635 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
457b4b5251
commit
91fbcd183e
@ -365,7 +365,7 @@ function upgrade_210() {
|
|||||||
$posts = $wpdb->get_results("SELECT ID, post_date FROM $wpdb->posts WHERE post_status ='future'");
|
$posts = $wpdb->get_results("SELECT ID, post_date FROM $wpdb->posts WHERE post_status ='future'");
|
||||||
if ( !empty($posts) )
|
if ( !empty($posts) )
|
||||||
foreach ( $posts as $post )
|
foreach ( $posts as $post )
|
||||||
wp_schedule_event(mysql2date('U', $post->post_date), 'once', 'publish_future_post', $post->ID);
|
wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', $post->ID);
|
||||||
}
|
}
|
||||||
if ( $wp_current_db_version < 3570 ) {
|
if ( $wp_current_db_version < 3570 ) {
|
||||||
// Create categories for link categories if a category with the same
|
// Create categories for link categories if a category with the same
|
||||||
|
@ -6,7 +6,7 @@ function wp_schedule_single_event($timestamp, $hook) {
|
|||||||
ksort($crons);
|
ksort($crons);
|
||||||
update_option('cron', $crons);
|
update_option('cron', $crons);
|
||||||
}
|
}
|
||||||
function wp_schedule_new_event($timestamp, $recurrence, $hook) {
|
function wp_schedule_event($timestamp, $recurrence, $hook) {
|
||||||
$args = array_slice(func_get_args(), 3);
|
$args = array_slice(func_get_args(), 3);
|
||||||
$crons = get_option('cron');
|
$crons = get_option('cron');
|
||||||
$schedules = wp_get_schedules();
|
$schedules = wp_get_schedules();
|
||||||
@ -37,7 +37,7 @@ function wp_reschedule_event($timestamp, $recurrence, $hook) {
|
|||||||
while($timestamp < time() + 1) {
|
while($timestamp < time() + 1) {
|
||||||
$timestamp += $interval;
|
$timestamp += $interval;
|
||||||
}
|
}
|
||||||
wp_schedule_new_event($timestamp, $recurrence, $hook);
|
wp_schedule_event($timestamp, $recurrence, $hook);
|
||||||
}
|
}
|
||||||
|
|
||||||
function wp_unschedule_event($timestamp, $hook) {
|
function wp_unschedule_event($timestamp, $hook) {
|
||||||
@ -67,12 +67,6 @@ function wp_next_scheduled($hook) {
|
|||||||
function spawn_cron() {
|
function spawn_cron() {
|
||||||
if (array_shift(array_keys(get_option('cron'))) > time()) return;
|
if (array_shift(array_keys(get_option('cron'))) > time()) return;
|
||||||
|
|
||||||
//Since execute pings had CGI problems, but I'd like to test this without this code first
|
|
||||||
// It seems to be working on CGI here, please report if you have issues
|
|
||||||
/* if ( substr(php_sapi_name(), 0, 3) == 'cgi' ) {
|
|
||||||
echo '<iframe src="' . $cron_url . '"></iframe>';
|
|
||||||
}*/
|
|
||||||
|
|
||||||
$cron_url = get_settings('siteurl') . '/wp-cron.php';
|
$cron_url = get_settings('siteurl') . '/wp-cron.php';
|
||||||
$parts = parse_url($cron_url);
|
$parts = parse_url($cron_url);
|
||||||
|
|
||||||
|
@ -86,5 +86,6 @@ add_filter('option_ping_sites', 'privacy_ping_filter');
|
|||||||
add_action('wp_head', 'rsd_link');
|
add_action('wp_head', 'rsd_link');
|
||||||
add_action('publish_future_post', 'wp_publish_post', 10, 1);
|
add_action('publish_future_post', 'wp_publish_post', 10, 1);
|
||||||
add_action('wp_head', 'noindex', 1);
|
add_action('wp_head', 'noindex', 1);
|
||||||
add_action('init', 'wp_cron');
|
if(!defined('DOING_CRON'))
|
||||||
|
add_action('init', 'wp_cron');
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user