Latest Posts block: Check priority of excerpt_length filter #33027
Description
Hi - the excerpt length setting in the latest posts block does not get used in all themes. This seems to be a common problem in themes that change the default excerpt length.
This appears to be a because of the excerpt_length filter in the render method.
In the method the filter has a priority of 20, however the official WordPress docs suggest a priority of 999 which I have found referenced on a number of sites and used in many themes.
https://developer.wordpress.org/reference/hooks/excerpt_length/#more-information
I started updating my 20+ themes to use a lower priority but then realised that it's used in so many other themes that it should probably be changed in core.
You can see how many public themes use it here:
https://wpdirectory.net/search/01F9927FX53NQ7AA33DS32YK38
If you expand the top 20 results on this page you will see that about 50% use the 999 priority.
My suggestion would be to use 9999
since some people (including myself) may go even higher in child themes.