As per doumentation
Author Parameters #Author Parameters
- author (int) – use author id.
- author_name (string) – use ‘user_nicename‘ – NOT name.
- author__in (array) – use author id (available since version 3.7).
- author__not_in (array) – use author id (available since version 3.7).
Can they all work together?
If I keep author__not_in, first 3 does not work? author__not_in is an empty array
As per doumentation
Author Parameters #Author Parameters
- author (int) – use author id.
- author_name (string) – use ‘user_nicename‘ – NOT name.
- author__in (array) – use author id (available since version 3.7).
- author__not_in (array) – use author id (available since version 3.7).
Can they all work together?
If I keep author__not_in, first 3 does not work? author__not_in is an empty array
Share Improve this question asked Apr 27, 2019 at 20:37 user145078user145078 1- Can you give a realistic sample of what posts you would be looking for then, exactly? Having author__not_in set for what would you need to use the 3 others then? – norman.lol Commented Apr 27, 2019 at 22:04
1 Answer
Reset to default 1First, the author
parameter is parsed and appended to the author__in
and author__not_in
query parameters.
Then author__in
or author__not_in
array is processed. These can be arrays created from author
parameter or arrays passed as query parameteres author__in
/ author__not_in
or created from a mergion author
parameter with author__in
/ author__not_in
parameters.
Parameters author__in
and author__not_in
are mutually exclusive, so you can use only one of them. If both are given, then author__not_in
will be used.
Finally, the author_name
parameter is processed and added to thewhere
clause. Although theoretically it can be used with any of the other parameters, the effect will be the same as if only author_name
was used.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745545403a4632314.html
评论列表(0条)