WordPress at Your Fingertips
function is not described

WC_Background_Emailer::task() protected WC 1.0

Task

Override this method to perform any actions required on each queue item. Return the modified item for further processing in the next pass through. Or, return false to remove the item from the queue.

{} It's a method of the class: WC_Background_Emailer{}

No Hooks.

Return

Mixed.

Usage

// protected - for code of main (parent) or child class
$result = $this->task( $callback );
$callback(array) (required)
Update callback function.

Code of WC_Background_Emailer::task() WC 5.7.0

protected function task( $callback ) {
	if ( isset( $callback['filter'], $callback['args'] ) ) {
		try {
			WC_Emails::send_queued_transactional_email( $callback['filter'], $callback['args'] );
		} catch ( Exception $e ) {
			if ( Constants::is_true( 'WP_DEBUG' ) ) {
				trigger_error( 'Transactional email triggered fatal error for callback ' . esc_html( $callback['filter'] ), E_USER_WARNING ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
			}
		}
	}
	return false;
}