Skip to content

Commit 34c58ed

Browse files
committed
Fix snake_case conversion logic in Generic_Object
Corrects the condition to convert camelCase to snake_case only for keys not prefixed with '_', ensuring proper key formatting in the Generic_Object class.
1 parent 818ada9 commit 34c58ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/activity/class-generic-object.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function from_array( $data ) {
205205
foreach ( $data as $key => $value ) {
206206
if ( null !== $value ) {
207207
// Convert camelCase to snake_case if not prefixed with '_'.
208-
if ( \str_starts_with( $key, '_' ) ) {
208+
if ( ! \str_starts_with( $key, '_' ) ) {
209209
$key = camel_to_snake_case( $key );
210210
}
211211

0 commit comments

Comments
 (0)