core = $core; add_filter( 'mwai_chatbot_blocks', [ $this, 'chatbot_blocks' ], 10, 2 ); } public function chatbot_blocks( $blocks, $args ) { $gdpr_text = $this->core->get_option( 'chatbot_gdpr_text' ) ?: 'By using this chatbot, you agree to the recording and processing of your data by our website and the external services it might use (LLMs, vector databases, etc.).'; $gdpr_button = $this->core->get_option( 'chatbot_gdpr_button' ) ?: '👍 I understand'; $gdpr_text = esc_html( $gdpr_text ); $gdpr_button = esc_html( $gdpr_button ); if ( $args['step'] !== 'init' ) { return $blocks; } $botId = $args['botId']; $uniqueId = uniqid('mwai_gdpr_'); $blocks[] = [ 'id' => $uniqueId, 'type' => 'content', 'data' => [ 'id' => $uniqueId, 'html' => '
' . $gdpr_text . '