wp_latest_comments_draft_or_post_title example



            $author_markup = '';
            if ( $author_url ) {
                $author_markup .= '<a class="wp-block-latest-comments__comment-author" href="' . esc_url( $author_url ) . '">' . get_comment_author( $comment ) . '</a>';
            } else {
                $author_markup .= '<span class="wp-block-latest-comments__comment-author">' . get_comment_author( $comment ) . '</span>';
            }

            // `_draft_or_post_title` calls `esc_html()` so we don't need to wrap that call in             // `esc_html`.             $post_title = '<a class="wp-block-latest-comments__comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '">' . wp_latest_comments_draft_or_post_title( $comment->comment_post_ID ) . '</a>';

            $list_items_markup .= sprintf(
                /* translators: 1: author name (inside <a> or <span> tag, based on if they have a URL), 2: post title related to this comment */
                __( '%1$s on %2$s' ),
                $author_markup,
                $post_title
            );

            if ( $attributes['displayDate'] ) {
                $list_items_markup .= sprintf(
                    '<time datetime="%1$s" class="wp-block-latest-comments__comment-date">%2$s</time>',
                    
Home | Imprint | This part of the site doesn't use cookies.