WordPress/wp-includes/block-supports
Sergey Biryukov 9bf6faff7c Editor: Reduce the use of the _wp_array_get() function to improve performance.
`_wp_array_get()` is an expensive function, and it's called thousands of times on each page view on the front end. While the function performance was slightly improved in #58376, it is still called more times than it should be.

This commit aims to further optimize its usage:
* In many cases, `_wp_array_get()` can be replaced with a much simpler and faster `isset()` check.
* The `isset()` function is capable of checking nested arrays, so `isset( $foo['a']['b']['c'] )` will return false even if `$foo['a']` is unset, without throwing any errors or warnings.
* When `_wp_array_get()` cannot be directly replaced with `isset()`, it would be good practice to wrap it in an `isset()` function so that `_wp_array_get()` only runs when it needs to.

Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/51116 #51116 Performance improvement: Reduce the use of the _wp_array_get() function]

Follow-up to [55851], [56382].

Props aristath, jrf, spacedmonkey, mukesh27, swissspidy, hellofromTonya.
Fixes #59405.
Built from https://develop.svn.wordpress.org/trunk@56709


git-svn-id: http://core.svn.wordpress.org/trunk@56221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-26 13:47:20 +00:00
..
align.php Editor: Simplify usage of block_has_support() function by supporting a string. 2023-08-10 16:48:19 +00:00
background.php Editor: Reduce the use of the _wp_array_get() function to improve performance. 2023-09-26 13:47:20 +00:00
border.php Editor: Reduce the use of the _wp_array_get() function to improve performance. 2023-09-26 13:47:20 +00:00
colors.php Editor: Reduce the use of the _wp_array_get() function to improve performance. 2023-09-26 13:47:20 +00:00
custom-classname.php Editor: Simplify usage of block_has_support() function by supporting a string. 2023-08-10 16:48:19 +00:00
dimensions.php Editor: Reduce the use of the _wp_array_get() function to improve performance. 2023-09-26 13:47:20 +00:00
duotone.php Editor: Lazily load Duotone settings only when needed. 2023-07-13 11:34:28 +00:00
elements.php Editor: Reduce the use of the _wp_array_get() function to improve performance. 2023-09-26 13:47:20 +00:00
generated-classname.php Editor: Simplify usage of block_has_support() function by supporting a string. 2023-08-10 16:48:19 +00:00
layout.php Editor: Reduce the use of the _wp_array_get() function to improve performance. 2023-09-26 13:47:20 +00:00
position.php Editor: Reduce the use of the _wp_array_get() function to improve performance. 2023-09-26 13:47:20 +00:00
settings.php Editor: Reduce the use of the _wp_array_get() function to improve performance. 2023-09-26 13:47:20 +00:00
shadow.php Editor: Simplify usage of block_has_support() function by supporting a string. 2023-08-10 16:48:19 +00:00
spacing.php Editor: Reduce the use of the _wp_array_get() function to improve performance. 2023-09-26 13:47:20 +00:00
typography.php Editor: Reduce the use of the _wp_array_get() function to improve performance. 2023-09-26 13:47:20 +00:00
utils.php Docs: Miscellaneous docblock corrections and improvements. 2023-08-18 17:29:20 +00:00