- <?php /* translators: %1$s is type of comment, %2$s is link to the post */ ?>
- <p class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link ); ?></p>
+ <p class="comment-meta">
+ <?php
+ // Pingbacks, Trackbacks or custom comment types might not have a post they relate to, e.g. programmatically created ones.
+ if ( $comment_post_link ) {
+ printf(
+ /* translators: 1: type of comment, 2: post link, 3: notification if the comment is pending */
+ _x( '%1$s on %2$s %3$s', 'dashboard' ),
+ "<strong>$type</strong>",
+ $comment_post_link,
+ '<span class="approve">' . __( '[Pending]' ) . '</span>'
+ );
+ } else {
+ printf(
+ /* translators: 1: type of comment, 2: notification if the comment is pending */
+ _x( '%1$s %2$s', 'dashboard' ),
+ "<strong>$type</strong>",
+ '<span class="approve">' . __( '[Pending]' ) . '</span>'
+ );
+ }
+ ?>
+ </p>