mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Comments: Include a "View Post" link on the Comments screen for a single post.
This makes it easier to view the post on the front end of the site when moderating comments, without having to open the editor first. Props trejder, audrasjb, vladytimy, lukecarbis, ayeshrajans, chaion07, paaljoachim, hareesh-pillai, SergeyBiryukov. Fixes #52353. git-svn-id: https://develop.svn.wordpress.org/trunk@50999 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -228,6 +228,18 @@ if ( $post_id ) {
|
||||
</h1>
|
||||
|
||||
<?php
|
||||
if ( $post_id ) {
|
||||
$post_type_object = get_post_type_object( get_post_type( $post_id ) );
|
||||
|
||||
if ( $post_type_object ) {
|
||||
printf(
|
||||
'<a href="%1$s" class="comments-view-item-link">%2$s</a>',
|
||||
get_permalink( $post_id ),
|
||||
$post_type_object->labels->view_item
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
|
||||
echo '<span class="subtitle">';
|
||||
printf(
|
||||
|
||||
Reference in New Issue
Block a user