Gets element columns for the export.
Description
See also
Parameters
- $elements
-
(awsmug\Torro_Forms\Components\Element_Collection) (Required) Elements for which to get columns.
Return
(array) Associative array of <code>$element_id => $element_data</code> pairs where each <code>$element_data</code> must be an array with 'columns' and 'callback' keys. The callback must accept a $values array of <code>$field => $value</code> pairs.
Source
File: src/components/submission-export.php
protected function get_element_columns( $elements ) { $element_columns = array(); foreach ( $elements as $element ) { $element_type = $element->get_element_type(); if ( ! $element_type ) { continue; } $element_columns[ $element->id ] = array( 'columns' => $element_type->get_export_columns( $element ), 'callback' => function( $values ) use ( $element, $element_type ) { return $element_type->format_values_for_export( $values, $element, $this->export_format ); }, ); } return $element_columns; }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |