-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Added ability to filter latest posts by author #16169
Added ability to filter latest posts by author #16169
Conversation
Thanks for working on this @pstonier! The PR was discussed in a core-editor triage (https://wordpress.slack.com/archives/C02QB2JS7/p1562825386362400 - link requires slack sign up) We decided to switch the label to Needs Design Feedback. Firstly we felt technical feedback can be provided through the normal code review process. Secondly, it'd be good to understand the motivation behind this PR (as there's no linked issue) and to make sure the UI is implemented in the right way in terms of design and behaviour of the dropdown. |
All sounds good. From the motivation factor: we had been working on a page that was a bio about some of our consultants and needed a way to list the articles they'd authored. I had expected it to be an available filter option and when I found that it wasn't, I found my way around to adding it. |
…update/latest-posts-author-filter
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 effectively copies the same logic as the category filter and from my tests it appears that it works correctly. I do not approve only because of the "Needs design feedback" label, but my opinion is that we go ahead with it.
This feature seems straight forward to me. Can some design folks add a comment please? As it would be nice to get it code reviewed and merged. @karmatosed @mapk @kjellr @jasmussen @melchoyce |
About to do some travelling so can't review in depth. But based on the screenshots alone, this seems good. It's an advanced feature, so it's in the sidebar, and it's a dropdown like the others. 👍 👍 |
This PR looks ready for a final code review and merge. Thanks! |
…update/latest-posts-author-filter
…update/latest-posts-author-filter
…update/latest-posts-author-filter
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.
I just tested this today and it's working as expected. I like that I'm able to filter the posts by author now! Thanks. I'm approving from a design perspective.
One thing to note is now that I can filter by Author, I'd like a toggle to show the author which should probably exist here:
Of course, don't let that hold up this PR.
I like that idea and have updated the code to add that. |
When the code is dialed in again and you'd like another review, just ping me. @draganescu thanks for stepping in to help. |
Howdy @pstonier , Trying to test this, setting show author option I get: TypeError: post.author_info is undefined edit.js:453:15 and the block crashes. Also a rebase would be in order. |
…update/latest-posts-author-filter
Thanks. I have fixed this and rebased. |
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.
I have tested this and works pretty well. Since we're only adding new data to the block we shouldn't need a deprecation function, testing a previously created block with this PR updated with no issues.
Great job @pstonier !
Thank you for all the help! |
Description
Added dropdown to select author to filter the latest posts in the Latest Posts block.
How has this been tested?
Locally.
Screenshots
Types of changes
users
attribute to LatestPostsChecklist: