$option ) { foreach ( $option as $key => $value ) { $string[ $key . self::DELIMITER . $index ] = [ 'value' => $value, 'translate' => in_array( $key, self::TRANSLATABLE_KEYS, true ), ]; } } } return $string; } public function encode_divi_options( $string, $encoding ) { if ( 'divi_options' === $encoding ) { $output = []; foreach ( $string as $combined_key => $value ) { $parts = explode( self::DELIMITER, $combined_key ); $index = array_pop( $parts ); $key = implode( self::DELIMITER, $parts ); $output[ $index ][ $key ] = $value; } $output = wp_json_encode( $output, JSON_UNESCAPED_UNICODE ); $string = str_replace( self::CHARS_DECODED, self::CHARS_ENCODED, $output ); } return $string; } }