WP_Comment::to_array() WordPress Method

The WP_Comment::to_array() method is used to convert a comment object into an array. This is useful for accessing comment data in a more flexible way, or for use with functions that require an array as input.

WP_Comment::to_array() #

Convert object to array.


Return

(array) Object as array.


Top ↑

Source

File: wp-includes/class-wp-comment.php

	public function to_array() {
		return get_object_vars( $this );
	}

Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.