public function delete( $args, $assoc_args ) {

		$hook   = $args[0];
		$events = self::get_cron_events();

		if ( is_wp_error( $events ) ) {
			WP_CLI::error( $events );
		}

		$deleted = 0;
		foreach ( $events as $event ) {
			if ( $event->hook === $hook ) {
				$result = self::delete_event( $event );
				if ( $result ) {
					$deleted++;
				} else {
					WP_CLI::warning( sprintf( "Failed to the delete the cron event '%s'.", $hook ) );
				}
			}
		}

		if ( $deleted ) {
			$message = ( 1 === $deleted ) ? "Deleted the cron event '%2\$s'." : "Deleted %1\$d instances of the cron event '%2\$s'.";
			WP_CLI::success( sprintf( $message, $deleted, $hook ) );
		} else {
			WP_CLI::error( sprintf( "Invalid cron event '%s'.", $hook ) );
		}

	}
public function delete( $args, $assoc_args ) {

		$hook   = $args[0];
		$events = self::get_cron_events();

		if ( is_wp_error( $events ) ) {
			WP_CLI::error( $events );
		}

		$deleted = 0;
		foreach ( $events as $event ) {
			if ( $event->hook === $hook ) {
				$result = self::delete_event( $event );
				if ( $result ) {
					$deleted++;
				} else {
					WP_CLI::warning( sprintf( "Failed to the delete the cron event '%s'.", $hook ) );
				}
			}
		}

		if ( $deleted ) {
			$message = ( 1 === $deleted ) ? "Deleted the cron event '%2\$s'." : "Deleted %1\$d instances of the cron event '%2\$s'.";
			WP_CLI::success( sprintf( $message, $deleted, $hook ) );
		} else {
			WP_CLI::error( sprintf( "Invalid cron event '%s'.", $hook ) );
		}

	}
public function delete ( $ args , $ assoc_args ) { $ hook = $ args [ 0 ] ; $ events = self :: get_cron_events ( ) ; if ( is_wp_error ( $ events ) ) { WP_CLI :: error ( $ events ) ; } $ deleted = 0 ; foreach ( $ events as $ event ) { if ( $ event -> hook === $ hook ) { $ result = self :: delete_event ( $ event ) ; if ( $ result ) { $ deleted ++ ; } else { WP_CLI :: warning ( sprintf ( "Failed to the delete the cron event '%s'." , $ hook ) ) ; } } } if ( $ deleted ) { $ message = ( 1 === $ deleted ) ? "Deleted the cron event '%2\$s'." : "Deleted %1\$d instances of the cron event '%2\$s'." ; WP_CLI :: success ( sprintf ( $ message , $ deleted , $ hook ) ) ; } else { WP_CLI :: error ( sprintf ( "Invalid cron event '%s'." , $ hook ) ) ; } }
Deletes the next scheduled cron event for the given hook.

## OPTIONS

<hook>
: The hook name.

## EXAMPLES

# Delete the next scheduled cron event
$ wp cron event delete cron_test
Success: Deleted 2 instances of the cron event 'cron_test'.
Deletes the next scheduled cron event for the given hook .