registerBlocks(); add_filter( 'widget_types_to_hide_from_legacy_widget_block', array( $this, 'hideLegacyWidgetBlock' ) ); } ); } private function registerBlocks() { register_block_type( DGWT_WCAS_DIR . 'build/blocks/search', array( 'render_callback' => array( $this, 'renderCallback' ), ) ); register_block_type( DGWT_WCAS_DIR . 'build/blocks/search-nav', array( 'render_callback' => array( $this, 'renderCallback' ), ) ); } /** * Render FiboSearch blocks content * * @param $attributes * @param $content * @param $block * * @return string */ public function renderCallback( $attributes, $content, $block ) { $normalizedAttributes = array(); $isBackend = defined( 'REST_REQUEST' ) && REST_REQUEST && isset( $_REQUEST['context'] ) && $_REQUEST['context'] === 'edit'; if ( isset( $attributes['inheritPluginSettings'] ) && ! $attributes['inheritPluginSettings'] ) { if ( isset( $attributes['layout'] ) ) { $normalizedAttributes['layout'] = esc_attr( $attributes['layout'] ); } if ( isset( $attributes['darkenedBackground'] ) ) { $normalizedAttributes['darken_bg'] = esc_attr( $attributes['darkenedBackground'] ); } if ( isset( $attributes['mobileOverlay'] ) ) { $normalizedAttributes['mobile_overlay'] = esc_attr( $attributes['mobileOverlay'] ); } if ( isset( $attributes['iconColor'] ) ) { $normalizedAttributes['icon_color'] = esc_attr( $attributes['iconColor'] ); } if ( $isBackend ) { if ( isset( $attributes['layout'] ) && $attributes['layout'] === 'icon-flexible' ) { ob_start(); echo '