comment_author_IP()WP 0.71

Displays the IP address of the author of the current comment.

Хуков нет.


null. Ничего (null).


comment_author_IP( $comment_id );
WP_Comment or the ID of the comment for which to print the author's IP address.
По умолчанию: current comment

Список изменений

С версии 0.71 Введена.
С версии 4.4.0 Added the ability for $comment_id to also accept a WP_Comment object.

Код comment_author_IP() WP 6.5.3

function comment_author_IP( $comment_id = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
	echo esc_html( get_comment_author_IP( $comment_id ) );