-
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
DataViews: limit users to those who have published pages #55455
Conversation
@@ -79,7 +79,7 @@ export default function PagePages() { | |||
} = useEntityRecords( 'postType', 'page', queryArgs ); | |||
|
|||
const { records: authors } = useEntityRecords( 'root', 'user', { | |||
who: 'authors', | |||
has_published_posts: true, |
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 substituted who
by has_published_posts
because I'm no longer sure what who
is about, see code.
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.
That's interesting indeed. I'm wondering if @TimothyBJacobs can shed some light about the nuances with who
.
has_published_posts: true, | |
has_published_posts: [ 'page' ], |
We need to limit to pages though.
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.
Oh, interesting. So it admits both a boolean and an array.
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.
Yeah who
is weird and not really recommended AFAIK.
Looking at the UI now, it seems like has_published_posts
makes the most sense. But it does seem like this UI might want to display draft
pages at some point? In which case, restricting to published posts would be incorrect.
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 the feedback, Timothy. I'm addressing it at #55723
Size Change: +69 B (0%) Total Size: 1.66 MB
ℹ️ View Unchanged
|
Co-authored-by: Nik Tsekouras <ntsekouras@outlook.com>
Part of #55083
What?
This changes how we query the users endpoint.
Why?
We want to list users that actually have some post published. For the purposes of the pages page, there's no point in listing the ones that don't.
How?
Use the
has_published_posts
param instead of thewho: authors
.Testing Instructions