-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fix/post statuses in query #1114
Conversation
keepPlaceholderOnFocus is not used, and makes Reader validation throw an error https://github.com/WordPress/gutenberg/blob/trunk/packages/block-editor/src/components/rich-text/README.md
registerGenericStore is being deprecated
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.
This works well as described, but I'm uncertain about the idea of introducing a block attribute to show or not show preview posts.
Would it be enough and easier to understand if we simply showed all draft, scheduled, and published posts with labels for each non-published status in the block editor? On the front-end side, we could show these non-published posts if the user is logged in, has the edit_others_posts
capability, and there's a preview=true
param on the URL (meaning the post is visited from the "Preview" functionality in the editor).
Or, to make it even simpler, just always show all of the draft, scheduled and published posts to logged-in users with the right capabilities. In this case if an editor really wants to see a post "as it would appear to readers" they can view it in an incognito window.
At the very least, I would advocate for a simpler interface: instead of being able to select Publish, Draft, and/or Scheduled, just make it a single toggle (off by default) to "Show draft and scheduled posts" with the same explanation instead. Right now I can't really think of a good use case for not showing published posts since these will always be shown to readers, right?
A question – is checking for
edit_others_posts
capability a safe-enough check?
If we want to further lock it down we could add a nonce verification, but I think checking the login state plus edit_others_posts
is probably enough.
Thank you for your input, but I think it's based on assumptions about publishing workflows that we cannot make.
I imagine a WP user might:
This PR would support all these workflows, while the proposition in the comment would impair all of these, assuming drafts and scheduled posts are always few and desired when previewing. I'm all for simplification, but this is an non-core feature, and one which which uses established CMS concepts, so I don't think it's too complicated.
That's right – how about removing the "published" status from the UI, so user can only select what they want to see in addition to the published posts/ |
That's true—I think this is a feature which might benefit from some user feedback across sites of various sizes. I can certainly imagine the scenarios you describe but can't really say how many sites will actually encounter them.
I'm okay with this approach for now if you just want to get the feature out there. |
After an internal discussion:
|
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.
A minor style issue with Post Carousels, otherwise looking 👍
@@ -758,3 +758,17 @@ amp-script .wpnbha.has-more-button.is-error { | |||
} | |||
} | |||
/* stylelint-enable */ | |||
|
|||
// Also used by the Carousel block. | |||
.newspack-preview-label { |
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.
These styles aren't enqueued if a post only contains a Carousel block and not the Homepage Posts block.
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.
Thanks for catching that! Fixed in b9bf681
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.
Looking good now! 👍
🎉 This PR is included in version 1.51.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.51.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Closes #38
A question – is checking for
edit_others_posts
capability a safe-enough check?For design review – the label which marks non-published posts:
How to test the changes in this Pull Request:
Other information: