內容簡介
XMPP Enabled 提供一個給其他插件使用 Jabber/XMPP 協議的單一功能 API。
如果您想在通知中使用 XMPP 協議,請參閱 API 部分以獲取詳細信息。
GitHub 頁面:https://github.com/sandfoxme/xmpp-enabled
感謝
Mako N(日語翻譯和 i18n 支援)
插件 API
單一功能
發送 XMPP 消息的單一功能為 xmpp_enabled。它可以直接從任何 WordPress 插件中調用
xmpp_enabled($recipient, $message, $subject='', $type='normal');
$recipient 是收件人的有效(裸或完整)JID,如 ‘[email protected]’
$message 是要發送的純文本消息
$subject 是消息的標題行。對於聊天類型的消息,通常省略
$type 是消息的類型。它可以是 ‘chat’、‘normal’ 或 ‘headline’。有關詳細信息,請參閱RFC 3921
例如:xmpp_send('[email protected]',"讀取我們的新文章:\nhttp://something.com/new-post",'新文章已發布','headline');
在 XMPP Enabled 部分中創建子菜單
XMPP Enabled 創建了自己的部分,您可以自由地在其中使用它為您的插件。代碼為 'xmpp-enabled'
例如:add_submenu_page('xmpp-enabled', 'Jabber Comment Notifications', 'Comment Notifications', 'administrator', __FILE__, 'jcommnotify_settings');
有關詳細信息,請參閱 WordPress Codex 中的添加管理菜單。
外掛標籤
開發者團隊
原文外掛簡介
XMPP Enabled provides a single function API for other plugins that use Jabber/XMPP messaging protocol.
See API section for details if you want to use XMPP protocol in your notifications.
GitHub page: https://github.com/sandfoxme/xmpp-enabled
Thanks to
Mako N (Japanese translation and i18n support)
Plugin API
The Single Function
The single function for sending XMPP Messages is xmpp_enabled. It can be called directly from any WordPress plugin
xmpp_enabled($recipient, $message, $subject='', $type='normal');
$recipient is a valid (bare or full) JID of the recipient like ‘[email protected]’
$message is a plain text message to be sent
$subject is a title line for message. It is usually omitted for chat-type messages
$type is a type of message. It can be ‘chat’, ‘normal’ or ‘headline’. See RFC 3921 for details
Example: xmpp_send('[email protected]',"Read our new post:\nhttp://something.com/new-post",'New post is published','headline');
Create submenu in the XMPP Enabled section
XMPP Enabled creates it’s own section and you’re free to use it for your plugins. The code is 'xmpp-enabled'
Example: add_submenu_page('xmpp-enabled', 'Jabber Comment Notifications', 'Comment Notifications', 'administrator', __FILE__, 'jcommnotify_settings');
See Adding Administration Menus in WordPress Codex for further details
