Get WhatsApp contact Phone 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 →Get WhatsApp contact Phone
Read-onlyRead the WhatsApp phone number configured for the site, or for a specific post or 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 returns the WhatsApp phone number Joinchat will use to build its chat button, checking in order: post meta (_joinchat) for a given post_id, then term meta (_joinchat) for a given term_id, and finally falling back to the site-wide 'telephone' setting stored in the joinchat option. Both post_id and term_id inputs are optional and default to 0, in which case only the global setting is checked. This lets an AI assistant confirm which contact number is actually live for a specific page or category before making changes, or simply audit the site-wide default number. The returned number is passed through Joinchat's phone-cleaning helper before being returned.
See it in action
You ask your AI assistant
"What WhatsApp phone number is currently configured for my site's Joinchat widget?"
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| post_id | integer | No | Optional post ID for context-specific phone. Defaults to 0. |
| term_id | integer | No | Optional term ID for context-specific phone. Defaults to 0. |
Returns
A string with the cleaned WhatsApp phone number resolved for the given post, term, or global setting, checked in that priority order.
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 requesting the global phone number.
More Joinchat abilities
Generate WhatsApp URL
Build a WhatsApp click-to-chat URL from a phone number and optional pre-filled message.
Set Call to Action
Update the call-to-action text shown with the Joinchat chat button, globally or per post/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.