PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.5
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | src/helpers/import-helper.php +6 -8 18.328.5 View file →
@@ -1,10 +1,8 @@
1 1 <?php
2 2
3 3 namespace Yoast\WP\SEO\Helpers;
4 4
5 -use Yoast\WP\SEO\Helpers\Options_Helper;
6 -
7 5 /**
8 6 * The Import Helper.
9 7 */
10 8 class Import_Helper {
@@ -11,18 +9,18 @@
11 9
12 10 /**
13 11 * Flattens a multidimensional array of settings. Recursive.
14 12 *
15 - * @param array $array The array to be flattened.
16 - * @param string $key_prefix The key to be used as a prefix.
13 + * @param array $array_to_flatten The array to be flattened.
14 + * @param string $key_prefix The key to be used as a prefix.
17 15 *
18 16 * @return array The flattened array.
19 17 */
20 - public function flatten_settings( $array, $key_prefix = '' ) {
18 + public function flatten_settings( $array_to_flatten, $key_prefix = '' ) {
21 19 $result = [];
22 - foreach ( $array as $key => $value ) {
23 - if ( is_array( $value ) ) {
24 - $result = array_merge( $result, $this->flatten_settings( $value, $key_prefix . '/' . $key ) );
20 + foreach ( $array_to_flatten as $key => $value ) {
21 + if ( \is_array( $value ) ) {
22 + $result = \array_merge( $result, $this->flatten_settings( $value, $key_prefix . '/' . $key ) );
25 23 }
26 24 else {
27 25 $result[ $key_prefix . '/' . $key ] = $value;
28 26 }