'auto', ), $atts, 'starquill_reviews' ); return Starquill_Render::render( $args ); } /** * Register the dynamic Gutenberg block. * * @return void */ public static function register_block() { if ( ! function_exists( 'register_block_type' ) ) { return; } register_block_type( 'starquill/reviews', array( 'api_version' => 2, 'title' => __( 'Review Summary', 'starquill' ), 'category' => 'widgets', 'attributes' => array( 'product' => array( 'type' => 'string', 'default' => 'auto' ), ), 'editor_script' => 'starquill-block', 'render_callback' => function ( $attributes ) { return Starquill_Render::render( array( 'product' => isset( $attributes['product'] ) ? $attributes['product'] : 'auto', ) ); }, ) ); } } Starquill_Shortcode::init(); }