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

Override tag cloud block to display more than 100 tags for the Supplied By taxonomy #42

Open
bobbingwide opened this issue Jul 14, 2024 · 3 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Jul 14, 2024

In https://seriouslybonkers.com/bigram/supplied-by/ I noticed that Alex Horne didn't appear in the tag cloud
even though there is an entry for him.

It turns out that the core/tag-cloud block has a maximum limit of 100 for the numberOfTags attribute.
I hope this isn't a restriction of the underlying implementation!

Requirement

  • Cater for more than 100 tags.
  • Current maximum not yet known

Proposed solution

  • Override the core/tag-cloud block.
@bobbingwide bobbingwide added bug Something isn't working enhancement New feature or request labels Jul 14, 2024
@bobbingwide bobbingwide self-assigned this Jul 14, 2024
@bobbingwide
Copy link
Owner Author

Here's a screenshot of the Tag Cloud for the Supplied By taxonomy.
https://seriouslybonkers.com/wp-admin/post.php?post=3297&action=edit

The tag for Alex Horne ( ID 2813 ) is missing but not Bill Jinks ( ID 2905 )
Also missing: Corporal Jones, Tony Cullen, Mark Fitzgerald, etc

There are 55 tags in the taxonomy but only 45 appear in the block.
The selected number of tags in this screenshot was 99.

image

@bobbingwide
Copy link
Owner Author

bobbingwide commented Jul 15, 2024

Note: 45 is the number of tags displayed by the page-footer.html template part for both the s-word and b-word taxonomies.
I've tried adjusting the numberOfTags attribute but it doesn't seem to make a blind bit of difference.

@bobbingwide
Copy link
Owner Author

bobbingwide commented Jul 15, 2024

I've already got an override function called sb_render_block_core_tag_cloud().
This calls wp_tag_cloud() with hardcoded $args that doesn't include the numberOfTags attribute.
The code needs to be updated to more closely match the logic in WordPress's wp-includes\blocks\tag-cloud.php.

There is still the limit of 100, but I haven't reached that yet for the "Supplied-by" taxonomy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant