Skip to content
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

Fix categories block per_page limit #4045

Conversation

vladanost
Copy link
Contributor

Description

Fixes #4022

As per api documentation I'm setting the per_page arg to max 100

https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/

How Has This Been Tested?

Tested in the browser.

Types of changes

Bug fix (non-breaking change which fixes an issue)

@aduth
Copy link
Member

aduth commented Dec 18, 2017

Alternatively, should it be the case that the front-end view renders the complete list of categories, or should that be limited? Could even imagine a slider to select how many categories to show in block inspector options.

As-is, would this truly fix #4022 for a site which has, for example, 110 categories?

@vladanost
Copy link
Contributor Author

My intention was to first address the issue of default per_page setting of 10, which is too low. Setting it to 100 will obviously not show all categories in the backend when there are 100+ categories but will catch majority of cases.
Similarly, even with having a slider, there is a possibility that a site can have more categories than the slider max value.
As for the question of limiting the output on the front-end, it seems that this block is following the same logic as default WP Categories widget which shows all categories.

Due to the recent changes in c1f7b19 this PR is no longer relevant.

@vladanost vladanost closed this Dec 20, 2017
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.

Categories block limits preview to 10 categories
2 participants