WP HOOKS
filtrod 1.2.0

comment_text

Args 3Plik wp-includes/comment-template.phpDokumentacja WP ↗

Opis

Filtruje treść komentarza przy wyświetlaniu.

Przykład użycia

add_filter( 'comment_text', ... )php
add_filter( 'comment_text', 'wpdocs_comment_text' );

function wpdocs_comment_text( $text ) {
	return '<div class="comment-body">' . $text . '</div>';
}

Parametry

ParametrTypOpis
$comment_textstringText of the comment.
$comment\WP_Comment | nullThe comment object. Null if not found.
$argsarrayAn array of arguments.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'comment_text', 'twoja_funkcja', 10, 3 );

function twoja_funkcja($param_1, $param_2, $param_3) {
	// Twój kod
}

Popularne w tej kategorii