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

Do not display post link when the Post Type is not viewable #11525

Closed
wants to merge 1 commit into from

Conversation

imath
Copy link
Contributor

@imath imath commented Nov 6, 2018

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?

  1. I've tested my changes creating new reusable blocks from the Add New button of the reusable blocks management screen to check a not viewable post type has not front-end links displayed.
  2. I've tested my changes with regular (& viewable) post type to check these changes had no impact on the viewable post type.

Gutenberg master / WordPress 5.0-beta3-20181106.024238

Screenshots

bugnotviewable

Without the changes, red arrows are showing the parts that the editor should not display for a not viewable post type.

fixednoticepublishpanel

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:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

closes #8151

@danielbachhuber
Copy link
Member

Related #8151

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.
@youknowriad youknowriad force-pushed the fix/post-type-not-viewable branch from 47c37df to 32e9c44 Compare November 20, 2018 15:35
@youknowriad
Copy link
Contributor

I was going to merge this and I noticed that it's already fixed in master but in a slightly different way (there's no post publish panel for these CPTs).

Closing, let me know if I missed anything here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'View post' links shown when post type is not publicly_queryable
3 participants