Aggiungere il numero di post per categoria

Still looking to find out how to pass number of posts - by way of example we can see it being done in the docs view:


…it does not need to be in the custom header links. I also have a custom injected section on the start page that might be easier to pass it to.

Just wondering which code was used to catch them in the above screenshot or if there is (hope against hope) a shorthand?