Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_cron [ WordPress Function ]

wp_cron ( No parameters )
Returns:
  • (null) When doesn't need to run Cron.
Defined at:



Run scheduled callbacks or spawn cron for all scheduled events.

Source


<?php
function wp_cron() {

    
// Prevent infinite loops caused by lack of wp-cron.php
    
if ( strpos($_SERVER['REQUEST_URI'], '/wp-cron.php') !== false || ( defined('DISABLE_WP_CRON') && DISABLE_WP_CRON ) )
        return;

    if ( 
false === $crons _get_cron_array() )
        return;

    
$local_time microtimetrue );
    
$keys array_keys$crons );
    if ( isset(
$keys[0]) && $keys[0] > $local_time )
        return;

    
$schedules wp_get_schedules();
    foreach ( 
$crons as $timestamp => $cronhooks ) {
        if ( 
$timestamp $local_time ) break;
        foreach ( (array) 
$cronhooks as $hook => $args ) {
            if ( isset(
$schedules[$hook]['callback']) && !call_user_func$schedules[$hook]['callback'] ) )
                continue;
            
spawn_cron$local_time );
            break 
2;
        }
    }
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics