array( $this, 'render_block' ) ) ); wp_set_script_translations( 'selectika-widget-editor-script', 'selectika', SELECTIKA_PLUGIN_DIR . 'languages' ); } /** * Render a dynamic block through the shared placement renderer. * * @param array $attributes Configured attributes. */ public function render_block( $attributes ) { $params = array( 'title_text' => sanitize_text_field( $attributes['title_text'] ?? '' ), 'carousel_view_type' => sanitize_text_field( $attributes['carousel_view_type'] ?? 'Carousel' ), 'item_count' => min( 100, max( 1, (int) ( $attributes['item_count'] ?? 10 ) ) ), ); return Selectika_Renderer::render( $attributes, $params, true ); } }