Chatbots - Conditions
By default, the chatbot will not appear anywhere. Set conditions to specify where the chatbot should be visible:
- Is Admin: Displays the chatbot in the admin area.
- Post Type: Displays the chatbot on pages of a specific post type.
- Post: Shows the chatbot on specific posts.
- Post Status: Activates the chatbot on posts with specific statuses.
- Post Template: Displays the chatbot on pages using a specific template.
- Taxonomy: Shows the chatbot on pages related to a specific taxonomy.
- Term: Displays the chatbot for specific terms.
- User Logged In: Shows the chatbot when a user is logged in.
- User Role: Restricts the chatbot display to users with specific roles.
- Is Home: Displays the chatbot on the homepage.
- Is Front Page: Shows the chatbot on the front page.
- Is Page: Displays the chatbot on static pages.
- Is Single: Shows the chatbot on single posts for any post type.
- Is Singular: Activates the chatbot on any single post, page, or attachment.
- Is Search: Displays the chatbot on search results pages.
- Is Archive: Shows the chatbot on archive pages (e.g., author or date archives).
- Is Post Type Archive: Activates the chatbot on archive pages for specific post types.
- Is Category: Displays the chatbot on category pages.
- Is Tag: Activates the chatbot on tag pages.
- Is Taxonomy: Shows the chatbot on custom taxonomy archive pages.
- Is Author: Displays the chatbot on author archive pages.
- Is Date: Activates the chatbot on date-based archives.
- Is Year: Shows the chatbot on year-based archives.
- Is Month: Displays the chatbot on month-based archives.
- Is Day: Displays the chatbot on day-based archives.
- Is Time: Activates the chatbot on time-specific query pages.
- Is Attachment: Displays the chatbot on attachment (media) pages.
- Is 404: Activates the chatbot on 404 error pages.
To use custom conditions, use the sleekAi/chatbot/condition
filter.
add_filter('sleekAi/chatbot/conditions', function ($data) { $data[] = [ 'id' => 'isCustomUrl', 'label' => 'Custom URL Check', 'value' => str_contains($_SERVER['REQUEST_URI'], '?customParam'), ]; return $data; });
Copy
When using boolean conditions, the id has to be prefixed with is
.
Alternatively, you can use the shortcode displayed in the conditions section to render the chatbot anywhere you want.
Embedding
Any chatbot can be embedded as a full size chat widget in on any page using the
shortcode in combination with the type
attribute.
[sleek-ai-chatbot id="1" type="chat"];
Copy
This will render the chatbot in a full size chat widget on the page.