Set Call to Action is a WordPress ability from Joinchat — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.
Install Free Plugin →Set Call to Action
WriteUpdate the call-to-action text shown with the Joinchat chat button, globally or per post/term.
Requires the Joinchat plugin installed on WordPress 6.9+ with the Abilities API available (abilities register on the wp_abilities_api_init hook). The get-phone, set-phone, set-cta, and set-message abilities require the 'edit_posts' capability when a post_id or term_id context is supplied, or the capability returned by Joinchat_Util::capability() (defaults to 'manage_options', filterable via the 'joinchat_capability' filter) for global changes. The get-whatsapp-url ability has no permission check.
What it does
This ability sets the call-to-action (CTA) text displayed with Joinchat's chat button, sanitizing the input with sanitize_text_field before saving. Depending on which context input is supplied, it writes to a post's _joinchat meta ('message_text'), a term's _joinchat meta, or the site-wide 'message_text' value in the joinchat option, following the same post/term/global priority as the other context-aware abilities. An AI assistant can use this to tailor the invitation message shown to visitors on a specific page, category, or across the whole site, and it returns a boolean reflecting whether the update succeeded.
See it in action
You ask your AI assistant
"Set the call-to-action text for the Electronics category (term ID 15) to 'Questions about this product? Chat with us on WhatsApp!'"
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| cta | string | Yes | Call to Action text. |
| post_id | integer | No | Optional post ID for context-specific CTA. Defaults to 0. |
| term_id | integer | No | Optional term ID for context-specific CTA. Defaults to 0. |
Returns
A boolean indicating whether the update_post_meta, update_term_meta, or update_option call succeeded.
Permission
Requires the 'edit_posts' capability when a post_id or term_id is supplied, or the capability returned by Joinchat_Util::capability() (defaults to 'manage_options', filterable via 'joinchat_capability') when updating the global CTA.
More Joinchat abilities
Generate WhatsApp URL
Build a WhatsApp click-to-chat URL from a phone number and optional pre-filled message.
Get WhatsApp contact Phone
Read the WhatsApp phone number configured for the site, or for a specific post or term.
Set WhatsApp contact Phone
Update the WhatsApp phone number globally or for a specific post/term.
Set WhatsApp pre-filled Message
Update the pre-filled WhatsApp message sent when a visitor starts a chat, globally or per post/term.