Skip to content

Commit cb073d3

Browse files
committed
Fix parentheses on defaults
1 parent eb6633c commit cb073d3

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

admin/class-acf-php-metabox.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,30 +128,29 @@ protected function convert_field( $field_id, $field, $parent_id = null, $layout_
128128
// Generate a unique key for each field
129129
$key = 'field_' . $options['key'] . '_' . $field_id;
130130

131-
if ( !empty( $parent_id ) && !empty( $layout_id ) ) {
131+
if ( ! empty( $parent_id ) && ! empty( $layout_id ) ) {
132132
$key = 'field_' . $options['key'] . '_' . $parent_id . '_' . $layout_id . '_' . $field_id;
133-
} elseif ( !empty( $parent_id ) && empty( $layout_id ) ) {
133+
} elseif ( ! empty( $parent_id ) && empty( $layout_id ) ) {
134134
$key = 'field_' . $options['key'] . '_' . $parent_id . '_' . $field_id;
135135
}
136136

137137
$field['key'] = $key;
138138
$field['name'] = $field_id;
139139

140-
// If it's a tab with no placement setting, set default placement
140+
// Set defaults
141141
if ( $field['type'] === 'tab' && ! isset( $field['placement'] ) ) {
142142
$field['placement'] = 'left';
143143
}
144144

145-
// Set defaults
146-
if ( $is_layout && ! isset( $field['display'] ) {
145+
if ( $is_layout && ! isset( $field['display'] ) ) {
147146
$field['display'] = 'row';
148147
}
149148

150-
if ( ! $is_layout && ! isset( $field['type'] ){
149+
if ( ! $is_layout && ! isset( $field['type'] ) ) {
151150
$field['type'] = 'text';
152151
}
153152

154-
if ( ! isset( $field['label'] ) {
153+
if ( ! isset( $field['label'] ) ) {
155154
$field['label'] = ucwords( str_replace( '_', ' ', $field_id ) );
156155
}
157156

0 commit comments

Comments
 (0)