| | |
| | | protected function checkMethods(?string $content, array $block, ?WP_Block $parent = null, bool $isPrerender = false):?string |
| | | { |
| | | $blockName = $this->sanitizeBlockName($block); |
| | | if (str_starts_with($blockName, 'woocommerce')) { |
| | | |
| | | if (str_starts_with($blockName, 'woocommerce') ) { |
| | | return $content; |
| | | } |
| | | |
| | |
| | | } |
| | | public function prerender(?string $content, array $block, ?WP_Block $parent = null):?string |
| | | { |
| | | $result = $this->checkMethods($content, $block, $parent, true); |
| | | return $result; |
| | | return $this->checkMethods($content, $block, $parent, true); |
| | | } |
| | | |
| | | public function render(string $content, array $block):string |
| | |
| | | wp_enqueue_style('jvb-form'); |
| | | break; |
| | | case 'jvb/timeline': |
| | | case 'jvb/menu': |
| | | wp_enqueue_script('jvb-gallery'); |
| | | add_action('wp_footer', 'jvbRenderGallery'); |
| | | break; |
| | | } |
| | | |
| | | |
| | | |
| | | return $this->checkMethods($content, $block); |
| | | } |
| | | |
| | |
| | | } |
| | | if (array_key_exists('focalPoint', $attrs)) { |
| | | $attrs['isObjectPosition'] = true; |
| | | $style = $this->getFocalPointStyle($attrs['focalPoint'], $attrs); |
| | | $style = implode(';',$this->getFocalPointStyle($attrs['focalPoint'], $attrs)); |
| | | $style .= ';object-fit:none;'; |
| | | $imgLink = str_replace('<img', sprintf( |
| | | '<img style="%s"', |
| | |
| | | |
| | | if (!static::$currentLoop) { |
| | | |
| | | if (JVB_TESTING) { |
| | | jvbDump('No loop stored'); |
| | | } |
| | | return $content; |
| | | } |
| | | if (static::$currentLoop->have_posts()) { |
| | |
| | | ); |
| | | |
| | | } |
| | | if (JVB_TESTING) { |
| | | jvbDump('Could not create template part block for '.$block['blockName']); |
| | | } |
| | | |
| | | return $content; |
| | | |
| | | // $isHeaderTemplate = ( |
| | |
| | | ), jvbSearch($placeholder, uniqid(), $label, $buttonText, $isInside, $hideInput)); |
| | | } |
| | | //core_shortcode |
| | | public function prerender_core_shortcode(array $block, ?string $content, ?WP_Block $parent):?string |
| | | { |
| | | return do_shortcode($block['innerHTML']??''); |
| | | } |
| | | public function prerender_core_social_link(array $block, ?string $content, ?WP_Block $parent):?string |
| | | { |
| | | // jvbDump($block, 'social link'); |
| | |
| | | } |
| | | $content = ''; |
| | | foreach ($block['innerBlocks'] as $b) { |
| | | |
| | | $rendered = $parent |
| | | ? $this->checkMethods(null, $b, $parent, true) |
| | | : render_block($b); |
| | |
| | | ); |
| | | } |
| | | return $classes; |
| | | case 'anchor': |
| | | //TODO: What's this doing? |
| | | return ''; |
| | | default: |
| | | if (JVB_TESTING && !is_admin() &&!in_array($key, $this->ignore)) { |
| | | // TESTING |
| | |
| | | break; |
| | | } |
| | | return $this->getColorStyle($value, $type); |
| | | |
| | | case 'anchor': |
| | | //TODO: What should we do here? |
| | | break; |
| | | // Any other attributes that need direct styling |
| | | default: |
| | | if (JVB_TESTING && !is_admin() && !in_array($key, $this->ignore)) { |
| | |
| | | break; |
| | | default: |
| | | if (JVB_TESTING) { |
| | | jvbDump($value, 'No preset found for size: '.print_r($value, true)); |
| | | error_log('No preset found for size: '.print_r($value, true)); |
| | | } |
| | | } |
| | | } |