WP_CLI\Fetchers

Comment::get()publicWP-CLI 1.0

Get a comment object by ID

Метод класса: Comment{}

Хуков нет.

Возвращает

WP_Comment|Массив|false. The item if found; false otherwise.

Использование

$Comment = new Comment();
$Comment->get( $arg );
$arg(строка) (обязательный)
The raw CLI argument.

Код Comment::get() WP-CLI 2.8.0-alpha

public function get( $arg ) {
	$comment_id = (int) $arg;
	$comment    = get_comment( $comment_id );

	if ( null === $comment ) {
		return false;
	}

	return $comment;
}