Make WordPress Core

Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#50312 closed enhancement (fixed)

Add View Post link to Admin Bar of Edit Comments page when viewing comments for a single post.

Reported by: Otto42 Owned by: SergeyBiryukov
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Toolbar Keywords:
Focuses: administration Cc:


When viewing the comments page for a single post, such as this:


The admin bar should have a "View Post" link to view that post specifically. It helps with context to be able to view the post without having to look for the link. This is similar to the View Post link in the Editor or whenever otherwise viewing a single post.

First draft patch to add a simple link attached.

Attachments (1)

50312.diff (1003 bytes) - added by Otto42 4 months ago.
Add view post link to edit comments page

Download all attachments as: .zip

Change History (8)

4 months ago

Add view post link to edit comments page

#1 @matt
4 months ago

This is a request from me! Would love if we can get this tweak in.

#2 @SergeyBiryukov
4 months ago

  • Component changed from Administration to Toolbar
  • Focuses administration added
  • Milestone changed from Awaiting Review to 5.5

#3 @SergeyBiryukov
4 months ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#4 @SergeyBiryukov
4 months ago

50312.diff is a good start, but there is an existing code for displaying the "View Post" link that respects the post type object's public and show_in_admin_bar properties, as well as the post status. So it seems better to reuse that existing code instead of duplicating it. Commit incoming.

#5 @SergeyBiryukov
4 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 47903:

Toolbar: Display a "View Post" link when viewing comments for a single post on Comments screen.

Props Otto42, matt, SergeyBiryukov.
Fixes #50312.

#6 @davidbaumwald
4 months ago

Confirmed with @SergeyBiryukov that the DocBlock above the function should be updated with the added global. He says another small commit is expected.

#7 @SergeyBiryukov
4 months ago

In 47906:

Docs: Add missing @global reference for the $post_id global in wp_admin_bar_edit_menu().

Follow-up to [47903].

Props davidbaumwald.
See #50312.

Note: See TracTickets for help on using tickets.