Skip to content

Commit 7dc22d9

Browse files
committed
fix for multivalue fields within repeatable groups
PROBLEM: if a field that can contain multiple values, like multicheck or another repeatable field is nested within a repeatable group, this causes multiple copies of the serialized data to be stored in the database each time a post is updated. This fixes that issue but also prevents this data from being split out into it's own postmeta entry
1 parent 99f8cd9 commit 7dc22d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Meta_Split.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ protected function update_sub_meta( $args, $id = null, array $v = null, $sub_key
100100
$sub_key = is_numeric( $sub_key ) ? '' : $sub_key;
101101

102102
foreach ( $v as $key => $entry ) {
103-
if ( is_array( $entry ) ) {
103+
if ( is_array( $entry ) && is_numeric( $key ) ) {
104104
$this->update_sub_meta( $args, $id, $entry, $key );
105105
} else {
106106
$postfix = is_numeric( $key ) ? '' : $sub_key . '_' . $key;

0 commit comments

Comments
 (0)