function componseStringShortcode($data, $prefix, $id) { $parameter = null; $shortcode = null; $Validation = new PBValidation(); $name = $prefix . ($Validation->isEmpty($id) ? null : '_' . $id); foreach ($data['parameter'] as $index => $value) { $value = is_array($value) ? join(',', $value) : $value; if ($value == '-1') { continue; } $parameter .= ' ' . $index . '="' . esc_attr($value) . '"'; } $shortcodeBegin = '[' . PLUGIN_PAGE_BUILDER_SHORTCODE_PREFIX . $name . $parameter . ']'; $shortcodeEnd = '[/' . PLUGIN_PAGE_BUILDER_SHORTCODE_PREFIX . $name . ']'; if (count($data['children'])) { foreach ($data['children'] as $aIndex => $aValue) { if (PBHelper::isNumericArray($aValue)) { foreach ($aValue as $bValue) { $shortcode .= $this->componseStringShortcode($bValue, $prefix, $aIndex); } } else { $shortcode .= $this->componseStringShortcode($aValue, $prefix, $aIndex); } } } else { $shortcode .= $data['content']; } $shortcode = $shortcodeBegin . $shortcode . $shortcodeEnd; return $shortcode; }