PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.3
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.3
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
wordpress-seo / src / helpers / import-helper.php

import-helper.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.3, at src/helpers/import-helper.php

34 lines 722 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Helpers;
4
5 use Yoast\WP\SEO\Helpers\Options_Helper;
6
7 /**
8 * The Import Helper.
9 */
10 class Import_Helper {
11
12 /**
13 * Flattens a multidimensional array of settings. Recursive.
14 *
15 * @param array $array The array to be flattened.
16 * @param string $key_prefix The key to be used as a prefix.
17 *
18 * @return array The flattened array.
19 */
20 public function flatten_settings( $array, $key_prefix = '' ) {
21 $result = [];
22 foreach ( $array as $key => $value ) {
23 if ( is_array( $value ) ) {
24 $result = array_merge( $result, $this->flatten_settings( $value, $key_prefix . '/' . $key ) );
25 }
26 else {
27 $result[ $key_prefix . '/' . $key ] = $value;
28 }
29 }
30
31 return $result;
32 }
33 }
34