', esc_attr( $widgetId ), esc_attr( $widgetClasses ) ); $params[0]['after_widget'] = '
'; $params[0]['before_title'] = '

'; $params[0]['after_title'] = '

'; return $params; } /** * Process block widget content to downgrade h2 headings to h4. * * Block widgets render their headings as

. * Inside a sidebar card, h2 is too large — replace with h4 for proper * visual hierarchy. * * @param string $content Widget block content. * @param array $instance Widget instance data. * @param \WP_Widget $widget Widget object. * @return string Modified content. */ public function processBlockWidgetContent( string $content, array $instance, \WP_Widget $widget ): string { if ( empty( $content ) ) { return $content; } // Replace

with

for widget headings. $content = preg_replace( '//', '', $content ); return $content; } }