Skip to content

Commit d5fdc34

Browse files
committed
Better generated array key for cached fields, fixes issue where wrong field is found. Fixes #1405
1 parent 5efff88 commit d5fdc34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/CMB2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ public function get_field( $field, $field_group = null, $reset_cached = false )
13831383

13841384
list( $field_id, $sub_field_id ) = $ids;
13851385

1386-
$index = implode( '', $ids ) . ( $field_group ? $field_group->index : '' );
1386+
$index = implode( '|', $ids ) . ( $field_group ? '|' . $field_group->index : '' );
13871387

13881388
if ( array_key_exists( $index, $this->fields ) && ! $reset_cached ) {
13891389
return $this->fields[ $index ];

0 commit comments

Comments
 (0)