bobbingwide / sb

SB: Second Byte - Seriously Bonkers' experimental Full Site Editing theme
GNU General Public License v3.0
0 stars 0 forks source link

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

Open bobbingwide opened 1 month ago

bobbingwide commented 1 month ago

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

Proposed solution

bobbingwide commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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.