-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Missing Post Type supports in Options Modal #12394
Missing Post Type supports in Options Modal #12394
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Should we also wrap the permalink section with check? It Was added in #12132. |
ff89e74
to
6916132
Compare
@gziolo Absolutely. Thanks for mentioning it. I've just updated the PR accordingly.
|
It would be nice if we didn't display the section title when there are no options underneath it. This came up in #11802 (comment) as well. |
packages/edit-post/src/components/options-modal/meta-boxes-section.js
Outdated
Show resolved
Hide resolved
Yes, I opened #11923 to track it. |
beda76c
to
20d1669
Compare
Let's tackle #11923 in a seperate PR. I don't think it's urgent. |
Fine with me @noisysocks, should I revert 20d1669 @gziolo ? |
Yes, I would put it in a follow-up PR so we could iterate on it 👍 |
const hasPageAttributeSupport = get( postType, [ 'supports', 'page-attributes' ], false ) || hasTemplates; | ||
let documentPanelsSection; | ||
|
||
if ( isViewable || hasTaxonomies || hasFeaturedImageSupport || hasExcerptSupport || hasCommentsSupport || hasPageAttributeSupport ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's going to be a more tricky check. All those panels can be also removed programmatically :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😱
20d1669
to
f295ac5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good after all changes made 👍
@noisysocks - do you want to perform another round of testing before we proceed? It's blocked by your review at the moment :) |
@gziolo: Dismissed my stale review. Am doing a support rotation this week so best not wait for me 🙂 |
@imath - can you rebase with |
Featured Image is not only a Theme thing, it is possible for a custom post type to declare itself without supporting the `thumbnail` feature. A custom post type can also register itself withour supporting `comments` and/or `custom-fields`. As a result the corresponding Document panels in the editor sidebar are not displayed. The Options Modal should also avoid displaying the panel checkboxes if the custom post type does not support these 3 features
As recommanded by @noisysocks : make sure the behavior about custom fields is consistent between WordPress 5.0 RC and the Gutenberg plugin
It should fix the failing test.
…alink modal options checkbox Apply @jorgefilipecosta advice.
f295ac5
to
3e360ae
Compare
@gziolo Sure, I've just rebased the PR 😉 |
@youknowriad sorry i’ve clicked on the resolve button before posting this comment. There’s no need to backport as it is already there these lines simply moved down a few lines. You should see the removed lines highlighted in red into the changes. |
And btw thanks a lot for the merge 😍 |
thumbnail
feature.comments
and/orcustom-fields
.As a result the corresponding Document panels in the editor sidebar are not displayed. The Options Modal should also avoid displaying the panel checkboxes if the custom post type does not support these 3 features
Description
To fix this issue, i've wrapped featured image, comments and custom fields checkboxes into
<PostTypeSupportCheck/>
componentsHow has this been tested?
I've tested the PR with the
wp_block
post type which only supports thetitle
andeditor
features and check everything was still behaving the right way with thepost
post type.Screenshots
Without the PR applied:
Checkboxes for featured image, comments, and custom fields are displayed although they shouldn't
With the PR applied:
The checkboxes for these 3 unsupported features are no more displayed.
Types of changes
Bug fix
Checklist: