filtrod 1.2.0
comment_text
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>';
}
add_filter( 'comment_text', 'wpdocs_comment_text' );
function wpdocs_comment_text( $text ) {
return '<div class="comment-body">' . $text . '</div>';
}Parametry
| Parametr | Typ | Opis |
|---|---|---|
$comment_text | string | Text of the comment. |
$comment | \WP_Comment | null | The comment object. Null if not found. |
$args | array | An 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
}
// 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