WordPress.org

Make WordPress Core

Changeset 12462


Ignore:
Timestamp:
12/19/2009 11:47:16 AM (10 years ago)
Author:
westi
Message:

Fix wp_clear_scheduled_hook() so that it function prototype matches the other cron functions.
Include backwards compatibility code so that plugins that used the old way still work.
Fixes #10468.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/cron.php

    r12341 r12462  
    131131 *
    132132 * @param string $hook Action hook, the execution of which will be unscheduled.
    133  * @param mixed $args,... Optional. Event arguments.
    134  */
    135 function wp_clear_scheduled_hook( $hook ) {
    136     $args = array_slice( func_get_args(), 1 );
     133 * @param array $args Optional. Arguments that were to be pass to the hook's callback function.
     134 */
     135function wp_clear_scheduled_hook( $hook, $args = array() ) {
     136    // Backward compatibility
     137    // Previously this function took the arguments as discrete vars rather than an array like the rest of the API
     138    if ( !is_array($args) )
     139        $args = array_slice( func_get_args(), 1 );
    137140
    138141    while ( $timestamp = wp_next_scheduled( $hook, $args ) )
Note: See TracChangeset for help on using the changeset viewer.