LLMS_Order_Generator::error( string $code, string $message, array $extra_data = array() )

Returns an error object.


Description Description

This method accepts an error code and message and passes them directly to WP_Error and adds all class variables to the error objects $data parameter.


Top ↑

Parameters Parameters

$code

(string) (Required) Error code.

$message

(string) (Required) Error message.

$extra_data

(array) (Optional) Additional data to pass to WP_Error's 3rd parameter.

Default value: array()


Top ↑

Return Return

(WP_Error)


Top ↑

Source Source

File: includes/class-llms-order-generator.php

	protected function error( $code, $message, $extra_data = array() ) {

		$data = get_class_vars( __CLASS__ );
		foreach ( $data as $key => &$val ) {
			$val = $this->{$key};
		}

		return new WP_Error( $code, $message, array_merge( $data, $extra_data ) );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
7.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.