mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-12 08:34:35 +00:00
In the `WP_Hook` class the function `array_keys` was called every time an array of hook priorities was needed. For sites with lots of filters or actions, this would result in thousands of calls to the `array_keys` function, which uses server resources. Instead of recomputing this array every time it is needed, only compute it when filters are added and removed, then store the result as a class property. Improve unit tests to ensure this behaviour is tested. Props spacedmonkey, bor0, flixos90, hellofromTonya, mukesh27. Fixes #58458. git-svn-id: https://develop.svn.wordpress.org/trunk@56609 602fd350-edb4-49c9-b593-d223f7449a82