| | |
| | | 'jvb/summary', |
| | | 'jvb/feed', |
| | | 'jvb/forms', |
| | | 'jvb/gmbreviews', |
| | | 'jvb/timeline', |
| | | 'jvb/video', |
| | | ]; |
| | | if ($isPrerender) { |
| | | $base = array_merge($base, [ |
| | |
| | | |
| | | public function render(string $content, array $block):string |
| | | { |
| | | if ($block['blockName'] === 'jvb/feed') { |
| | | // Enqueue the feed block script (it will automatically load dependencies) |
| | | switch ($block['blockName']) { |
| | | case 'jvb/feed': |
| | | $this->localize_feedblock(); |
| | | } |
| | | if ($block['blockName'] === 'jvb/forms') { |
| | | break; |
| | | case 'jvb/forms': |
| | | wp_enqueue_style('jvb-form'); |
| | | break; |
| | | case 'jvb/timeline': |
| | | wp_enqueue_script('jvb-gallery'); |
| | | add_action('wp_footer', 'jvbRenderGallery'); |
| | | break; |
| | | } |
| | | |
| | | |
| | | |
| | | return $this->checkMethods($content, $block); |
| | | } |
| | | |
| | |
| | | '<table%s', |
| | | $this->getClassesAndStyles($attrs) |
| | | ), $table); |
| | | $caption = ''; |
| | | if (array_key_exists(1, $parts)) { |
| | | $caption = str_replace(strtok($parts[1], '>'), '<figcaption', $parts[1]); |
| | | } |
| | | |
| | | |
| | | return sprintf( |
| | | '<figure%s>%s%s</figure>', |
| | |
| | | ); |
| | | } |
| | | } |
| | | |
| | | return sprintf( |
| | | '<ul%s>%s</ul>', |
| | | $this->getClassesAndStyles($block['attrs']??[], ['loop']), |
| | |
| | | protected function buildQueryArgs(array $attrs): array |
| | | { |
| | | $queryID = $attrs['queryId'] ?? null; |
| | | $args = []; |
| | | $args = [ |
| | | 'post_status' => 'publish', |
| | | ]; |
| | | foreach (($attrs['query'] ?? []) as $key => $value) { |
| | | if (empty($value)) continue; |
| | | switch ($key) { |
| | |
| | | |
| | | $type = 'row'; |
| | | $isRow = true; |
| | | |
| | | //Determine type |
| | | if ((array_key_exists('type', $value) && !in_array($value['type'], ['flex', 'grid'])) || |
| | | if ((array_key_exists('type', $value) && !in_array($value['type'], ['flex', 'grid', 'default'])) || |
| | | (array_key_exists('orientation', $value) && $value['orientation'] === 'vertical')) { |
| | | $type = 'col'; |
| | | $isRow = false; |