Title: Launcher button
Last modified: February 26, 2023

---

# Launcher button

 *  Resolved [33ia](https://wordpress.org/support/users/33ia/)
 * (@33ia)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/launcher-button/)
 * I want to add a button to launch (open) the chat please? I’m using the pro plugin
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flauncher-button%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/launcher-button/#post-16516743)
 * Hi,
 * You can use this code, for example:
 *     ```wp-block-code
       add_filter( 'mwai_chatbot', function( $content, $params ) {
         $id = $params['id'];
         ob_start();
         ?>
         <script>
           let chat = document.querySelector('#mwai-chat-<?= $id ?>');
           chat.style.display = 'none';
           function showMyChat() {
             chat.style.display = 'block';
             chat.classList.add('mwai-open');
           }
         </script>
         <?php
         $output = ob_get_contents();
         ob_end_clean();
         return $content . $output;
       }, 10, 2);
       ```
   
 * That will hide the chatbot, and create a function showMyChat, that you can call
   anytime, in a button, in a link, or anywhere else 🙂

Viewing 1 replies (of 1 total)

The topic ‘Launcher button’ is closed to new replies.

 * ![](https://ps.w.org/ai-engine/assets/icon-256x256.png?rev=3431928)
 * [AI Engine - The Chatbot, AI Framework & MCP for WordPress](https://wordpress.org/plugins/ai-engine/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ai-engine/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ai-engine/)
 * [Active Topics](https://wordpress.org/support/plugin/ai-engine/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ai-engine/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ai-engine/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/launcher-button/#post-16516743)
 * Status: resolved