WP_Comment::__get

Advertisement

Summery Summery

Magic getter.

Syntax Syntax

WP_Comment::__get( string $name )

Description Description

If $name matches a post field, the comment post will be loaded and the post’s value returned.

Parameters Parameters

$name

(Required)

Return Return

(mixed)

Source Source

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

	 */
	public function __get( $name ) {
		if ( in_array( $name, $this->post_fields, true ) ) {
			$post = get_post( $this->comment_post_ID );
			return $post->$name;
		}

Advertisement

Changelog Changelog

Changelog
Version Description
4.4.0 Introduced.

Advertisement

Leave a Reply