WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#28350 closed defect (bug) (fixed)

"View Post" buttons for drafts not consistent

Reported by: mordauk Owned by: SergeyBiryukov
Milestone: 4.0 Priority: low
Severity: normal Version: 4.0
Component: Editor Keywords: commit dev-reviewed
Focuses: ui, administration Cc:

Description

When a post is saved as a draft, the main publish box shows a "Preview" button. The URL for the preview button is http://site.com/?p=149&preview=true.

Next to the post's permalink, however, is a "View" button. The URL for this button is http://site.com/?p=149 and is missing the &preview=true parameter.

Also in the toolbar is a "View" button that's identical to the "View" button next to the permalink. It also has a URL of http://site.com/?p=149.

Since the post is a draft, it seems logical that all of the buttons should all be "Preview" or "Preview Post" and should all have the &preview=true parameter.

Having the buttons next to the permalink and the toolbar show "View Post" is just confusing when the post is a draft. I've caught myself several times thinking "oh, did I publish this by accident?" when seeing the "View Post" buttons.

https://cloudup.com/cuavhdeBxl1

Attachments (5)

28350.patch (1.6 KB) - added by mordauk 6 years ago.
28350-2.patch (1.5 KB) - added by mordauk 6 years ago.
Patch with updated doc block
28350-3.patch (1.2 KB) - added by mordauk 6 years ago.
Updates View link in tool bar
28350.4.patch (2.8 KB) - added by SergeyBiryukov 6 years ago.
28350.5.patch (1.2 KB) - added by SergeyBiryukov 6 years ago.

Download all attachments as: .zip

Change History (24)

@mordauk
6 years ago

#1 @mordauk
6 years ago

  • Keywords has-patch ui-feedback added

#2 follow-up: @SergeyBiryukov
6 years ago

  • Milestone changed from Awaiting Review to 4.0

The docblock should just be /** This filter is documented in wp-admin/includes/meta-boxes.php */.

@mordauk
6 years ago

Patch with updated doc block

#3 in reply to: ↑ 2 @mordauk
6 years ago

Replying to SergeyBiryukov:

The docblock should just be /** This filter is documented in wp-admin/includes/meta-boxes.php */.

Aha! I was wondering what the proper method was for that, thanks! Updated patch attached.

@mordauk
6 years ago

Updates View link in tool bar

#4 @mordauk
6 years ago

28350-3.patch updates the tool bar to show Preview instead of View if the current item is a draft and the current user can read it.

#5 @SergeyBiryukov
6 years ago

  • Keywords commit added

#6 @SergeyBiryukov
6 years ago

28350.4.patch uses a consistent target for all three links to avoid opening multiple tabs with the same preview.

#7 @SergeyBiryukov
6 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 28920:

Display consistent preview links for drafts.

props mordauk.
fixes #28350.

#8 @SergeyBiryukov
6 years ago

In 28946:

Display a correct preview link for drafts when permalinks are disabled.

see #28350.

Last edited 6 years ago by SergeyBiryukov (previous) (diff)

#9 @SergeyBiryukov
6 years ago

In 28948:

Simplify a condition in get_sample_permalink_html().

see #28350.

Version 0, edited 6 years ago by SergeyBiryukov (next)

#10 @SergeyBiryukov
6 years ago

In 28948:

Simplify a condition in get_sample_permalink_html().

see #28350.

#11 @nacin
6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

The standard "Preview Changes" button actually submits a form to ensure you are previewing the latest changes. This new "Preview" button does not do this, which is why it was always just "View Post".

This ticket was mentioned in IRC in #wordpress-dev by nacin. View the logs.


6 years ago

#13 @nacin
6 years ago

  • Priority changed from normal to low

#14 @helen
6 years ago

  • Keywords has-patch ui-feedback commit removed

#15 @helen
6 years ago

  • Keywords commit dev-reviewed added

#16 @SergeyBiryukov
6 years ago

Per IRC, the issue is that we have three preview links for drafts, only one of which actually previews the latest changes. The consensus is to still apply the preview_post_link filter for the other two links, but change the label back to "View Post".

#17 @SergeyBiryukov
6 years ago

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

In 29695:

Restore the post type's view_item label for preview links that don't submit the changes.

fixes #28350.

#18 @nacin
5 years ago

In 30410:

Revert [28948] for the 4.0 branch, which caused a regression.

see #29573 for 4.0. see #28350.

#19 @SergeyBiryukov
5 years ago

In 30791:

Revert [28948], which caused a regression.

see #29573 for trunk. see #28350.

Note: See TracTickets for help on using tickets.