block_name = 'taxonomy'; $this->styles = array( 'sp_smart_post_blocks_css', 'sp_smart_post_blocks_google_fonts', 'sp_smart_post_blocks_social_icons_style' ); } /** * Renders the Taxonomy block (consolidated single-method version) * * @param array $attributes Block attributes. * @param string $content Existing block content. * @param array $blocks array. * @return string Rendered HTML */ public function render_block( $attributes, $content = '', $blocks = array() ) { if ( Helper::is_editor_page() ) { return $content; } // Get settings with fallbacks. $attributes['page_id'] = get_the_ID(); unset( $attributes['dynamicCss'], $attributes['fontListsEditPage'], $attributes['fontLists'] ); $unique_id = $attributes['uniqueId'] ?? ''; $block_name = sanitize_html_class( $attributes['blockName'] ?? '' ); $layout = $attributes['layout'] ?? 'taxonomy-layout-one'; $no_result_found_text = $attributes['noResultFoundText'] ?? 'No Data Found'; $taxonomy_type = $attributes['taxonomyType'] ?? 'category'; $empty_category = $attributes['emptyCategory'] ?? true; $all_taxonomy_term = $attributes['allTaxonomyTerm'] ?? true; $include_terms = $attributes['SelectTerms'] ?? array(); $exclude_terms = $attributes['excludeTerms'] ?? array(); $limit = $attributes['limit'] ?? 6; $is_layout_five_six = in_array( $layout, array( 'taxonomy-layout-five', 'taxonomy-layout-six' ) ); $align_class = ! empty( $attributes['align'] ) ? 'align' . $attributes['align'] : ''; $title_enable = $attributes['titleEnable'] ?? true; $display_overly_thum = $attributes['displayOverlyThum'] ?? true; $display_overly_hover_thum = $attributes['displayOverlyHoverThum'] ?? true; $after_count = $attributes['afterCount'] ?? ')'; $before_count = $attributes['beforeCount'] ?? '('; $count_enable = $attributes['countEnable'] ?? true; $content_multi_color_bg = $attributes['contentMultiColorBg'] ?? true; $icon = $attributes['icon'] ?? true; $show_hide_divider = $attributes['showHideDivider'] ?? true; $show_excerpt = $attributes['excerptShow'] ?? false; $taxonomy_icon_style = $attributes['taxonomyIconStyle'] ?? ''; $counter_multi_color_bg = $attributes['counterMultiColorBg'] ?? ''; $excerpt_length = $attributes['excerptLength'] ?? 7; $post_card_bg = $attributes['postCardBg'] ?? array(); $image_overlay_color = $attributes['imageOverlayColor'] ?? ''; $image_overlay_hover_color = $attributes['imageOverlayHoverColor'] ?? ''; $image_overlay_custom_color = $attributes['imageOverlayCustomColor'] ?? ''; $image_overlay_custom_hover_color = $attributes['imageOverlayCustomHoverColor'] ?? ''; $image_enable = $attributes['imageEnable'] ?? true; $hover_effect = $attributes['hoverEffect'] ?? 'normal'; $image_overlay = $attributes['imageOverlay'] ?? ''; $hover_animation = $attributes['hoverAnimation'] ?? ''; $title_global_typography_class = isset( $attributes['titleGlobalTypography']['class'] ) ? $attributes['titleGlobalTypography']['class'] : ''; $excerpt_global_typography_class = isset( $attributes['excerptGlobalTypography']['class'] ) ? $attributes['excerptGlobalTypography']['class'] : ''; $counter_global_typography_class = isset( $attributes['counterGlobalTypography']['class'] ) ? $attributes['counterGlobalTypography']['class'] : ''; $base_args = array( 'layout' => $layout, 'title_enable' => $title_enable, 'after_count' => $after_count, 'before_count' => $before_count, 'count_enable' => $count_enable, 'show_excerpt' => $show_excerpt, 'excerpt_length' => $excerpt_length, 'title_global_typography_class' => $title_global_typography_class, 'excerpt_global_typography_class' => $excerpt_global_typography_class, 'counter_global_typography_class' => $counter_global_typography_class, ); $args_five_six = array_merge( $base_args, array( 'image_overlay' => $image_overlay, 'hover_effect' => $hover_effect, 'image_enable' => $image_enable, ) ); $args_default = array_merge( $base_args, array( 'display_overly_thum' => $display_overly_thum, 'display_overly_hover_thum' => $display_overly_hover_thum, 'content_multi_color_bg' => $content_multi_color_bg, 'icon' => $icon, 'show_hide_divider' => $show_hide_divider, 'taxonomy_icon_style' => $taxonomy_icon_style, 'counter_multi_color_bg' => $counter_multi_color_bg, 'hover_animation' => $hover_animation, 'post_card_bg' => $post_card_bg, 'image_overlay_color' => $image_overlay_color, 'image_overlay_hover_color' => $image_overlay_hover_color, 'image_overlay_custom_color' => $image_overlay_custom_color, 'image_overlay_custom_hover_color' => $image_overlay_custom_hover_color, ) ); // Loader markup before fetching terms. ob_start(); ?>
description ?? '', $excerpt_length ) ); ?>