Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Preview button for non-viewable post types. #5749

Closed
ryanboswell opened this issue Mar 22, 2018 · 3 comments
Closed

Disable Preview button for non-viewable post types. #5749

ryanboswell opened this issue Mar 22, 2018 · 3 comments
Assignees
Labels
Core REST API Task Task for Core REST API efforts [Type] Bug An existing feature does not function as intended

Comments

@ryanboswell
Copy link

Issue Overview

Currently if a post type is not viewable (as determined by is_post_type_viewable in core), the Classic Editor and Post list table will not show a Preview button or link, but Gutenberg shows the button regardless. This results in a false-impression that users can preview a post if they are editing in Gutenberg and will result a broken link.

This happens on the latest master of Gutenberg.

Steps to Reproduce (for bugs)

  1. Create a new custom post type, with publicly_queryable set to false.
  2. Add a new post using Gutenberg's editor and see that the Preview button appears (even after saving as draft).
  3. Add a new post using the Classic Editor and see that no Preview button appears (even after saving as draft)
  4. Repeat with an existing post and confirm the same Preview button behavior as steps 2/3.

Expected Behavior

If a post type is not viewable (ie. public or publicly_queryable, Gutenberg should not display a Preview button in the UI.

Current Behavior

Gutenberg displays a Preview button in the editor UI regardless of the post type properties that should otherwise disable it.

@Soean Soean added the [Type] Bug An existing feature does not function as intended label Mar 23, 2018
@jorgefilipecosta jorgefilipecosta self-assigned this Mar 23, 2018
@jorgefilipecosta jorgefilipecosta added the [Status] In Progress Tracking issues with work in progress label Mar 23, 2018
@mtias mtias added the Core REST API Task Task for Core REST API efforts label Apr 2, 2018
@jorgefilipecosta jorgefilipecosta removed the [Status] In Progress Tracking issues with work in progress label Apr 4, 2018
@danielbachhuber danielbachhuber added this to the Core API milestone Apr 11, 2018
@danielbachhuber
Copy link
Member

@jorgefilipecosta Can I pick this up for you?

@jorgefilipecosta jorgefilipecosta removed their assignment Apr 11, 2018
@jorgefilipecosta
Copy link
Member

Yes @danielbachhuber, please feel free to pick it 👍

@danielbachhuber danielbachhuber self-assigned this Apr 11, 2018
@danielbachhuber
Copy link
Member

Core Trac ticket to introduce a previewable attribute is: https://core.trac.wordpress.org/ticket/43739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core REST API Task Task for Core REST API efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants