Make WordPress Core

Opened 22 months ago

Last modified 14 months ago

#53948 new defect (bug)

Missing View Post from Admin Bar AFTER Publish (not update)

Reported by: vondelphia's profile vondelphia Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Toolbar Keywords: has-patch
Focuses: Cc:

Description (last modified by sabernhardt)

This creates a broken flow during development by forcing user to refresh page after publisher. This was not the case for the older GUI. You could just click publish and see Admin toolbar menu item "View Post" popup.

Adding a new Post / Page and clicking publish does not show "View Post" in admin bar UNLESS you refresh the page. The bottom left corner tooltip-like popup is not very good.

  1. Log in WP Admin
  2. Create new Page / Post
  3. Click Publish
  4. "View Post" is not visible in admin bar

Attachments (4)

53948-admin-bar.php.diff (2.3 KB) - added by sabernhardt 22 months ago.
creating hidden placeholder link
53948-show-link-on-pageload.diff (2.1 KB) - added by sabernhardt 22 months ago.
second option: show preview link when page loads
view-posts-links-before-saving.png (49.6 KB) - added by sabernhardt 20 months ago.
adding View Post link to toolbar on new post screen (with 53948-show-link-on-pageload.diff)
53948.2.diff (2.3 KB) - added by sabernhardt 14 months ago.
updated since note in option with a temporarily hidden link (53948-admin-bar.php.diff)

Download all attachments as: .zip

Change History (13)

#1 @sabernhardt
22 months ago

  • Component changed from General to Toolbar
  • Description modified (diff)
  • Keywords needs-patch added

Hi again and thanks for the ticket!

The classic UI automatically refreshed the page when publishing, and the block editor does not.

I have seen at least one report about this before, but that was apparently on the Gutenberg repository (GB20309 is one and GB31915 points to two other issues).

Perhaps the admin toolbar could include a placeholder div when creating a new post, so the block editor can replace that with a View Post link at the time it's published.

Last edited 22 months ago by sabernhardt (previous) (diff)

@sabernhardt
22 months ago

creating hidden placeholder link

#2 @sabernhardt
22 months ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 5.9

In 53948-admin-bar.php.diff, I chose to hide the View Post link on page load because the link does not resolve yet. This would still require removing the hidden class when the editor publishes (and/or autosaves) the post.

On the other hand, the Permalink section already shows the same preview link when the page loads. If it's better to show the link immediately in the toolbar as well, the meta class line could be removed. Then the link should not need any editor script or hook.

I preferred setting the ID to 'view', though 'preview' might make more sense because it starts with the preview URL. Either option updates the URL when clicking Publish.

Last edited 22 months ago by sabernhardt (previous) (diff)

@sabernhardt
22 months ago

second option: show preview link when page loads

#3 @sabernhardt
22 months ago

The second option 53948-show-link-on-pageload.diff is simpler, though perhaps not better. If someone clicks that link before the post is (auto)saved or published, it would result in a 404 error.

The same error already happens with the sidebar Permalinks section's link, but the toolbar is more prominent (when not hidden in fullscreen mode).

And for this patch, I used the 'preview' link ID and its target.

@sabernhardt
20 months ago

adding View Post link to toolbar on new post screen (with 53948-show-link-on-pageload.diff)

This ticket was mentioned in Slack in #core-editor by sabernhardt. View the logs.


19 months ago

This ticket was mentioned in Slack in #core by sabernhardt. View the logs.


19 months ago

#6 @sabernhardt
19 months ago

  • Milestone changed from 5.9 to 6.0

This still needs a clear direction, so I'm moving it to the next release.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


19 months ago

This ticket was mentioned in Slack in #core by sabernhardt. View the logs.


14 months ago

@sabernhardt
14 months ago

updated since note in option with a temporarily hidden link (53948-admin-bar.php.diff)

#9 @sabernhardt
14 months ago

  • Milestone changed from 6.0 to Future Release
Note: See TracTickets for help on using tickets.