Parsed: 129724

  protected static function flatten_tree( $tree, $prefix = '', $token = '--' ) {
    $result = array();
    foreach ( $tree as $property => $value ) {
      $new_key = $prefix . str_replace(
        '/',
        '-',
        strtolower( _wp_to_kebab_case( $property ) )
      );

      if ( is_array( $value ) ) {
        $new_prefix        = $new_key . $token;
        $flattened_subtree = static::flatten_tree( $value, $new_prefix, $token );
        foreach ( $flattened_subtree as $subtree_key => $subtree_value ) {
          $result[ $subtree_key ] = $subtree_value;
        }
      } else {
        $result[ $new_key ] = $value;
      }
    }
    return $result;
  }