[ 'label' => esc_html__( 'Count', 'elementor-pro' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'count_color', [ 'label' => esc_html__( 'Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .woocommerce-loop-category__title .count' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'count_typography', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, ], 'selector' => '{{WRAPPER}} .woocommerce-loop-category__title .count', ] ); $this->end_controls_section(); } private function get_shortcode() { $settings = $this->get_settings(); $attributes = [ 'number' => $settings['number'], 'columns' => $settings['columns'], 'hide_empty' => ( 'yes' === $settings['hide_empty'] ) ? 1 : 0, 'orderby' => $settings['orderby'], 'order' => $settings['order'], ]; if ( 'by_id' === $settings['source'] ) { $attributes['ids'] = implode( ',', $settings['categories'] ); } elseif ( 'by_parent' === $settings['source'] ) { $attributes['parent'] = $settings['parent']; } elseif ( 'current_subcategories' === $settings['source'] ) { $attributes['parent'] = get_queried_object_id(); } $this->add_render_attribute( 'shortcode', $attributes ); $shortcode = sprintf( '[product_categories %s]', $this->get_render_attribute_string( 'shortcode' ) ); return $shortcode; } public function render() { $product_categories_html = do_shortcode( $this->get_shortcode() ); if ( $product_categories_html ) { $product_categories_html = str_replace( '