|
@@ -125,7 +125,7 @@ discard block |
|
|
block discarded – undo |
|
125
|
125
|
$supports = array( 'title', 'revisions' ); |
|
126
|
126
|
|
|
127
|
127
|
if ( $is_hierarchical ) { |
|
128
|
|
- $supports[] = 'page-attributes'; |
|
|
128
|
+ $supports[ ] = 'page-attributes'; |
|
129
|
129
|
} |
|
130
|
130
|
|
|
131
|
131
|
/** |
|
@@ -227,11 +227,11 @@ discard block |
|
|
block discarded – undo |
|
227
|
227
|
$rule = array( sprintf( '%s/([^/]+)/csv/?', $slug ), 'index.php?gravityview=$matches[1]&csv=1', 'top' ); |
|
228
|
228
|
|
|
229
|
229
|
add_filter( 'query_vars', function( $query_vars ) { |
|
230
|
|
- $query_vars[] = 'csv'; |
|
|
230
|
+ $query_vars[ ] = 'csv'; |
|
231
|
231
|
return $query_vars; |
|
232
|
232
|
} ); |
|
233
|
233
|
|
|
234
|
|
- if ( ! isset( $wp_rewrite->extra_rules_top[ $rule[0] ] ) ) { |
|
|
234
|
+ if ( ! isset( $wp_rewrite->extra_rules_top[ $rule[ 0 ] ] ) ) { |
|
235
|
235
|
call_user_func_array( 'add_rewrite_rule', $rule ); |
|
236
|
236
|
} |
|
237
|
237
|
} |
|
@@ -300,13 +300,13 @@ discard block |
|
|
block discarded – undo |
|
300
|
300
|
return $content; |
|
301
|
301
|
} |
|
302
|
302
|
|
|
303
|
|
- $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID ); |
|
|
303
|
+ $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID ); |
|
304
|
304
|
|
|
305
|
305
|
/** |
|
306
|
306
|
* Editing a single entry. |
|
307
|
307
|
*/ |
|
308
|
308
|
if ( $entry = $request->is_edit_entry( $view->form ? $view->form->ID : 0 ) ) { |
|
309
|
|
- if ( $entry['status'] != 'active' ) { |
|
|
309
|
+ if ( $entry[ 'status' ] != 'active' ) { |
|
310
|
310
|
gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) ); |
|
311
|
311
|
return __( 'You are not allowed to view this content.', 'gravityview' ); |
|
312
|
312
|
} |
|
@@ -317,7 +317,7 @@ discard block |
|
|
block discarded – undo |
|
317
|
317
|
} |
|
318
|
318
|
|
|
319
|
319
|
if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) { |
|
320
|
|
- if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
|
320
|
+ if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
321
|
321
|
gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) ); |
|
322
|
322
|
return __( 'You are not allowed to view this content.', 'gravityview' ); |
|
323
|
323
|
} |
|
@@ -340,7 +340,7 @@ discard block |
|
|
block discarded – undo |
|
340
|
340
|
|
|
341
|
341
|
foreach ( $entryset as $e ) { |
|
342
|
342
|
|
|
343
|
|
- if ( 'active' !== $e['status'] ) { |
|
|
343
|
+ if ( 'active' !== $e[ 'status' ] ) { |
|
344
|
344
|
gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $e->ID ) ); |
|
345
|
345
|
return __( 'You are not allowed to view this content.', 'gravityview' ); |
|
346
|
346
|
} |
|
@@ -351,7 +351,7 @@ discard block |
|
|
block discarded – undo |
|
351
|
351
|
} |
|
352
|
352
|
|
|
353
|
353
|
if ( $show_only_approved && ! $is_admin_and_can_view ) { |
|
354
|
|
- if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $e->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
|
354
|
+ if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $e->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
355
|
355
|
gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $e->ID ) ); |
|
356
|
356
|
return __( 'You are not allowed to view this content.', 'gravityview' ); |
|
357
|
357
|
} |
|
@@ -526,7 +526,7 @@ discard block |
|
|
block discarded – undo |
|
526
|
526
|
$join_column = is_numeric( $join_column ) ? GF_Field::by_id( $join, $join_column ) : Internal_Field::by_id( $join_column ); |
|
527
|
527
|
$join_on_column = is_numeric( $join_on_column ) ? GF_Field::by_id( $join_on, $join_on_column ) : Internal_Field::by_id( $join_on_column ); |
|
528
|
528
|
|
|
529
|
|
- $joins [] = new Join( $join, $join_column, $join_on, $join_on_column ); |
|
|
529
|
+ $joins [ ] = new Join( $join, $join_column, $join_on, $join_on_column ); |
|
530
|
530
|
} |
|
531
|
531
|
|
|
532
|
532
|
return $joins; |
|
@@ -621,13 +621,13 @@ discard block |
|
|
block discarded – undo |
|
621
|
621
|
} |
|
622
|
622
|
|
|
623
|
623
|
foreach ( $_fields as $field ) { |
|
624
|
|
- if ( ! empty( $field['unions'] ) ) { |
|
625
|
|
- foreach ( $field['unions'] as $form_id => $field_id ) { |
|
|
624
|
+ if ( ! empty( $field[ 'unions' ] ) ) { |
|
|
625
|
+ foreach ( $field[ 'unions' ] as $form_id => $field_id ) { |
|
626
|
626
|
if ( ! isset( $unions[ $form_id ] ) ) { |
|
627
|
627
|
$unions[ $form_id ] = array(); |
|
628
|
628
|
} |
|
629
|
629
|
|
|
630
|
|
- $unions[ $form_id ][ $field['id'] ] = |
|
|
630
|
+ $unions[ $form_id ][ $field[ 'id' ] ] = |
|
631
|
631
|
is_numeric( $field_id ) ? \GV\GF_Field::by_id( \GV\GF_Form::by_id( $form_id ), $field_id ) : \GV\Internal_Field::by_id( $field_id ); |
|
632
|
632
|
} |
|
633
|
633
|
} |
|
@@ -676,7 +676,7 @@ discard block |
|
|
block discarded – undo |
|
676
|
676
|
if ( ! $view->form ) { |
|
677
|
677
|
gravityview()->log->error( 'View #{view_id} tried attaching non-existent Form #{form_id} to it.', array( |
|
678
|
678
|
'view_id' => $view->ID, |
|
679
|
|
- 'form_id' => $view->_gravityview_form_id ? : 0, |
|
|
679
|
+ 'form_id' => $view->_gravityview_form_id ?: 0, |
|
680
|
680
|
) ); |
|
681
|
681
|
} |
|
682
|
682
|
|
|
@@ -911,43 +911,42 @@ discard block |
|
|
block discarded – undo |
|
911
|
911
|
* @todo: Stop using _frontend and use something like $request->get_search_criteria() instead |
|
912
|
912
|
*/ |
|
913
|
913
|
$parameters = \GravityView_frontend::get_view_entries_parameters( $this->settings->as_atts(), $this->form->ID ); |
|
914
|
|
- $parameters['context_view_id'] = $this->ID; |
|
|
914
|
+ $parameters[ 'context_view_id' ] = $this->ID; |
|
915
|
915
|
$parameters = \GVCommon::calculate_get_entries_criteria( $parameters, $this->form->ID ); |
|
916
|
916
|
|
|
917
|
917
|
if ( $request instanceof REST\Request ) { |
|
918
|
918
|
$atts = $this->settings->as_atts(); |
|
919
|
919
|
$paging_parameters = wp_parse_args( $request->get_paging(), array( |
|
920
|
|
- 'paging' => array( 'page_size' => $atts['page_size'] ), |
|
|
920
|
+ 'paging' => array( 'page_size' => $atts[ 'page_size' ] ), |
|
921
|
921
|
) ); |
|
922
|
|
- $parameters['paging'] = $paging_parameters['paging']; |
|
|
922
|
+ $parameters[ 'paging' ] = $paging_parameters[ 'paging' ]; |
|
923
|
923
|
} |
|
924
|
924
|
|
|
925
|
|
- $page = Utils::get( $parameters['paging'], 'current_page' ) ? |
|
926
|
|
- : ( ( ( $parameters['paging']['offset'] - $this->settings->get( 'offset' ) ) / $parameters['paging']['page_size'] ) + 1 ); |
|
|
925
|
+ $page = Utils::get( $parameters[ 'paging' ], 'current_page' ) ?: ( ( ( $parameters[ 'paging' ][ 'offset' ] - $this->settings->get( 'offset' ) ) / $parameters[ 'paging' ][ 'page_size' ] ) + 1 ); |
|
927
|
926
|
|
|
928
|
927
|
/** |
|
929
|
928
|
* Cleanup duplicate field_filter parameters to simplify the query. |
|
930
|
929
|
*/ |
|
931
|
930
|
$unique_field_filters = array(); |
|
932
|
|
- foreach ( $parameters['search_criteria']['field_filters'] as $key => $filter ) { |
|
|
931
|
+ foreach ( $parameters[ 'search_criteria' ][ 'field_filters' ] as $key => $filter ) { |
|
933
|
932
|
if ( 'mode' === $key ) { |
|
934
|
|
- $unique_field_filters['mode'] = $filter; |
|
|
933
|
+ $unique_field_filters[ 'mode' ] = $filter; |
|
935
|
934
|
} else if ( ! in_array( $filter, $unique_field_filters ) ) { |
|
936
|
|
- $unique_field_filters[] = $filter; |
|
|
935
|
+ $unique_field_filters[ ] = $filter; |
|
937
|
936
|
} |
|
938
|
937
|
} |
|
939
|
|
- $parameters['search_criteria']['field_filters'] = $unique_field_filters; |
|
|
938
|
+ $parameters[ 'search_criteria' ][ 'field_filters' ] = $unique_field_filters; |
|
940
|
939
|
|
|
941
|
|
- if ( ! empty( $parameters['search_criteria']['field_filters'] ) ) { |
|
|
940
|
+ if ( ! empty( $parameters[ 'search_criteria' ][ 'field_filters' ] ) ) { |
|
942
|
941
|
gravityview()->log->notice( 'search_criteria/field_filters is not empty, third-party code may be using legacy search_criteria filters.' ); |
|
943
|
942
|
} |
|
944
|
943
|
|
|
945
|
944
|
if ( gravityview()->plugin->supports( Plugin::FEATURE_GFQUERY ) ) { |
|
946
|
945
|
$query_class = $this->get_query_class(); |
|
947
|
|
- $query = new $query_class( $this->form->ID, $parameters['search_criteria'], $parameters['sorting'] ); |
|
|
946
|
+ $query = new $query_class( $this->form->ID, $parameters[ 'search_criteria' ], $parameters[ 'sorting' ] ); |
|
948
|
947
|
|
|
949
|
|
- $query->limit( $parameters['paging']['page_size'] ) |
|
950
|
|
- ->offset( ( ( $page - 1 ) * $parameters['paging']['page_size'] ) + $this->settings->get( 'offset' ) ); |
|
|
948
|
+ $query->limit( $parameters[ 'paging' ][ 'page_size' ] ) |
|
|
949
|
+ ->offset( ( ( $page - 1 ) * $parameters[ 'paging' ][ 'page_size' ] ) + $this->settings->get( 'offset' ) ); |
|
951
|
950
|
|
|
952
|
951
|
/** |
|
953
|
952
|
* Any joins? |
|
@@ -970,7 +969,7 @@ discard block |
|
|
block discarded – undo |
|
970
|
969
|
|
|
971
|
970
|
$query_parameters = $query->_introspect(); |
|
972
|
971
|
|
|
973
|
|
- $query->where( \GF_Query_Condition::_and( $query_parameters['where'], $condition ) ); |
|
|
972
|
+ $query->where( \GF_Query_Condition::_and( $query_parameters[ 'where' ], $condition ) ); |
|
974
|
973
|
} |
|
975
|
974
|
|
|
976
|
975
|
/** |
|
@@ -993,7 +992,7 @@ discard block |
|
|
block discarded – undo |
|
993
|
992
|
} |
|
994
|
993
|
|
|
995
|
994
|
$q = $query->_introspect(); |
|
996
|
|
- $query->where( \GF_Query_Condition::_and( $q['where'], $condition ) ); |
|
|
995
|
+ $query->where( \GF_Query_Condition::_and( $q[ 'where' ], $condition ) ); |
|
997
|
996
|
|
|
998
|
997
|
if ( $this->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) { |
|
999
|
998
|
|
|
@@ -1012,7 +1011,7 @@ discard block |
|
|
block discarded – undo |
|
1012
|
1011
|
|
|
1013
|
1012
|
$query_parameters = $query->_introspect(); |
|
1014
|
1013
|
|
|
1015
|
|
- $query->where( \GF_Query_Condition::_and( $query_parameters['where'], $condition ) ); |
|
|
1014
|
+ $query->where( \GF_Query_Condition::_and( $query_parameters[ 'where' ], $condition ) ); |
|
1016
|
1015
|
} |
|
1017
|
1016
|
} |
|
1018
|
1017
|
|
|
@@ -1036,7 +1035,7 @@ discard block |
|
|
block discarded – undo |
|
1036
|
1035
|
$conditions = array(); |
|
1037
|
1036
|
|
|
1038
|
1037
|
foreach ( $condition->expressions as $_condition ) { |
|
1039
|
|
- $conditions[] = $recurse( $_condition, $fields, $recurse ); |
|
|
1038
|
+ $conditions[ ] = $recurse( $_condition, $fields, $recurse ); |
|
1040
|
1039
|
} |
|
1041
|
1040
|
|
|
1042
|
1041
|
return call_user_func_array( |
|
@@ -1065,10 +1064,10 @@ discard block |
|
|
block discarded – undo |
|
1065
|
1064
|
$q = new $query_class( $form_id ); |
|
1066
|
1065
|
|
|
1067
|
1066
|
// Copy the WHERE clauses but substitute the field_ids to the respective ones |
|
1068
|
|
- $q->where( $where_union_substitute( $query_parameters['where'], $fields, $where_union_substitute ) ); |
|
|
1067
|
+ $q->where( $where_union_substitute( $query_parameters[ 'where' ], $fields, $where_union_substitute ) ); |
|
1069
|
1068
|
|
|
1070
|
1069
|
// Copy the ORDER clause and substitute the field_ids to the respective ones |
|
1071
|
|
- foreach ( $query_parameters['order'] as $order ) { |
|
|
1070
|
+ foreach ( $query_parameters[ 'order' ] as $order ) { |
|
1072
|
1071
|
list( $column, $_order ) = $order; |
|
1073
|
1072
|
|
|
1074
|
1073
|
if ( $column && $column instanceof \GF_Query_Column ) { |
|
@@ -1082,15 +1081,15 @@ discard block |
|
|
block discarded – undo |
|
1082
|
1081
|
|
|
1083
|
1082
|
add_filter( 'gform_gf_query_sql', $gf_query_sql_callback = function( $sql ) use ( &$unions_sql ) { |
|
1084
|
1083
|
// Remove SQL_CALC_FOUND_ROWS as it's not needed in UNION clauses |
|
1085
|
|
- $select = 'UNION ALL ' . str_replace( 'SQL_CALC_FOUND_ROWS ', '', $sql['select'] ); |
|
|
1084
|
+ $select = 'UNION ALL ' . str_replace( 'SQL_CALC_FOUND_ROWS ', '', $sql[ 'select' ] ); |
|
1086
|
1085
|
|
|
1087
|
1086
|
// Record the SQL |
|
1088
|
|
- $unions_sql[] = array( |
|
|
1087
|
+ $unions_sql[ ] = array( |
|
1089
|
1088
|
// Remove columns, we'll rebuild them |
|
1090
|
1089
|
'select' => preg_replace( '#DISTINCT (.*)#', 'DISTINCT ', $select ), |
|
1091
|
|
- 'from' => $sql['from'], |
|
1092
|
|
- 'join' => $sql['join'], |
|
1093
|
|
- 'where' => $sql['where'], |
|
|
1090
|
+ 'from' => $sql[ 'from' ], |
|
|
1091
|
+ 'join' => $sql[ 'join' ], |
|
|
1092
|
+ 'where' => $sql[ 'where' ], |
|
1094
|
1093
|
// Remove order and limit |
|
1095
|
1094
|
); |
|
1096
|
1095
|
|
|
@@ -1107,11 +1106,11 @@ discard block |
|
|
block discarded – undo |
|
1107
|
1106
|
|
|
1108
|
1107
|
add_filter( 'gform_gf_query_sql', $gf_query_sql_callback = function( $sql ) use ( $unions_sql ) { |
|
1109
|
1108
|
// Remove SQL_CALC_FOUND_ROWS as it's not needed in UNION clauses |
|
1110
|
|
- $sql['select'] = str_replace( 'SQL_CALC_FOUND_ROWS ', '', $sql['select'] ); |
|
|
1109
|
+ $sql[ 'select' ] = str_replace( 'SQL_CALC_FOUND_ROWS ', '', $sql[ 'select' ] ); |
|
1111
|
1110
|
|
|
1112
|
1111
|
// Remove columns, we'll rebuild them |
|
1113
|
|
- preg_match( '#DISTINCT (`[motc]\d+`.`.*?`)#', $sql['select'], $select_match ); |
|
1114
|
|
- $sql['select'] = preg_replace( '#DISTINCT (.*)#', 'DISTINCT ', $sql['select'] ); |
|
|
1112
|
+ preg_match( '#DISTINCT (`[motc]\d+`.`.*?`)#', $sql[ 'select' ], $select_match ); |
|
|
1113
|
+ $sql[ 'select' ] = preg_replace( '#DISTINCT (.*)#', 'DISTINCT ', $sql[ 'select' ] ); |
|
1115
|
1114
|
|
|
1116
|
1115
|
$unions = array(); |
|
1117
|
1116
|
|
|
@@ -1122,30 +1121,30 @@ discard block |
|
|
block discarded – undo |
|
1122
|
1121
|
}; |
|
1123
|
1122
|
|
|
1124
|
1123
|
// Add all the order columns into the selects, so we can order by the whole union group |
|
1125
|
|
- preg_match_all( '#(`[motc]\d+`.`.*?`)#', $sql['order'], $order_matches ); |
|
|
1124
|
+ preg_match_all( '#(`[motc]\d+`.`.*?`)#', $sql[ 'order' ], $order_matches ); |
|
1126
|
1125
|
|
|
1127
|
1126
|
$columns = array( |
|
1128
|
|
- sprintf( '%s AS %s', $select_match[1], $column_to_alias( $select_match[1] ) ) |
|
|
1127
|
+ sprintf( '%s AS %s', $select_match[ 1 ], $column_to_alias( $select_match[ 1 ] ) ) |
|
1129
|
1128
|
); |
|
1130
|
1129
|
|
|
1131
|
1130
|
foreach ( array_slice( $order_matches, 1 ) as $match ) { |
|
1132
|
|
- $columns[] = sprintf( '%s AS %s', $match[0], $column_to_alias( $match[0] ) ); |
|
|
1131
|
+ $columns[ ] = sprintf( '%s AS %s', $match[ 0 ], $column_to_alias( $match[ 0 ] ) ); |
|
1133
|
1132
|
|
|
1134
|
1133
|
// Rewrite the order columns to the shared aliases |
|
1135
|
|
- $sql['order'] = str_replace( $match[0], $column_to_alias( $match[0] ), $sql['order'] ); |
|
|
1134
|
+ $sql[ 'order' ] = str_replace( $match[ 0 ], $column_to_alias( $match[ 0 ] ), $sql[ 'order' ] ); |
|
1136
|
1135
|
} |
|
1137
|
1136
|
|
|
1138
|
1137
|
$columns = array_unique( $columns ); |
|
1139
|
1138
|
|
|
1140
|
1139
|
// Add the columns to every UNION |
|
1141
|
1140
|
foreach ( $unions_sql as $union_sql ) { |
|
1142
|
|
- $union_sql['select'] .= implode( ', ', $columns ); |
|
1143
|
|
- $unions []= implode( ' ', $union_sql ); |
|
|
1141
|
+ $union_sql[ 'select' ] .= implode( ', ', $columns ); |
|
|
1142
|
+ $unions [ ] = implode( ' ', $union_sql ); |
|
1144
|
1143
|
} |
|
1145
|
1144
|
|
|
1146
|
1145
|
// Add the columns to the main SELECT, but only grab the entry id column |
|
1147
|
|
- $sql['select'] = 'SELECT SQL_CALC_FOUND_ROWS t1_id FROM (' . $sql['select'] . implode( ', ', $columns ); |
|
1148
|
|
- $sql['order'] = implode( ' ', $unions ) . ') AS u ' . $sql['order']; |
|
|
1146
|
+ $sql[ 'select' ] = 'SELECT SQL_CALC_FOUND_ROWS t1_id FROM (' . $sql[ 'select' ] . implode( ', ', $columns ); |
|
|
1147
|
+ $sql[ 'order' ] = implode( ' ', $unions ) . ') AS u ' . $sql[ 'order' ]; |
|
1149
|
1148
|
|
|
1150
|
1149
|
return $sql; |
|
1151
|
1150
|
} ); |
|
@@ -1186,15 +1185,15 @@ discard block |
|
|
block discarded – undo |
|
1186
|
1185
|
} ); |
|
1187
|
1186
|
} else { |
|
1188
|
1187
|
$entries = $this->form->entries |
|
1189
|
|
- ->filter( \GV\GF_Entry_Filter::from_search_criteria( $parameters['search_criteria'] ) ) |
|
|
1188
|
+ ->filter( \GV\GF_Entry_Filter::from_search_criteria( $parameters[ 'search_criteria' ] ) ) |
|
1190
|
1189
|
->offset( $this->settings->get( 'offset' ) ) |
|
1191
|
|
- ->limit( $parameters['paging']['page_size'] ) |
|
|
1190
|
+ ->limit( $parameters[ 'paging' ][ 'page_size' ] ) |
|
1192
|
1191
|
->page( $page ); |
|
1193
|
1192
|
|
|
1194
|
|
- if ( ! empty( $parameters['sorting'] ) && ! empty( $parameters['sorting']['key'] ) ) { |
|
|
1193
|
+ if ( ! empty( $parameters[ 'sorting' ] ) && ! empty( $parameters[ 'sorting' ][ 'key' ] ) ) { |
|
1195
|
1194
|
$field = new \GV\Field(); |
|
1196
|
|
- $field->ID = $parameters['sorting']['key']; |
|
1197
|
|
- $direction = strtolower( $parameters['sorting']['direction'] ) == 'asc' ? \GV\Entry_Sort::ASC : \GV\Entry_Sort::DESC; |
|
|
1195
|
+ $field->ID = $parameters[ 'sorting' ][ 'key' ]; |
|
|
1196
|
+ $direction = strtolower( $parameters[ 'sorting' ][ 'direction' ] ) == 'asc' ? \GV\Entry_Sort::ASC : \GV\Entry_Sort::DESC; |
|
1198
|
1197
|
$entries = $entries->sort( new \GV\Entry_Sort( $field, $direction ) ); |
|
1199
|
1198
|
} |
|
1200
|
1199
|
} |
|
@@ -1265,7 +1264,7 @@ discard block |
|
|
block discarded – undo |
|
1265
|
1264
|
$allowed = $headers = array(); |
|
1266
|
1265
|
|
|
1267
|
1266
|
foreach ( $view->fields->by_position( "directory_*" )->by_visible()->all() as $id => $field ) { |
|
1268
|
|
- $allowed[] = $field; |
|
|
1267
|
+ $allowed[ ] = $field; |
|
1269
|
1268
|
} |
|
1270
|
1269
|
|
|
1271
|
1270
|
$renderer = new Field_Renderer(); |
|
@@ -1287,17 +1286,17 @@ discard block |
|
|
block discarded – undo |
|
1287
|
1286
|
} ); |
|
1288
|
1287
|
|
|
1289
|
1288
|
foreach ( array_diff( $allowed_field_ids, wp_list_pluck( $allowed, 'ID' ) ) as $field_id ) { |
|
1290
|
|
- $allowed[] = is_numeric( $field_id ) ? \GV\GF_Field::by_id( $view->form, $field_id ) : \GV\Internal_Field::by_id( $field_id ); |
|
|
1289
|
+ $allowed[ ] = is_numeric( $field_id ) ? \GV\GF_Field::by_id( $view->form, $field_id ) : \GV\Internal_Field::by_id( $field_id ); |
|
1291
|
1290
|
} |
|
1292
|
1291
|
|
|
1293
|
1292
|
foreach ( $allowed as $field ) { |
|
1294
|
1293
|
$source = is_numeric( $field->ID ) ? $view->form : new \GV\Internal_Source(); |
|
1295
|
1294
|
|
|
1296
|
|
- $return[] = $renderer->render( $field, $view, $source, $entry, gravityview()->request, '\GV\Field_CSV_Template' ); |
|
|
1295
|
+ $return[ ] = $renderer->render( $field, $view, $source, $entry, gravityview()->request, '\GV\Field_CSV_Template' ); |
|
1297
|
1296
|
|
|
1298
|
1297
|
if ( ! $headers_done ) { |
|
1299
|
1298
|
$label = $field->get_label( $view, $source, $entry ); |
|
1300
|
|
- $headers[] = $label ? $label : $field->ID; |
|
|
1299
|
+ $headers[ ] = $label ? $label : $field->ID; |
|
1301
|
1300
|
} |
|
1302
|
1301
|
} |
|
1303
|
1302
|
|