Skip to content

Fix: Query Loop: Authors filter generates posts of only first selected author.#4521

Closed
adi3890 wants to merge 2 commits intoWordPress:trunkfrom
adi3890:fix-include-author
Closed

Fix: Query Loop: Authors filter generates posts of only first selected author.#4521
adi3890 wants to merge 2 commits intoWordPress:trunkfrom
adi3890:fix-include-author

Conversation

@adi3890
Copy link
Copy Markdown

@adi3890 adi3890 commented May 29, 2023

Currently since query author was type casted to integer and data sent was string
Reference code : $query['author'] = (int) $block->context['query']['author'];
it only worked for first author id available in context data.

As in rest api author parameter accepts values in all data type mentioned below. I have added fix for any type of acceptable data type.

  • array - array of author ids
  • string - comma separated author ids
  • integer - single author id.

Trac ticket: https://core.trac.wordpress.org/ticket/58426#ticket


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@adi3890 adi3890 changed the title Bug Fix: Authors Fix: Query Loop: Authors filter generates posts of only first selected author. May 29, 2023
@audrasjb
Copy link
Copy Markdown
Contributor

@audrasjb audrasjb closed this Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants