-
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
Carousel: Only query posts with thumbnails #440
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.
In my testing I'm getting identical results on this branch and master. Am I testing correctly?
- Added a console log to view
latestPosts
to verify what's coming back, after https://github.com/Automattic/newspack-blocks/blob/master/src/blocks/carousel/edit.js#L46 - Removed the Featured Image from top post.
- Added and published a new post with no Featured Image.
- Set Number of Items to 3
- On
master
andupdate/thumbnail-requests
I'm getting 3 posts back, including the two featured image-less ones.
@jeffersonrabb I updated the callback to be more specific about the parameters it expects and acts on. It should now only return posts with associated featured images. |
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 PR is included in version 1.3.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Not sure how smart it is to unilaterally open the posts endpoint up to meta queries. I suppose we could pass a custom parameter and "hard-code" the post thumbnail meta query based on that?
Regardless, with this change the carousel in the Editor will now contain the same posts as it does in the front-end. Currently it just displays X number of most recent posts and hopes they have featured images assigned to them.
How to test the changes in this Pull Request:
Other information: