Skip to content

Fetch all categories to display in Latest Posts dropdown - #11654

Merged
danielbachhuber merged 1 commit into
masterfrom
10873-fetch-all-categories
Nov 12, 2018
Merged

danielbachhuber merged 1 commit into
masterfrom
10873-fetch-all-categories

Conversation

@danielbachhuber

@danielbachhuber danielbachhuber commented Nov 9, 2018 •

Copy link
Copy Markdown
Member

Description

Uses per_page=-1 to trigger the apiFetch() middleware and resolve
all categories that can be displayed in the dropdown.

How has this been tested?

Generate 200 categories using WP-CLI:

$ wp term generate category --count=200

See that all categories are present in the Latest Posts category
selection:

image

See #10873

Using `per_page=-1` triggers the `apiFetch()` middleware to resolve all
items.
@danielbachhuber danielbachhuber added [Type] Bug An existing feature does not function as intended [Feature] Blocks Overall functionality of blocks REST API Interaction Related to REST API labels Nov 9, 2018
@danielbachhuber danielbachhuber added this to the 4.4 milestone Nov 9, 2018
@adamsilverstein

Copy link
Copy Markdown
Member

This PR Makes me nervous about breaking media for sites with large media libraries. Why are we using unbounded queues vs paginated loading?

@danielbachhuber

Copy link
Copy Markdown
Member Author

Why are we using unbounded queues vs paginated loading?

We're not using an unbounded queue in this case. apiFetch() resolves per_page=-1 through paginated per_page=100.

@danielbachhuber

Copy link
Copy Markdown
Member Author

apiFetch() resolves per_page=-1 through paginated per_page=100.

See #10762

@youknowriad youknowriad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Blocks Overall functionality of blocks REST API Interaction Related to REST API [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants