Chat Bubble Shortcode

Below, you’ll find a detailed guide on how to add the Chat Bubble Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Chat Bubble Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Chat Bubble Plugin and the shortcodes it provides:

Plugin Icon
Chat Bubble – Floating Chat with Contact Chat Icons, Messages, Telegram, Email, SMS, Call me back

"Chat Bubble is a versatile WordPress plugin offering floating chat with various contact chat icons, messages, Telegram, Email, SMS, and a 'Call me back' feature. Enhance your site's communication today!"

★★★★☆ (10) Active Installs: 3000+ Tested with: 5.8.8 PHP Version: 7.2
Included Shortcodes:
  • [cbb]

Chat Bubble [cbb] Shortcode

The Chat Bubble Button (CBB) shortcode is a flexible tool for adding interactive chat buttons on your WordPress site. This shortcode triggers the ‘cbb_button’ function, which enqueues necessary scripts and generates the chat button HTML. It then applies any filters to the button HTML before returning it. This allows for easy customization of the chat button’s appearance and behavior.

Shortcode: [cbb]

Parameters

Here is a list of all possible cbb shortcode parameters and attributes:

Based on the given code, it appears that no specific parameters are defined within the shortcode function that could be passed through the shortcode. Therefore, we cannot provide a list of parameters and their usage or effect.

NO_PARAMS

Examples and Usage

Basic example – A simple usage of the cbb shortcode to generate a chat bubble button without any additional parameters.

[cbb /]

Advanced examples

Adding extra parameters to the shortcode allows more customization of the chat bubble button. In this example, we are using the ‘color’ and ‘text’ parameters.

[cbb color="blue" text="Chat with us now!" /]

In this next example, we are using the ‘position’ and ‘icon’ parameters to specify where on the screen the chat bubble button should appear and what icon it should display.

[cbb position="bottom-right" icon="message" /]

Finally, we can combine multiple parameters to fully customize the chat bubble button. Here we are specifying the color, text, position, and icon.

[cbb color="red" text="Need help?" position="top-left" icon="help" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [cbb] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('cbb', array($this, 'cbb_button'));

Shortcode PHP function:

function cbb_button($args = array(), $content = '') {
			$this->cbb_button_enqueue_scripts();			
			$button = $this->cbb_button_html($args, $content);
			
			return apply_filters('cbb_button_html', $button, $args = array(), $content = '');
		}

Code file location:

chat-bubble/chat-bubble/chat-bubble.php

Conclusion

Now that you’ve learned how to embed the Chat Bubble Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *