W3cubDocs

/WordPress

Exception::__construct( string $message, string $type, mixed $data = null, integer $code )

Create a new exception

Parameters

$messagestringrequired
Exception message
$typestringrequired
Exception type
$datamixedoptional
Associated data

Default:null

$codeintegerrequired
Exception numerical code, if applicable

Source

public function __construct($message, $type, $data = null, $code = 0) {
	parent::__construct($message, $code);

	$this->type = $type;
	$this->data = $data;
}

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wporg-requests-exception/__construct