Ho questo codice che $comment_text lo mette a video tutto in formato testo anche gli eventuali link che ci scrivono gli utenti. Io avrei bisogno di modificarlo in modo che quando si inserisce il link diventa linkabile e poi ci metto il suo css.
PHP:
$comment_text = apply_filters( 'better_recent_comments_comment_text', $comment_text, $comment );
$comment_url = apply_filters( 'better_recent_comments_comment_url', esc_url( get_comment_link( $comment->comment_ID ) ) );
if ( 'post' === $link_from ) {
$post = sprintf( $link_fmt, $comment_url, $post );
} elseif ( 'date' === $link_from ) {
$date = sprintf( $link_fmt, $comment_url, $date );
} elseif ( 'comment' === $link_from ) {
$comment_text = sprintf( $link_fmt, $comment_url, $comment_text );
}
$comment_content = apply_filters( 'better_recent_comments_comment_content',
str_replace(
array( '{avatar}', '{author}', '{comment}', '{date}', '{post}' ),
array(
'<span class="comment-avatar">' . $avatar . '</span>',
'<span class="comment-author-link">' . $author . '</span>',
'<span class="comment-excerpt">' . $comment_text . '</span>',
'<span class="comment-date">' . $date . '</span>',
'<span class="comment-post">' . $post . '</span>'
),
$format
), $comment );
$output .= sprintf( $comment_li_fmt, $comment_item_style, $comment_content );
} // foreach comment
} else {
$output = sprintf( $comment_li_fmt, '', __( 'No recent comments available.', 'better-recent-comments' ) );
} // if comments
return apply_filters( 'better_recent_comments_list', sprintf( '<ul id="better-recent-comments" class="%s">%s</ul>', $comments_list_class, $output ) );
}
Ultima modifica: