Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#31598 closed defect (bug) (duplicate)

wp_schedule_single_event() should return true on success, false on failure

Reported by: ghosttoast's profile GhostToast Owned by: ericlewis's profile ericlewis
Milestone: Priority: normal
Severity: normal Version: 2.1
Component: Cron API Keywords:
Focuses: Cc:

Description

Docbloc for wp_schedule_single_event() indicates no return, yet it returns null if the event is already scheduled, or false if the event gets wiped out by a filter. It would be handy if the function returned true on success.

This would aid in logic otherwise performed with wp_next_scheduled() (which is called at the onset of wp_schedule_single_event()). Patch attached.

Attachments (1)

patch_31598.diff (981 bytes) - added by GhostToast 9 years ago.
Patch of wp-includes/cron.php

Download all attachments as: .zip

Change History (6)

@GhostToast
9 years ago

Patch of wp-includes/cron.php

#1 @DrewAPicture
9 years ago

  • Keywords has-patch added
  • Version changed from trunk to 2.1

#2 @jrtashjian
8 years ago

This patch is tested and ready to go. How can we move forward with this trivial update?

#3 @boonebgorges
8 years ago

  • Owner set to ericlewis
  • Status changed from new to assigned

#4 @jrf
8 years ago

I vote to close this ticket in favour of the more comprehensive ticket & patch https://core.trac.wordpress.org/ticket/21072.

#5 @ericlewis
8 years ago

  • Keywords has-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed

@jrf thanks for finding that! I agree.

@GhostToast thanks for opening up this ticket and welcome to WordPress Trac! Please follow along and feel free to participate in #21072 for follow-up on this issue.

Note: See TracTickets for help on using tickets.