Switch language

wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren




wp_schedule_single_event [ WordPress Function ]

wp_schedule_single_event ( $timestamp, $hook, $args = array() )
Parameter:
  • (int) $timestamp Timestamp for when to run the event.
  • (string) $hook Action hook to execute when cron is run.
  • (array) $args Optional. Arguments to pass to the hook's callback function.
Links:
Definiert in:



Schedules a hook to run only once.

Schedules a hook which will be executed once by the WordPress actions core at a time which you specify. The action will fire off when someone visits your WordPress site, if the schedule time has passed.

Source


<?php
function wp_schedule_single_event$timestamp$hook$args = array()) {
    
// don't schedule a duplicate if there's already an identical event due in the next 10 minutes
    
$next wp_next_scheduled($hook$args);
    if ( 
$next && $next <= $timestamp 600 )
        return;

    
$crons _get_cron_array();
    
$event = (object) array( 'hook' => $hook'timestamp' => $timestamp'schedule' => false'args' => $args );
    
$event apply_filters('schedule_event'$event);

    
// A plugin disallowed this event
    
if ( ! $event )
        return 
false;

    
$key md5(serialize($event->args));

    
$crons[$event->timestamp][$event->hook][$key] = array( 'schedule' => $event->schedule'args' => $event->args );
    
uksort$crons"strnatcasecmp" );
    
_set_cron_array$crons );
}
?>

Beispiele [ wp-snippets.com ]

Top Google Suchergebnisse

Mehr ...

0 Nutzerkommentare

Noch keine. Sei der Erste!

Neu hinzufügen ...



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