Do not display post link when the Post Type is not viewable #11525
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The wp_block is a good example: when you create a new reusable block from the editor, the success notice and the publish panel should not display links to the saved reusable block as these links lead to nowhere on the front-end. This can concern any post type setting their public property to false.
Description
I've added checks on the viewable property of the Post Type to make sure links leading to nowhere are not displayed within the editor notices or Publish panel when this property is set to false.
How has this been tested?
Gutenberg master / WordPress 5.0-beta3-20181106.024238
Screenshots
Without the changes, red arrows are showing the parts that the editor should not display for a not viewable post type.
With the changes, green arrows are showing how parts have been edited for the not viewable post types.
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist:
closes #8151