|
@@ -40,7 +40,7 @@ discard block |
|
|
block discarded – undo |
|
40
|
40
|
|
|
41
|
41
|
public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
|
42
|
42
|
|
|
43
|
|
- unset ( $field_options['search_filter'], $field_options['show_as_link'], $field_options['new_window'] ); |
|
|
43
|
+ unset ( $field_options[ 'search_filter' ], $field_options[ 'show_as_link' ], $field_options[ 'new_window' ] ); |
|
44
|
44
|
|
|
45
|
45
|
$new_fields = array( |
|
46
|
46
|
'content' => array( |
|
@@ -75,7 +75,7 @@ discard block |
|
|
block discarded – undo |
|
75
|
75
|
); |
|
76
|
76
|
|
|
77
|
77
|
if ( 'edit' === $context ) { |
|
78
|
|
- unset( $field_options['custom_label'], $field_options['show_label'], $field_options['allow_edit_cap'], $new_fields['wpautop'], $new_fields['oembed'] ); |
|
|
78
|
+ unset( $field_options[ 'custom_label' ], $field_options[ 'show_label' ], $field_options[ 'allow_edit_cap' ], $new_fields[ 'wpautop' ], $new_fields[ 'oembed' ] ); |
|
79
|
79
|
} |
|
80
|
80
|
|
|
81
|
81
|
return $new_fields + $field_options; |
|
@@ -109,9 +109,9 @@ discard block |
|
|
block discarded – undo |
|
109
|
109
|
|
|
110
|
110
|
// Loop through the configured Edit Entry fields and add Custom Content fields if there are any |
|
111
|
111
|
// TODO: Make this available to other custom GV field types |
|
112
|
|
- foreach ( (array) $edit_fields as $edit_field ) { |
|
|
112
|
+ foreach ( (array)$edit_fields as $edit_field ) { |
|
113
|
113
|
|
|
114
|
|
- if( 'custom' === \GV\Utils::get( $edit_field, 'id') ) { |
|
|
114
|
+ if ( 'custom' === \GV\Utils::get( $edit_field, 'id' ) ) { |
|
115
|
115
|
|
|
116
|
116
|
$field_data = array( |
|
117
|
117
|
'label' => \GV\Utils::get( $edit_field, 'custom_label' ), |
|
@@ -124,13 +124,13 @@ discard block |
|
|
block discarded – undo |
|
124
|
124
|
$field_data[ $key ] = GravityView_Merge_Tags::replace_variables( $field_datum, $form, $entry->as_entry(), false, false ); |
|
125
|
125
|
} |
|
126
|
126
|
|
|
127
|
|
- $field_data['cssClass'] = \GV\Utils::get( $edit_field, 'custom_class' ); |
|
|
127
|
+ $field_data[ 'cssClass' ] = \GV\Utils::get( $edit_field, 'custom_class' ); |
|
128
|
128
|
|
|
129
|
|
- $new_fields[] = new GF_Field_HTML( $field_data ); |
|
|
129
|
+ $new_fields[ ] = new GF_Field_HTML( $field_data ); |
|
130
|
130
|
|
|
131
|
131
|
} else { |
|
132
|
|
- if( isset( $fields[ $i ] ) ) { |
|
133
|
|
- $new_fields[] = $fields[ $i ]; |
|
|
132
|
+ if ( isset( $fields[ $i ] ) ) { |
|
|
133
|
+ $new_fields[ ] = $fields[ $i ]; |
|
134
|
134
|
} |
|
135
|
135
|
$i++; |
|
136
|
136
|
} |