WP_Comment::to_array │ public │ WP 4.4.0

Converts object to array.

Method of the class: WP_Comment{}

No Hooks.

Returns

array<string, mixed>. Object as array.

Usage

$WP_Comment = new WP_Comment();
$WP_Comment->to_array(): array;

Changelog

Since 4.4.0 Introduced.

WP_Comment::to_array() code WP 7.1.2

public function to_array(): array {
	/** @var Data_Array $comment */
	$comment = get_object_vars( $this );
	return $comment;
}