0

As per doumentation

Author Parameters #Author Parameters

  1. author (int) – use author id.
  2. author_name (string) – use ‘user_nicename‘ – NOT name.
  3. author__in (array) – use author id (available since version 3.7).
  4. 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

  • 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? – leymannx Apr 27 '19 at 22:04
2

First, 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.