Skip to content

Commit d80db8f

Browse files
committed
96: Handle objects
1 parent 84891e7 commit d80db8f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Theme_Mod_Command.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,12 @@ function( $item ) {
156156
* @param string $separator A string to separate keys to denote their place in the tree.
157157
*/
158158
private function mod_to_string( $key, $value, &$list, $separator ) {
159-
if ( is_array( $value ) ){
159+
if ( is_array( $value ) || is_object( $value ) ) {
160+
// Convert objects to arrays for easier handling.
161+
$value = (array) $value;
162+
163+
// Explicitly handle empty arrays to ensure they are displayed.
160164
if ( empty( $value ) ) {
161-
// Explicitly handle empty arrays to ensure they are displayed.
162165
$list[] = array(
163166
'key' => $key,
164167
'value' => '[empty array]',

0 commit comments

Comments
 (0)