true, ) ); register_block_type( 'ajax-search-lite/block-asl-main', array( 'api_version' => 3, 'editor_script' => 'wdo-asl-block-editor', 'render_callback' => array( $this, 'render' ), ) ); } /** * How to render the ajax-search-lite/block-asl-main block via ServerSideRender JSX component * * @param array{scType: integer, instance: integer} $atts * @return string */ public function render( array $atts ): string { // Editor render if ( isset($_GET['context']) && $_GET['context'] === 'edit' ) { // phpcs:ignore: WordPress.Security.NonceVerification.Recommended return do_shortcode('[wd_asl include_styles=1]'); } return do_shortcode('[wd_asl]'); } }