Make WordPress Core

Opened 6 years ago

Last modified 6 months ago

#50290 new enhancement

Edit Post and Edit Page is not showing in Admin Bar, When I open any Post or Page in new tab while in Customize

Reported by: dhruvpandya's profile dhruvpandya Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Customize Keywords: dev-feedback has-screenshots has-patch
Focuses: administration Cc:

Description

In Customize, When I try to open any post or any page with the open link in new tab or open lin in new window, Edit Post or Edit Page is not showing in Admin Bar. But when I try to open any Category or Tag with the open link in a new tab or new window, it showing Edit Category and Edit Tag in Admin Bar.

I have attached a gif file and screenshots for a better understanding.

Attachments (7)

50290.gif (1.6 MB) - added by dhruvpandya 6 years ago.
50290 (1).png (111.4 KB) - added by dhruvpandya 6 years ago.
50290 (2).png (111.6 KB) - added by dhruvpandya 6 years ago.
50290 (3).png (107.5 KB) - added by dhruvpandya 6 years ago.
50290 (4).png (102.2 KB) - added by dhruvpandya 6 years ago.
50290.patch (726 bytes) - added by wpamitkumar 6 years ago.
50290.2.patch (1.3 KB) - added by callumbw95 6 months ago.
Modernised patch that also complies with the changes in 38648

Change History (10)

@dhruvpandya
6 years ago

@dhruvpandya
6 years ago

@dhruvpandya
6 years ago

@dhruvpandya
6 years ago

@dhruvpandya
6 years ago

#1 @wpamitkumar
6 years ago

  • Keywords has-patch added; needs-patch removed

We need to remove get_edit_post_link filter from customize_preview_init() function. After, It will show edit Post and edit Page in Admin Bar, When you open any Post or Page in a new tab while in Customize.

@wpamitkumar
6 years ago

#2 @celloexpressions
5 years ago

I believe this is the intended behavior whenever a page is viewed in the context of a customize preview session. More specifically, when the customize_changeset URL parameter is passed. The reasoning being that editing the post context within the context of a customize changeset would be technically problematic.

Can anyone deeply familiar with changesets confirm this intent, and whether 50290.patch would likely cause issues?

#3 @callumbw95
6 months ago

Hi All,

I have been doing some digging into this tickets history, and I came across the ticket where the line to remove the edit post button was initially added. This looks to have been added deliberately to resolve an issue where non-logged in users could view a preview of a page, but the page would display various edit post buttons across the page as well as in the admin-bar which did nothing. As of such I have attached a patch that will work in conjunction with the original reasoning but also fix the above issue.

@callumbw95
6 months ago

Modernised patch that also complies with the changes in 38648

Note: See TracTickets for help on using tickets.