src/properties/class-papi-property-flexible.php
protected function prepare_properties( $layouts ) {
		$layouts = array_map( function ( $layout ) {
			return (array) $layout;
		}, $layouts );

		foreach ( $layouts as $index => $layout ) {
			if ( ! $this->valid_layout( $layout ) ) {
				if ( is_array( $layout ) ) {
					unset( $layout[$index] );
				} else {
					unset( $layouts[$index] );
				}

				continue;
			}

			if ( ! isset( $layout['slug'] ) ) {
				$layout['slug'] = $layout['title'];
			}

			if ( ! isset( $layout['row_label'] ) ) {
				$layout['row_label'] = $layout['title'];
			}

			if ( ! isset( $layout['show_label'] ) ) {
				$layout['show_label'] = true;
			}

			$layouts[$index] = array_merge( $layouts[$index], $layout );

			$layouts[$index]['slug']  = papi_slugify( $layout['slug'] );
			$layouts[$index]['slug']  = $this->get_layout_value( $layouts[$index]['slug'] );
			$layouts[$index]['items'] = parent::prepare_properties( $layout['items'] );
		}

		return array_filter( $layouts );
	}
protected function prepare_properties( $layouts ) {
		$layouts = array_map( function ( $layout ) {
			return (array) $layout;
		}, $layouts );

		foreach ( $layouts as $index => $layout ) {
			if ( ! $this->valid_layout( $layout ) ) {
				if ( is_array( $layout ) ) {
					unset( $layout[$index] );
				} else {
					unset( $layouts[$index] );
				}

				continue;
			}

			if ( ! isset( $layout['slug'] ) ) {
				$layout['slug'] = $layout['title'];
			}

			if ( ! isset( $layout['row_label'] ) ) {
				$layout['row_label'] = $layout['title'];
			}

			if ( ! isset( $layout['show_label'] ) ) {
				$layout['show_label'] = true;
			}

			$layouts[$index] = array_merge( $layouts[$index], $layout );

			$layouts[$index]['slug']  = papi_slugify( $layout['slug'] );
			$layouts[$index]['slug']  = $this->get_layout_value( $layouts[$index]['slug'] );
			$layouts[$index]['items'] = parent::prepare_properties( $layout['items'] );
		}

		return array_filter( $layouts );
	}
Prepare properties.

Not the best name for this function, but since
property repeater using this we can't rename it.

@param  array $layouts

@return array