The `get_default_block_editor_settings()` function used to repeatedly get the `default-editor-styles.css` file contents without any implementation to avoid this. This commit utilizes a static variable to remove repetitive calls made during the same request. In tests ran on the front page of a site using Xdebug & Webgrind, the total `file_get_contents()` invocation count goes down from 181 to 93, and total self cost (the time that the function is responsible for) goes down from 160 ms to 93 ms. Follow-up to [52042]. Props aristath, mukesh27. Fixes #56637. Built from https://develop.svn.wordpress.org/trunk@54291 git-svn-id: http://core.svn.wordpress.org/trunk@53850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
23 KiB
23 KiB