WP_Comments_List_Table::column_author()publicWP 1.0

{} Это метод класса: WP_Comments_List_Table{}

Хуки из метода

Возвращает

null. Ничего.

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

$WP_Comments_List_Table = new WP_Comments_List_Table();
$WP_Comments_List_Table->column_author( $comment );
$comment(WP_Comment) (обязательный)
The comment object.

Заметки

  • Global. Строка. $comment_status

Код WP_Comments_List_Table::column_author() WP 6.0.2

public function column_author( $comment ) {
	global $comment_status;

	$author_url = get_comment_author_url( $comment );

	$author_url_display = untrailingslashit( preg_replace( '|^http(s)?://(www\.)?|i', '', $author_url ) );

	if ( strlen( $author_url_display ) > 50 ) {
		$author_url_display = wp_html_excerpt( $author_url_display, 49, '…' );
	}

	echo '<strong>';
	comment_author( $comment );
	echo '</strong><br />';

	if ( ! empty( $author_url_display ) ) {
		// Print link to author URL, and disallow referrer information (without using target="_blank").
		printf(
			'<a href="%s" rel="noopener noreferrer">%s</a><br />',
			esc_url( $author_url ),
			esc_html( $author_url_display )
		);
	}

	if ( $this->user_can ) {
		if ( ! empty( $comment->comment_author_email ) ) {
			/** This filter is documented in wp-includes/comment-template.php */
			$email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );

			if ( ! empty( $email ) && '@' !== $email ) {
				printf( '<a href="%1$s">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) );
			}
		}

		$author_ip = get_comment_author_IP( $comment );

		if ( $author_ip ) {
			$author_ip_url = add_query_arg(
				array(
					's'    => $author_ip,
					'mode' => 'detail',
				),
				admin_url( 'edit-comments.php' )
			);

			if ( 'spam' === $comment_status ) {
				$author_ip_url = add_query_arg( 'comment_status', 'spam', $author_ip_url );
			}

			printf( '<a href="%1$s">%2$s</a>', esc_url( $author_ip_url ), esc_html( $author_ip ) );
		}
	}
}