Jonny Harris 66b98b92c3 Users: Add caching to count_user_posts function
Introduced caching for the `count_user_posts` function to reduce redundant database queries. This ensures better performance by storing and reusing query results when possible. Additionally, sanitized and sorted the `$post_type` array to avoid invalid queries.

Props spacedmonkey, peterwilsoncc, mamaduka, flixos90, johnjamesjacoby, swissspidy, dilip2615, johnregan3, wpgurudev, desrosj, milindmore22, Krstarica, dilipom13.
Fixes #39242.

git-svn-id: https://develop.svn.wordpress.org/trunk@59817 602fd350-edb4-49c9-b593-d223f7449a82
2025-02-12 21:48:04 +00:00
..