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. Built from https://develop.svn.wordpress.org/trunk@56609 git-svn-id: http://core.svn.wordpress.org/trunk@56121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
16 KiB
16 KiB