{"id":14954998,"url":"https://github.com/froger-me/wp-weixin","last_synced_at":"2025-04-09T13:03:09.562Z","repository":{"id":87546081,"uuid":"131095581","full_name":"froger-me/wp-weixin","owner":"froger-me","description":"WordPress WeChat integration","archived":false,"fork":false,"pushed_at":"2025-03-11T12:15:37.000Z","size":447,"stargazers_count":93,"open_issues_count":7,"forks_count":38,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-02T11:38:23.681Z","etag":null,"topics":["php","wechat","wordpress-development","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/froger-me.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-26T03:34:24.000Z","updated_at":"2025-03-10T11:29:48.000Z","dependencies_parsed_at":"2025-03-26T11:02:10.035Z","dependency_job_id":null,"html_url":"https://github.com/froger-me/wp-weixin","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/froger-me%2Fwp-weixin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/froger-me%2Fwp-weixin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/froger-me%2Fwp-weixin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/froger-me%2Fwp-weixin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/froger-me","download_url":"https://codeload.github.com/froger-me/wp-weixin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045230,"owners_count":21038553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","wechat","wordpress-development","wordpress-plugin"],"created_at":"2024-09-24T13:10:21.869Z","updated_at":"2025-04-09T13:03:09.543Z","avatar_url":"https://github.com/froger-me.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WP Weixin - WordPress WeChat integration\n\n## Table of Contents\n\n* [WP Weixin - WordPress WeChat integration](#wp-weixin---wordpress-wechat-integration)\n\t* [Table of Contents](#table-of-contents)\n\t* [General Description](#general-description)\n\t\t* [Companion Plugins](#companion-plugins)\n\t\t* [Important Notes](#important-notes)\n\t\t* [Registering a domain in the Official Account's backend](#registering-a-domain-in-the-official-accounts-backend)\n\t\t* [Overview](#overview)\n\t\t* [Object Cache considerations](#object-cache-considerations)\n\t* [Settings](#settings)\n\t\t* [Main Settings](#main-settings)\n\t\t* [Multisite Settings](#multisite-settings)\n\t\t* [WeChat Responder Settings](#wechat-responder-settings)\n\t\t* [WeChat Pay Settings](#wechat-pay-settings)\n\t\t* [Proxy Settings](#proxy-settings)\n\t\t* [Miscellaneous Settings](#miscellaneous-settings)\n\t* [Multisite](#multisite)\n\t* [WeChat SDK](#wechat-sdk)\n\t* [Functions](#functions)\n\t\t\t* [wp\\_weixin\\_is\\_wechat](#wp_weixin_is_wechat)\n\t\t\t* [wp\\_weixin\\_ajax\\_safe](#wp_weixin_ajax_safe)\n\t\t\t* [wp\\_weixin\\_get\\_user\\_by\\_openid](#wp_weixin_get_user_by_openid)\n\t\t\t* [wp\\_weixin\\_get\\_user\\_by\\_unionid](#wp_weixin_get_user_by_unionid)\n\t\t\t* [wp\\_weixin\\_get\\_wechat](#wp_weixin_get_wechat)\n\t\t\t* [wp\\_weixin\\_get\\_options](#wp_weixin_get_options)\n\t\t\t* [wp\\_weixin\\_get\\_option](#wp_weixin_get_option)\n\t\t\t* [wp\\_weixin\\_wpml\\_switch\\_lang](#wp_weixin_wpml_switch_lang)\n\t\t\t* [wp\\_weixin\\_get\\_signed\\_package](#wp_weixin_get_signed_package)\n\t\t\t* [wp\\_weixin\\_get\\_user\\_wechat\\_info](#wp_weixin_get_user_wechat_info)\n\t\t\t* [wp\\_weixin\\_get\\_user\\_wechat\\_openid](#wp_weixin_get_user_wechat_openid)\n\t\t\t* [wp\\_weixin\\_get\\_auth\\_link](#wp_weixin_get_auth_link)\n\t\t\t* [wp\\_weixin\\_get\\_bind\\_link](#wp_weixin_get_bind_link)\n\t\t\t* [wp\\_weixin\\_unbind](#wp_weixin_unbind)\n\t\t\t* [wp\\_weixin\\_bind](#wp_weixin_bind)\n\t\t\t* [wp\\_weixin\\_is\\_follower](#wp_weixin_is_follower)\n\t* [Hooks - actions \\\u0026 filters](#hooks---actions--filters)\n\t\t* [Actions](#actions)\n\t\t\t* [wp\\_weixin\\_extensions](#wp_weixin_extensions)\n\t\t\t* [wp\\_weixin\\_responder](#wp_weixin_responder)\n\t\t\t* [wp\\_weixin\\_save\\_access\\_info](#wp_weixin_save_access_info)\n\t\t\t* [wp\\_weixin\\_before\\_user\\_profile\\_wechat\\_info](#wp_weixin_before_user_profile_wechat_info)\n\t\t\t* [wp\\_weixin\\_after\\_user\\_profile\\_wechat\\_info](#wp_weixin_after_user_profile_wechat_info)\n\t\t\t* [wp\\_weixin\\_before\\_bind\\_account](#wp_weixin_before_bind_account)\n\t\t\t* [wp\\_weixin\\_after\\_bind\\_account](#wp_weixin_after_bind_account)\n\t\t\t* [wp\\_weixin\\_before\\_unbind\\_account](#wp_weixin_before_unbind_account)\n\t\t\t* [wp\\_weixin\\_after\\_unbind\\_account](#wp_weixin_after_unbind_account)\n\t\t\t* [wp\\_weixin\\_before\\_tabs\\_settings](#wp_weixin_before_tabs_settings)\n\t\t\t* [wp\\_weixin\\_before\\_main\\_tab\\_settings](#wp_weixin_before_main_tab_settings)\n\t\t\t* [wp\\_weixin\\_before\\_main\\_settings\\_inner](#wp_weixin_before_main_settings_inner)\n\t\t\t* [wp\\_weixin\\_after\\_main\\_settings\\_inner](#wp_weixin_after_main_settings_inner)\n\t\t\t* [wp\\_weixin\\_after\\_main\\_tab\\_settings](#wp_weixin_after_main_tab_settings)\n\t\t\t* [wp\\_weixin\\_before\\_qr\\_tab\\_settings](#wp_weixin_before_qr_tab_settings)\n\t\t\t* [wp\\_weixin\\_after\\_qr\\_tab\\_settings](#wp_weixin_after_qr_tab_settings)\n\t\t\t* [wp\\_weixin\\_after\\_tabs\\_settings](#wp_weixin_after_tabs_settings)\n\t\t\t* [wp\\_weixin\\_before\\_settings](#wp_weixin_before_settings)\n\t\t\t* [wp\\_weixin\\_before\\_main\\_settings](#wp_weixin_before_main_settings)\n\t\t\t* [wp\\_weixin\\_after\\_main\\_settings](#wp_weixin_after_main_settings)\n\t\t\t* [wp\\_weixin\\_before\\_qr\\_settings](#wp_weixin_before_qr_settings)\n\t\t\t* [wp\\_weixin\\_before\\_qr\\_settings\\_inner](#wp_weixin_before_qr_settings_inner)\n\t\t\t* [wp\\_weixin\\_after\\_qr\\_settings\\_inner](#wp_weixin_after_qr_settings_inner)\n\t\t\t* [wp\\_weixin\\_after\\_qr\\_settings](#wp_weixin_after_qr_settings)\n\t\t\t* [wp\\_weixin\\_after\\_settings](#wp_weixin_after_settings)\n\t\t\t* [wp\\_weixin\\_endpoints](#wp_weixin_endpoints)\n\t\t\t* [wp\\_weixin\\_handle\\_payment\\_notification](#wp_weixin_handle_payment_notification)\n\t\t\t* [wp\\_weixin\\_handle\\_auto\\_refund](#wp_weixin_handle_auto_refund)\n\t\t* [Filters](#filters)\n\t\t\t* [wp\\_weixin\\_browser\\_page\\_qr\\_src](#wp_weixin_browser_page_qr_src)\n\t\t\t* [wp\\_weixin\\_subscribe\\_src](#wp_weixin_subscribe_src)\n\t\t\t* [wp\\_weixin\\_follower\\_notice\\_title](#wp_weixin_follower_notice_title)\n\t\t\t* [wp\\_weixin\\_follower\\_notice](#wp_weixin_follower_notice)\n\t\t\t* [wp\\_weixin\\_auth\\_needed](#wp_weixin_auth_needed)\n\t\t\t* [wp\\_weixin\\_debug](#wp_weixin_debug)\n\t\t\t* [wp\\_weixin\\_follower\\_welcome\\_title](#wp_weixin_follower_welcome_title)\n\t\t\t* [wp\\_weixin\\_follower\\_welcome\\_description](#wp_weixin_follower_welcome_description)\n\t\t\t* [wp\\_weixin\\_follower\\_welcome\\_url](#wp_weixin_follower_welcome_url)\n\t\t\t* [wp\\_weixin\\_follower\\_welcome\\_pic\\_url](#wp_weixin_follower_welcome_pic_url)\n\t\t\t* [wp\\_weixin\\_get\\_access\\_info](#wp_weixin_get_access_info)\n\t\t\t* [wp\\_weixin\\_jsapi\\_urls](#wp_weixin_jsapi_urls)\n\t\t\t* [wp\\_weixin\\_pay\\_callback\\_endpoint](#wp_weixin_pay_callback_endpoint)\n\t\t\t* [wp\\_weixin\\_settings](#wp_weixin_settings)\n\t\t\t* [wp\\_weixin\\_show\\_settings\\_section](#wp_weixin_show_settings_section)\n\t\t\t* [wp\\_weixin\\_show\\_setting](#wp_weixin_show_setting)\n\t\t\t* [wp\\_weixin\\_settings\\_fields](#wp_weixin_settings_fields)\n\t\t\t* [wp\\_weixin\\_auth\\_redirect](#wp_weixin_auth_redirect)\n\t\t\t* [wp\\_weixin\\_scan\\_heartbeat\\_frequency](#wp_weixin_scan_heartbeat_frequency)\n\t\t\t* [wp\\_weixin\\_qr\\_cleanup\\_frequency](#wp_weixin_qr_cleanup_frequency)\n\t\t\t* [wp\\_weixin\\_qr\\_lifetime](#wp_weixin_qr_lifetime)\n\t\t\t* [wp\\_weixin\\_user\\_wechat\\_info](#wp_weixin_user_wechat_info)\n\t\t\t* [wp\\_weixin\\_ms\\_auto\\_add\\_to\\_blog](#wp_weixin_ms_auto_add_to_blog)\n\t\t\t* [wp\\_weixin\\_ms\\_auth\\_blog\\_id](#wp_weixin_ms_auth_blog_id)\n\t\t\t* [wp\\_weixin\\_ms\\_pay\\_blog\\_id](#wp_weixin_ms_pay_blog_id)\n\t\t\t* [wp\\_weixin\\_locate\\_template\\_paths](#wp_weixin_locate_template_paths)\n\t\t\t* [wp\\_weixin\\_get\\_user\\_by\\_openid](#wp_weixin_get_user_by_openid-1)\n\t\t\t* [wp\\_weixin\\_pay\\_notify\\_results](#wp_weixin_pay_notify_results)\n\t\t\t* [wp\\_weixin\\_ecommerce\\_description](#wp_weixin_ecommerce_description)\n\t\t\t* [wp\\_weixin\\_subscribe\\_qr\\_url](#wp_weixin_subscribe_qr_url)\n\t\t\t* [wp\\_weixin\\_metabox\\_post\\_types](#wp_weixin_metabox_post_types)\n\t* [Templates](#templates)\n\t\t\t* [wp-weixin-subscribe](#wp-weixin-subscribe)\n\t\t\t* [wp-weixin-browser-qr](#wp-weixin-browser-qr)\n\t\t\t* [wp-weixin-auth-form-link](#wp-weixin-auth-form-link)\n\t\t\t* [wp-weixin-auth-page](#wp-weixin-auth-page)\n\t\t\t* [wp-weixin-mobile-auth-check](#wp-weixin-mobile-auth-check)\n\t\t\t* [wp-weixin-bind-form-link](#wp-weixin-bind-form-link)\n\t\t\t* [wp-weixin-bind-page](#wp-weixin-bind-page)\n\t\t\t* [wp-weixin-mobile-bind-check](#wp-weixin-mobile-bind-check)\n\t\t\t* [wp-weixin-public-info](#wp-weixin-public-info)\n\t\t\t* [wp-weixin-account-form-password-notice](#wp-weixin-account-form-password-notice)\n\t* [JavaScript](#javascript)\n\t\t\t* [wpWeixinShareTimelineSuccessListener](#wpweixinsharetimelinesuccesslistener)\n\t\t\t* [wpWeixinShareTimelineFailureListener](#wpweixinsharetimelinefailurelistener)\n\t\t\t* [wpWeixinShareAppMessageSuccessListener](#wpweixinshareappmessagesuccesslistener)\n\t\t\t* [wpWeixinShareAppMessageFailureListener](#wpweixinshareappmessagefailurelistener)\n\n\n## General Description\n\nWP Weixin provides integration between WordPress and WeChat. Register or authenticate users automatically in WeChat browser, use WeChat to create an account or authenticate on computers by scanning a QR code with WeChat, share posts in WeChat Moments and conversations or extend the plugin for more features!\n\n### Companion Plugins\n\n* [Woo WeChatPay](https://wordpress.org/plugins/woo-wechatpay): a payment gateway for WooCommerce.\n* [WP Weixin Pay](https://wordpress.org/plugins/wp-weixin-pay): an extension to enable money transfers to an Official Account.\n\nDevelopers are encouraged to build plugins and themes integrated with WeChat with WP Weixin as a core, leveraging its publicly available [functions](#functions), [actions](#actions) and [filters](#filters), or directly [make use of the provided SDK](#wechat-sdk).  \n\n*If you wish to see your plugin added to this list, please contact the author.*\n\n### Important Notes\n\n* Requires a [China Mainland WeChat Official Account](https://mp.weixin.qq.com) (Subscription or Service - Service is required if used with companion plugins dealing with payments).\n* A domain used by WordPress **must** be registered in an Official Account's backend\n* The plugin itself does not require programming knowledge, and provides really useful functionalities out of the box. Where it really shines though is when used by developers to extend its functionalities (mainly through the pre-initialised JS SDK, the WeChat Responder, and various provided [functions](#functions), [actions](#actions) and [filters](#filters)).\n\n### Registering a domain in the Official Account's backend\n\nTo register a domain and authorize communication between it and the WeChat APIs (frontend JS and server side), the domain **must** be linked with an ICP license first. Then, on [https://mp.weixin.qq.com](https://mp.weixin.qq.com):\n\n* connect to the Official Account's backend\n* click the \"Interface Privilege\" menu item\n* in the list, search for \"Web Page Authorization\" and click the \"Modify\" link\n* add the domain in both \"JS interface security domain name\" and \"Webpage authorization domain name\" by clicking the \"Set-up\" link for both sections (without the protocol `http` or `https`) - making sure to include the `MP_verify_[some_code].txt` files to the root of the website corresponding to the domain registered as instructed, accessible publicly.\n\n### Overview\n\nThis plugin adds the following major features to WordPress:\n\n* **WP Weixin settings page:** configure the plugin with an Official Account (or as many as you want in multisite) in English or Chinese out of the box, with instructions for each option.\n* **WeChat Authentication:** automatically create and authenticate users in WordPress in the WeChat browser, or allow users to scan a QR code with WeChat when using classic browsers (social login).\n* **WeChat Account Binding:** let users bind/unbind their existing WordPress account with their WeChat account. Integrated with WooCommerce and Ultimate Member account pages, and may be integrated with any membership/account/profile plugin easily.\n* **WeChat Share:** Share posts and pages on Moments or Send to chat, in a pretty way. Triggers JavaScript events for developers on success and failure.\n* **Force WeChat mobile:** to prevent users from browsing the website outside of the WeChat browser. If accessed with a classic browser, the page displays a QR code.\n* **Force following the Official Account:** to harvest WeChat followers, forcing users to follow the Official Account before accessing the content.\n* **WordPress Users screen override:** to display WeChat names and WeChat avatars if they exist, instead of the default values in the user screen.\n* **WP Weixin QR code generator:** to create custom codes.\n* **Menu integration:** allows to set the Official Account menus in WordPress when the WeChat Responder is enabled.\n* **Welcome message:** sends a welcome message in WeChat when a user follows the Official Account ; allows to do so with WordPress when the WeChat Responder is enabled.\n* **Developers - WeChat Responder:** for developers to receive and respond to calls made by WeChat's API.\n* **Developers - WeChat JS_SDK:** the `wx` JavaScript global variable is pre-configured with a signed package to leverage the JavaScript SDK of WeChat in WordPress themes more easily.  \n\nCompatible with [WooCommerce](https://wordpress.org/plugins/woocommerce/), [WooCommerce Multilingual](https://wordpress.org/plugins/woocommerce-multilingual/), [WPML](http://wpml.org/), [Ultimate Member](https://wordpress.org/plugins/ultimate-member/), [WordPress Multisite](https://codex.wordpress.org/Create_A_Network), and [many caching plugins](#object-cache-considerations).\n\n### Object Cache considerations\n\nThis plugin uses WordPress `WP_Object_Cache` to optimise the number of database queries, ensuring only the proper amount is fired on each page load. Because the `WP_Object_Cache` object can be affected by third-party plugins, it is required that such plugins implement the `wp_cache_add_non_persistent_groups` function to avoid side effects.  \n\nSee below examples of popular cache plugins compatible with WP Weixin:\n\n* [W3 Total Cache](http://wordpress.org/extend/plugins/w3-total-cache/)\n* [APC Object Cache](https://github.com/l3rady/WordPress-APC-Object-Cache) / [APCu Object Cache](https://github.com/l3rady/WordPress-APCu-Object-Cache)\n* [Redis Object Cache](https://github.com/ericmann/Redis-Object-Cache) \n\n## Settings\n\nThe following settings are available on the WP Weixin settings page.\n\n### Main Settings\n\nRequired settings below are the **minimal configuration** necessary for the plugin to have any effect.  \n\nName                                | Required | Type      | Description                                                                                                                  \n----------------------------------- |:--------:|:---------:| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\nEnable                              | **Yes**  | checkbox  | Enable WP Weixin - requires a valid configuration.                                                                                                                                         \nWeChat App ID                       | **Yes**  | text      | The AppId in the backend at `https://mp.weixin.qq.com/` under Development \u003e Basic configuration.                                                                                           \nWeChat App Secret                   | **Yes**  | text      | The AppSecret in the backend at `https://mp.weixin.qq.com/` under Development \u003e Basic configuration.                                                                                       \nWeChat OA Name                      | No       | text      | The name of the Official Account (recommended to enter the actual name).                                                                                                                   \nWeChat OA Logo URL                  | No       | text      | A URL to the logo of the Official Account - (recommended enter the URL of a picture of the actual logo).                                                                                   \nEnable WeChat authentication        | No       | checkbox  | If enabled, users will be authenticated with their WeChat account in WordPress when visiting the site with the WeChat browser(if not, a session cookie with key `'wx_openId-' . apply_filters( 'wp_weixin_ms_auth_blog_id', 1 )` is set).\nForce WeChat mobile                 | No       | checkbox  | Make the website accessible only through the WeChat browser.\u003cbr\u003eIf accessed with another browser, the page displays a QR code.                                                             \nForce follow (any page)             | No       | checkbox  | Require the user to follow the Official Account before accessing the site with the WeChat browser.                                                                                         \n\n### Multisite Settings\n\nThese settings are hidden by default and only available when:\n- WordPress Multisite is installed\n- The current user has the `manage_network_options` capability\n\nThey affect the entire multisite network.  \n\nName                             | Type   | Description                                                                                                                  \n-------------------------------- |:------:| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\nForce a blog for authentication  | select | Replaced by an info text if a callback is hooked to [wp_weixin_ms_auth_blog_id](#wp_weixin_ms_auth_blog_id).\u003cbr/\u003eBlog to use as proxy when authenticating users.                                                                                                                                                                                                                                                                                                                                                          \nForce a blog for WeChat payments | select | Replaced by an info text if a callback is hooked to [wp_weixin_ms_pay_blog_id](#wp_weixin_ms_pay_blog_id).\u003cbr/\u003eRemains hidden if \"Use merchant platform\" option is not checked (needs WeChat payment integrated in a companion plugin).\u003cbr/\u003eBlog to use as proxy when processing payments. If default, the JSAPI Payment Authorization URLs must be entered for all the blogs of the network doing payments, and the QR Payment callback URL must be capable of handling all the notifications coming from WeChat Pay API.\n\n### WeChat Responder Settings\n\nName                      | Type      | Description                                                                                                                                                                                                                                                                            \n------------------------- |:---------:| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\nUse WeChat Responder      | checkbox  | Allow the website to receive messages from WeChat and respond to them. Server configuration must be enabled and configured in `https://mp.weixin.qq.com/` under Development \u003e Basic configuration. Required if using \"Force follow\" option in the Main Settings or WeChat Pay settings.                                                                                                                                                                                                                                                                                                                 \nWeChat Token              | text      | The Token in the backend at `https://mp.weixin.qq.com/` under Development \u003e Basic configuration.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         \nEncode messages           | checkbox  | Encode the communication between the website and the WeChat API (recommended).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           \nWeChat AES Key            | text      | The EncodingAESKey in the backend at `https://mp.weixin.qq.com/` under\u003cbr/\u003e Development \u003e Basic configuration.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           \nSend welcome message      | checkbox  | Send a welcome message when a user follows the Official Account.\u003cbr/\u003eThe following filters can be used to change the default values of the message:\u003cul\u003e\u003cli\u003e[wp_weixin_follower_welcome_title](#wp_weixin_follower_welcome_title)\u003c/li\u003e\u003cli\u003e[wp_weixin_follower_welcome_description](#wp_weixin_follower_welcome_description)\u003c/li\u003e\u003cli\u003e[wp_weixin_follower_welcome_url](#wp_weixin_follower_welcome_url)\u003c/li\u003e\u003cli\u003e[wp_weixin_follower_welcome_pic_url](#wp_weixin_follower_welcome_pic_url)\u003c/li\u003e\u003c/ul\u003e\nWelcome message image URL | text      | A URL to the image used for the welcome message sent after a user follows the Official Account (external or from the Media Library).\u003cbr\u003eDefault image is in `/wp-weixin/images/default-welcome.png`.                                                                                                                                                                                                                                                                                                                                                                                                    \n\n### WeChat Pay Settings\n\nThese settings are hidden by default and only available if a WeChat Pay integration plugin such as [WP Weixin Pay](https://wordpress.org/plugins/wp-weixin-pay) or [Woo WeChatPay](https://wordpress.org/plugins/woo-wechatpay) is installed and activated (this behavior may be altered using the [wp_weixin_show_settings_section](#wp_weixin_show_settings_section) filter).\n\nName                                | Type      | Description                                                                                                                                                                                                                                                                                                                                                                     \n----------------------------------- |:---------:|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\nUse merchant platform               | checkbox  | Allow users to send money to the Service Account with WeChat - an account at `https://pay.weixin.qq.com/` is necessary. This setting is not configurable (forced to checked and hidden) if Woo WeChatPay plugin is activated.                                                                                                                                                   \nWeChat Merchant App ID              | text      | The AppID in the backend at `https://pay.weixin.qq.com/` - can be different from the WeChat App ID as the WeChat Pay account may be linked to a different AppID. Leave empty to use the WeChat App ID.                                                                                                                                                                          \nWeChat Merchant ID                  | text      | The Merchant ID in the backend at `https://pay.weixin.qq.com/index.php/extend/pay_setting`.                                                                                                                                                                                                                                                                                     \nPEM certificate prefix              | text      | The prefix of the certificate files downloaded from `https://pay.weixin.qq.com/index.php/core/cert/api_cert`.\u003cbr/\u003eCertificate files default prefix is `apiclient` (for `apiclient_cert.pem` and `apiclient_key.pem` files).\u003cbr/\u003eRequired notably to handle refunds through WeChat Pay.                                                                                          \nPEM certificate files path          | text      | The absolute path to the containing folder of the certificate files downloaded from `https://pay.weixin.qq.com/index.php/core/cert/api_cert` on the current file system.\u003cbr/\u003eExample: `/home/user/wechat-certificates`.\u003cbr/\u003eMust have read permissions for the user running PHP, and located outside of the web root.\u003cbr/\u003eRequired notably to handle refunds through WeChat Pay.\n\nIn addition to these settings, the plugin provides onscreen help for what values to input for the different URLs in the merchant account's API configuration screen.\n\n### Proxy Settings\n\nName        | Type     | Description                              \n----------- |:--------:| -----------------------------------------\nUse a proxy | checkbox | Enable proxy.                            \nProxy Host  | text     | IP address or URI of the proxy host.     \nProxy Port  | text     | Port to use to connect to the proxy host.\n\nDepending on your server configuration, a proxy may be needed if WordPress is behind a firewall or within a company network.\n\n### Miscellaneous Settings\n\nName                                             | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    \n------------------------------------------------ |:--------:| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\nShow WeChat name and picture in Users list page | checkbox | Override the display of the WordPress account names and avatars.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          \nShow WeChat public info\t                         | checkbox | Show the WeChat public information on user profile pages. Integrates with WooCommece and Ultimate Member.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 \nShow WeChat Account binding link                 | checkbox | Show a link to bind or unbind a WordPress account with a WeChat account on user profile pages. Integrates with WooCommece and Ultimate Member.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            \nShow WeChat Account authentication link\t         | checkbox | Show a link to authenticate via QR code using a WeChat account on the WordPress login form.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               \nOfficial Account menu language awareness         | checkbox | Customise the menu of the Official Account depending on user's language. By default, the language of the menu corresponding to the website's default language is used.\u003cbr/\u003eThis setting is only available if WPML is activated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           \nUse custom persistence for access_token          | checkbox | Use a custom persistence method for the Official Account access_token and its expiry timestamp.\u003cbr/\u003e**Warning** - requires the implementation of:\u003cul\u003e\u003cli\u003e[wp_weixin_get_access_info](#wp_weixin_get_access_info)\u003c/li\u003e\u003cli\u003e[wp_weixin_save_access_info](#wp_weixin_save_access_info)\u003c/li\u003e\u003c/ul\u003eThe parameter `$access_info` is an array with the keys `token` and `expiry`.\u003cbr/\u003eAdd the hooks above in a `plugins_loaded` action with a priority of `5` or less.\u003cbr/\u003eUseful to avoid a race condition if the access_token information needs to be shared between multiple platforms.\u003cbr/\u003eWhen unchecked, access_token \u0026 expiry timestamp are stored in the WordPress options table in the database.\n\n## Multisite\n\nWP Weixin supports multisite installs of WordPress, wether using domain/subdomains or subdirectories. WP Weixin needs to be configured with the same settings and enabled on all the blogs where authentication is needed for a given Official Account.  \n\nWith WeChat mobile authentication enabled, users visiting one of the blogs are automatically registered to the network, and added to the visited blog with the blog's default user role.\nUsers are also automatically added to other blogs of the network upon visit when already registered on one of the blogs. This behavior can be changed with the [wp_weixin_ms_auto_add_to_blog](#wp_weixin_ms_auto_add_to_blog) filter, for example if some of the blogs should not accept pre-authenticated WeChat users.  \n\nWhen using a domain/subdomain-based network of blogs, the main blog's domain/subdomain is used for cross-domain authentication. The behavior can be changed with the setting \"Force a blog for authentication\" in the Multisite Settings section of the plugin's page.\n\nWeChat Pay integrated plugins can also support domain/subdomain-based network installs of WordPress Multisite by leveraging the functions, actions and filters provided by WP Weixin. The blog used for payment can be forced with the \"Force a blog for WeChat payments\"  in the Multisite Settings section of the plugin's page.  \n[WP Weixin Pay](https://wordpress.org/plugins/wp-weixin-pay) and [Woo WeChatPay](https://wordpress.org/plugins/woo-wechatpay) are examples of plugins integrated with WeChat Pay, working no matter the type of Multisite installation (subdirectory or domain/subdomain).\n\nUnlike some plugins (commercial, obfuscated, and with dubious security standards), WP Weixin does not and will not rely on a crossdomain script dumped at the root of WordPress, but prefers to leverage the WordPress actions and filters. \n\nIt is possible to use the plugin with multiple Official Accounts on the same network, as long as the developer leverages [wp_weixin_ms_auth_blog_id](#wp_weixin_ms_auth_blog_id) and [wp_weixin_ms_pay_blog_id](#wp_weixin_ms_pay_blog_id) filter hooks to account for the different possible scenarios (see a simple example plugin [here](https://gist.github.com/froger-me/c918d7f2c4f88eff1b330a50d8962f23)).\n\n## WeChat SDK\n\nOne of the most poweful tools provided by WP Weixin is its PHP Wechat Software Development Kit. To get an instance of the WeChat SDK, developers can use the following snippet:\n\n```php\n$wechat_sdk = wp_weixin_get_wechat();\n```\n\nThe returned value is an instance of `WP_Weixin_Wechat`, which is a wrapper class for `Wechat_SDK`: it ensures all settings and tokens are valid and initialised. Developers are discouraged from using the `Wechat_SDK` class directly.\n\n**All the public methods of `Wechat_SDK` are callable through the `WP_Weixin_Wechat` object and should be used only for advanced purposes. These are low level methods compared to the [provided functions](#functions): the latter should be used where possible, and developers should only use the SDK if no function achieving the intended result exists.**  \nFor the public methods available, please refer to the [source code of `Wechat_SDK`](https://github.com/froger-me/wp-weixin/blob/master/lib/wechat-sdk/wechat-sdk.php) directly.\n\nQuick, non-optimised example of advanced use - do something with the list of followers' openIDs, with error handling:\n```php\n$wechat      = wp_weixin_get_wechat();\n$next_openid = true;\n$result      = $wechat-\u003eusers();\n$error       = $wechat-\u003egetError();\n\n// Warning - will loop until WeChat stops providing results ; do not use in production \nwhile ( false !== $next_openid \u0026\u0026 ! $error ) {\n\n\tif ( is_array( $result ) ) {\n\t\t$next_openid = ( ! empty( $result['next_openid'] ) ) ? $result['next_openid'] : false;\n\n\t\t// Do something with the returned data\n\t\tdo_something( $result['data'] );\n\t} else {\n\t\t$next_openid = false;\n\t}\n\n\tif ( $next_openid ) {\n\t\t$result = $wechat-\u003eusers( $next_openid );\n\t\t$error  = $wechat-\u003egetError();\n\t}\n}\n\nif ( $error ) {\n\t// Handle the error with the array containing the error information\n\thandle_error( $error );\n}\n```\n\n## Functions\n\nThe functions listed below are made publicly available by the plugin for theme and plugin developers. Although the plugin's main classes can theoretically be instanciated without side effect if the `$hook_init` parameter is set to `false`, it is recommended to use only the following functions as there is no guarantee future updates won't introduce changes of behaviors.\n___\n\n#### wp_weixin_is_wechat\n\n```php\nwp_weixin_is_wechat();\n```\n\n**Description**  \nWether the visitor is using the WeChat browser.  \n\n**Return value**  \n\u003e (bool) Wether the vistor is using the WeChat browser.  \n___\n\n#### wp_weixin_ajax_safe\n\n```php\nwp_weixin_ajax_safe();\n```\n\n**Description**  \nCall this function in a WordPress ajax action. Allow interactions with WeChat API during an ajax request.  \n___\n\n#### wp_weixin_get_user_by_openid\n\n```php\nwp_weixin_get_user_by_openid( string $openid );\n```\n\n**Description**  \nGet a WordPress user by WeChat openID.  \n\n**Parameters**  \n`$openid`\n\u003e (string) A WeChat openID.\n\n**Return value**  \n\u003e (mixed) A `WP_User` if a WordPress user bound with a corresponding WeChat openID exists, `false` otherwise.  \n___\n\n#### wp_weixin_get_user_by_unionid\n\n```php\nwp_weixin_get_user_by_unionid( string $unionid, int $blog_id = false );\n```\n\n**Description**  \nGet a WordPress user by WeChat unionID, or a collection of WordPress users if several matches exist (possible only in the case of Multisite with multiple Official Accounts).  \n\n**Parameters**  \n`$unionid`\n\u003e (string) A WeChat unionID.\n\n**Return value**  \n\u003e (mixed) A `WP_User` object if a WordPress user with a corresponding WeChat unionID exists, an array of `WP_User` objects if several matches exist, `false` otherwise.  \n___\n\n#### wp_weixin_get_wechat\n\n```php\nwp_weixin_get_wechat();\n```\n\n**Description**  \nGet an instance of `WP_Weixin_Wechat` (wrapper object for `Wechat_SDK` - see [WeChat SDK](#wechat-sdk)).  \n\n**Return value**  \n\u003e (WP_Weixin_Wechat) An instance of the wrapper object for `Wechat_SDK`.  \n___\n\n#### wp_weixin_get_options\n\n```php\nwp_weixin_get_options();\n```\n\n**Description**  \nGet all the options used to configure the plugin.  \n\n**Return value**  \n\u003e (array) An associative array with all the options used to configure the plugin.  \n___\n\n#### wp_weixin_get_option\n\n```php\nwp_weixin_get_option( $key );\n```\n\n**Description**  \nGet a specific option value used to configure the plugin.  \n\n**Parameters**  \n`$key`\n\u003e (string) The option key.\n\n**Return value**  \n\u003e (mixed) A string, boolean, or integer if the option has a value, `null` otherwise.  \n___\n\n#### wp_weixin_wpml_switch_lang\n\n```php\nwp_weixin_wpml_switch_lang( $force = true );\n```\n\n**Description**  \nIf WPML is active and the current user's WeChat language is known, switch the language to the value provided by the user's WeChat account.  \nUses `SitePress::switch_lang( $code = null, $cookie_lang = false )` - it is up to the developer to get up to speed with WMPL code base and documentation.  \n\n**Parameters**  \n`$force`\n\u003e (bool) If set to `true`, will always switch the language ; if `false`, the language will be switched only if \"Browser language redirect\" is enabled in WPML - default `true`.\n\n**Return value**  \n\u003e (bool) Wether `SitePress::switch_lang( $code = null, $cookie_lang = false )` was called.  \n___\n\n#### wp_weixin_get_signed_package\n\n```php\nwp_weixin_get_signed_package();\n```\n\n**Description**  \nGet a WeChat signed package to use with the WeChat JSAPI.  \nNote: the JavaScript global variable `wx` is already properly signed and initialised with the complete `jsApiList` if the `wp-weixin-main-script` is already enqueued.  \nSee the [\"JavaScript\" section of the documentation](#javascript) for more details.\n\n**Return value**  \n\u003e (array) The signed package to pass to a script via `wp_localize_script( $handle, $object_name, $l10n )`.  \n___\n\n#### wp_weixin_get_user_wechat_info\n\n```php\nwp_weixin_get_user_wechat_info( int $user_id = false, bool $output = false );\n```\n**Description**  \nGet a user's WeChat information. Gets the current user's if the user ID is omitted.  \n\n**Parameters**  \n`$user_id`\n\u003e (int) The ID of the user - default `false`.\n\n`$output`\n\u003e (bool) Wheter to output the information (using the [wp-weixin-public-info](#wp-weixin-public-info) template) - default `false`.\n\n**Return value**  \n\u003e (mixed) An array of WeChat information if exists, `false` otherwise.  \n___\n\n#### wp_weixin_get_user_wechat_openid\n\n```php\nwp_weixin_get_user_wechat_openid( int $user_id = false );\n```\n**Description**  \nGet a user's WeChat openID. Gets the current user's if the user ID is omitted.  \n\n**Parameters**  \n`$user_id`\n\u003e (int) The ID of the user - default `false`.\n\n**Return value**  \n\u003e (mixed) A WeChat openID if exists, `false` otherwise.  \n___\n\n#### wp_weixin_get_auth_link\n\n```php\nwp_weixin_get_auth_link( bool $output = false, string $target = '', $class = '' );\n```\n**Description**  \nGet a link to the WeChat authentication page.  \nThis function has no effect in the WeChat browser.  \n\n**Parameters**  \n`$output`\n\u003e (bool) Wether to output the link.\n\n`$target`\n\u003e (string) The target of the link.\n\n`$target`\n\u003e (string) The CSS class of the link.\n\n**Return value**  \n\u003e (mixed) If `$output` is set to `true`, the link's markup - `false` otherwise. \n___\n\n#### wp_weixin_get_bind_link\n\n```php\nwp_weixin_get_bind_link( bool $output = false, string $target = '_blank' );\n```\n**Description**  \nGet a link to the WeChat account binding page.  \nThis function has no effect in the WeChat browser.  \n\n**Parameters**  \n`$output`\n\u003e (bool) Wether to output the link.\n\n`$target`\n\u003e (string) The target of the link.\n\n**Return value**  \n\u003e (mixed) If `$output` is set to `true`, the link's markup - `false` otherwise. \n___\n\n#### wp_weixin_unbind\n\n```php\nwp_weixin_unbind( int $user_id, string $open_id = '' );\n```\n**Description**  \nUnbind a WordPress user account previously bound with WeChat, effectively deleting all the recorded information related to the associated WeChat account.  \nNote: a WeChat-only WordPress user account is a WordPress account that was created automatically by WP Weixin when opening the website in WeChat browser (Username following the `wx-[openid]` pattern).  \nIf a `user_id` corresponding to a WeChat-only WordPress user account that may or may not have been previously bound is provided (Username following the `wx-[openid]` or `wx-bound-[openid]` pattern), the Username is updated with the `wx-unbound-[openid]` pattern.  \n\n**Parameters**  \n`$user_id`\n\u003e (int) The ID of the user.\n\n`$open_id`\n\u003e (string) The openID of the WeChat account - if left empty, set to the current user's recorded value.\n\n**Return value**  \n\u003e (bool) Wether the account was unbound.  \n___\n\n#### wp_weixin_bind\n\n```php\nwp_weixin_bind( int $user_id, string $openid );\n```\n**Description**  \nBind a WordPress user account with WeChat, effectively overwritting all the recorded information related to an associated WeChat account if exist.  \nNote: a WeChat-only WordPress user account is a WordPress account that was created automatically by WP Weixin when opening the website in WeChat browser (Username following the `wx-[openid]` pattern).  \nA WeChat-only WordPress user account with the provided `$openid` recorded must exist.  \nIf a value for `$user_id` corresponding to a WeChat-only WordPress user account that may or may not have been previously unbound is provided (Username following the `wx-[openid]` or `wx-unbound-[openid]` pattern), the Username is updated with the `wx-bound-[openid]` pattern.  \nA given openID cannot be used to bind WeChat with multiple WordPress user accounts.\n\n**Parameters**  \n`$user_id`\n\u003e (int) The ID of the user.\n\n`$open_id`\n\u003e (string) The openID corresponding to a WeChat-only WordPress user account.\n\n**Return value**  \n\u003e (bool) Wether the account was bound.  \n___\n\n#### wp_weixin_is_follower\n\n```php\nwp_weixin_is_follower( int $user_id );\n```\n**Description**  \nCheck whether the user with ID `$user_id` is a follower of the WeChat Official Account.\n\n**Parameters**  \n`$user_id`\n\u003e (int) The ID of the user.\n\n**Return value**  \n\u003e (bool) Wether the user follows the WeChat Official Account.\n___\n\n## Hooks - actions \u0026 filters\n\nWP Weixin gives developers the possibilty to customise its behavior with a series of custom actions and filters. \n\n### Actions\n\n#### wp_weixin_extensions\n\n```php\ndo_action( 'wp_weixin_extensions', mixed $wechat, mixed $wp_weixin_settings, mixed $wp_weixin, mixed $wp_weixin_auth, mixed $wp_weixin_responder, mixed $wp_weixin_menu );\n```\n\n**Description**  \nFired when WP Weixin is fully loaded and if \"Enabled\" is checked in WP Weixin Main Settings. Typically used to build plugins using WP Weixin as a core.  \nNote: it is recommended to use the [provided functions](#functions) where possible instead of the methods of this action's parameters, as there is no guarantee future updates won't introduce changes of behaviors.\n\n**Parameters**  \n`$wechat`\n\u003e (mixed) A `WP_Weixin_Wechat` object.\n\n`$wp_weixin_settings`\n\u003e (mixed) A `WP_Weixin_Settings` object.\n\n`$wp_weixin`\n\u003e (mixed) A `WP_Weixin` object.\n\n`$wp_weixin_auth`\n\u003e (mixed) A `WP_Weixin_Auth` object.\n\n`$wp_weixin_responder`\n\u003e (mixed) A `WP_Weixin_Responder` object if the WeChat Responder is enabled, `false` otherwise.\n\n`$wp_weixin_menu`\n\u003e (mixed) A `WP_Weixin_Menu` object if the WeChat Responder is enabled, `false` otherwise.  \n___\n\n#### wp_weixin_responder\n\n```php\ndo_action( 'wp_weixin_responder', array $request_data );\n```\n\n**Description**  \nFired after receiving a request from WeChat.  \n\n**Parameters**  \n`$request_data`\n\u003e (array) The data sent in the request from WeChat.  \n___\n\n#### wp_weixin_save_access_info\n\n```php\ndo_action( 'wp_weixin_save_access_info', array $access_info );\n```\n\n**Description**  \nFired after renewing the Official Account access_token if custom persistence is used. Used to save the access information - particularly useful to avoid a race condition if the access_token needs to be shared between multiple platforms.\n\n**Parameters**  \n`$access_info`\n\u003e (array) The access information in an associative array. Keys are `token` and `expiry`.  \n___\n\n#### wp_weixin_before_user_profile_wechat_info\n\n```php\ndo_action( 'wp_weixin_before_user_profile_wechat_info', mixed $wechat_info, mixed $user );\n```\n\n**Description**  \nFired before displaying WeChat public info on the user profile.\n\n**Parameters**  \n`$wechat_info`\n\u003e (mixed) An array of WeChat public info to display on the user profile if they exist, `false` otherwise.  \n\n`$user`\n\u003e (mixed) A `WP_User` object if the user exists, `false` otherwise.  \n___\n\n#### wp_weixin_after_user_profile_wechat_info\n\n```php\ndo_action( 'wp_weixin_after_user_profile_wechat_info', mixed $wechat_info, mixed $user );\n```\n\n**Description**  \nFired after displaying WeChat public info on the user profile.\n\n**Parameters**  \n`$wechat_info`\n\u003e (mixed) An array of WeChat public info displayed on the user profile, `false` otherwise.  \n\n`$user`\n\u003e (mixed) A `WP_User` object if the user exists, `false` otherwise.  \n___\n\n#### wp_weixin_before_bind_account\n\n````php\ndo_action( 'wp_weixin_before_bind_account', int $user_id, int $wechat_user_id, array $wechat_user_blog_ids, int $current_blog_id );\n````\n**Description**  \nFired before binding a WordPress user account with WeChat.  \n\n**Parameters**  \n`$user_id`\n\u003e (int) The user ID.  \n\n`$wechat_user_id`\n\u003e (int) ID of a WeChat-only WordPress user account (Username following the `wx-[openid]` pattern).  \n\n`$wechat_user_blog_ids`\n\u003e (array) List of blog IDs the WeChat-only WordPress user account belongs to.\n\n`$current_blog_id`\n\u003e (int) The blog ID of the current blog.  \n___\n\n#### wp_weixin_after_bind_account\n\n````php\ndo_action( 'wp_weixin_after_bind_account', bool $bound, int $user_id, int $wechat_user_id, array $wechat_user_blog_ids, int $current_blog_id );\n````\n**Description**  \nFired after binding a WordPress user account with WeChat.  \n\n**Parameters**  \n`$bound`\n\u003e (bool) Wether the WordPress user account was successfully bound with WeChat.\n\n`$user_id`\n\u003e (int) The user ID.  \n\n`$wechat_user_id`\n\u003e (int) ID of a WeChat-only WordPress user account (Username following the `wx-[openid]` pattern).  \n\n`$wechat_user_blog_ids`\n\u003e (array) List of blog IDs the WeChat-only WordPress user account belongs to.\n\n`$current_blog_id`\n\u003e (int) The blog ID of the current blog.  \n___\n\n#### wp_weixin_before_unbind_account\n\n````php\ndo_action( 'wp_weixin_before_unbind_account', int $user_id, string $openid );\n````\n**Description**  \nFire before unbinding a WordPress user account from WeChat.  \n\n**Parameters**  \n`$user_id`\n\u003e (int) The user ID.  \n\n`$openid`\n\u003e (string) The WeChat openID.  \n___\n\n#### wp_weixin_after_unbind_account\n\n````php\ndo_action( 'wp_weixin_after_unbind_account', bool $unbound, int $user_id, string $openid );\n````\n**Description**  \nFire after unbinding a WordPress user account from WeChat.  \n\n**Parameters**  \n`$unbound`\n\u003e (bool) Wether the WordPress user account was successfully unbound from WeChat.\n\n`$user_id`\n\u003e (int) The user ID.  \n\n`$openid`\n\u003e (string) The WeChat openID.  \n___\n\n#### wp_weixin_before_tabs_settings\n\n```php\ndo_action( 'wp_weixin_before_tabs_settings' );\n```\n\n**Description**\nFired before outputting the tabs of the WP Weixin page.\n\n___\n\n#### wp_weixin_before_main_tab_settings\n\n```php\ndo_action( 'wp_weixin_before_main_tab_settings' );\n```\n\n**Description**\nFired before outputting the main settings tab of the WP Weixin page.\n\n___\n\n#### wp_weixin_before_main_settings_inner\n\n```php\ndo_action( 'wp_weixin_before_main_settings_inner' );\n```\n\n**Description**\nFired before outputting the main settings content on the WP Weixin page.\n\n___\n\n#### wp_weixin_after_main_settings_inner\n\n```php\ndo_action( 'wp_weixin_after_main_settings_inner' );\n```\n\n**Description**\nFired after outputting the main settings content on the WP Weixin page.\n\n___\n\n#### wp_weixin_after_main_tab_settings\n\n```php\ndo_action( 'wp_weixin_after_main_tab_settings' );\n```\n\n**Description**\nFired after outputting the main settings tab of the WP Weixin page.\n\n___\n\n#### wp_weixin_before_qr_tab_settings\n\n```php\ndo_action( 'wp_weixin_before_qr_tab_settings' );\n```\n\n**Description**\nFired before outputting the QR code generator tab of the WP Weixin page.\n\n___\n\n#### wp_weixin_after_qr_tab_settings\n\n```php\ndo_action( 'wp_weixin_after_qr_tab_settings' );\n```\n\n**Description**\nFired after outputting the QR code generator tab of the WP Weixin page.\n\n___\n\n#### wp_weixin_after_tabs_settings\n\n```php\ndo_action( 'wp_weixin_after_tabs_settings' );\n```\n\n**Description**\nFired after outputting the tabs of the WP Weixin page.\n\n___\n\n#### wp_weixin_before_settings\n\n```php\ndo_action( 'wp_weixin_before_settings' );\n```\n\n**Description**\nFired before outputting the settings on the WP Weixin page.\n\n___\n\n#### wp_weixin_before_main_settings\n\n```php\ndo_action( 'wp_weixin_before_main_settings' );\n```\n\n**Description**\nFired before outputting the main settings box on the WP Weixin page.\n\n___\n\n#### wp_weixin_after_main_settings\n\n```php\ndo_action( 'wp_weixin_after_main_settings' );\n```\n\n**Description**\nFired after outputting the main settings box on the WP Weixin page.\n\n___\n\n#### wp_weixin_before_qr_settings\n\n```php\ndo_action( 'wp_weixin_before_qr_settings' );\n```\n\n**Description**\nFired before outputting the QR code generator on the WP Weixin page.\n\n___\n\n#### wp_weixin_before_qr_settings_inner\n\n```php\ndo_action( 'wp_weixin_before_qr_settings_inner' );\n```\n\n**Description**\nFired before outputting the QR code generator box on the WP Weixin page.\n\n___\n\n#### wp_weixin_after_qr_settings_inner\n\n```php\ndo_action( 'wp_weixin_after_qr_settings_inner' );\n```\n\n**Description**\nFired after outputting the QR code generator box on the WP Weixin page.\n\n___\n\n#### wp_weixin_after_qr_settings\n\n```php\ndo_action( 'wp_weixin_after_qr_settings' );\n```\n\n**Description**\nFired after outputting the QR code generator on the WP Weixin page.\n\n___\n\n#### wp_weixin_after_settings\n\n```php\ndo_action( 'wp_weixin_after_settings' );\n```\n\n**Description**\nFired after outputting the settings on the WP Weixin page.\n\n___\n\n#### wp_weixin_endpoints\n\n```php\ndo_action( 'wp_weixin_endpoints' );\n```\n**Description**  \nFired when adding WP Weixin rewrite rules. Useful for companion plugins to add their own, and make sure they are registered properly (rules are flushed when WP Weixin settings are saved).\n\n___\n\n#### wp_weixin_handle_payment_notification\n\n```php\ndo_action( 'wp_weixin_handle_payment_notification' );\n```\n\n**Description**  \nFired when handling a WeChat Pay transaction notification.\n\nFired last  by WP Weixin (`PHP_INT_MIN`) ; should be fired earlier by companion plugins integrating with WeChat Pay.  \nSee a [WeChat Pay integration plugin skeleton](https://gist.github.com/froger-me/2c66a842ef8900b017809d7c738130c9) for how to handle WeChat Pay notifications.  \n\n___\n\n#### wp_weixin_handle_auto_refund\n\n```php\ndo_action( 'wp_weixin_handle_auto_refund', mixed $refund_result, array $payment_result );\n```\n\n**Description**  \nFired after an automatic refund for a failed transaction has been attempted.\n\nSee a [WeChat Pay integration plugin skeleton](https://gist.github.com/froger-me/2c66a842ef8900b017809d7c738130c9) for how to handle WP Weixin automatic refund results.  \n\n**Parameters**  \n`$refund_result`\n\u003e (mixed) An array containing the WeChat Pay API's response in case the refund wass successful, `false` otherwise.  \n\n`$payment_result`\n\u003e (array) A payment notification result. Structure of a result:\n```php\narray(\n\t'success'      =\u003e false,    // optional - (bool) wether the transaction to handle was found ; default false\n\t'data'         =\u003e $data,    // required - (array) return value of WP_Weixin_Wechat::getNotify()\n\t'refund'       =\u003e false,    // optional - (mixed) false if no refund needed, true or an refund message for the user otherwise ; default false\n\t'notify_error' =\u003e false,    // optional - (mixed) false if no error, true or an error message otherwise ; if truthy and pay_handler set to true, WeChat Pay API will continue to send notifications for the transaction ; default false\n\t'blog_id'      =\u003e $blog_id, // required for multisite, optional otherwise - (int) the ID of the blog where the original transaction was made ; default the return value of get_current_blog_id()\n\t'pay_handler'  =\u003e false,    // optional - (bool) wether the result is for the callback registered in the WeChat Pay backend ; default false\n\t/* More custom items can safely be added to the array */\n);\n```  \n___\n\n### Filters\n\n#### wp_weixin_browser_page_qr_src\n\n```php\napply_filters( 'wp_weixin_browser_page_qr_src', string $src );\n```\n\n**Description**  \nFilter the source of the QR code to show on classic browsers for a page only accessible through WeChat browser.  \n\n**Parameters**  \n`$src`\n\u003e (string) The source of the QR code to show on classic browsers.  \n___\n\n#### wp_weixin_subscribe_src\n\n```php\napply_filters( 'wp_weixin_subscribe_src', string $src );\n```\n\n**Description**  \nFilter the source of the QR code used to follow the Official Account.  \n\n**Parameters**  \n`$src`\n\u003e (string) The source of the QR code.  \n___\n\n#### wp_weixin_follower_notice_title\n\n```php\napply_filters( 'wp_weixin_follower_notice_title', string $title );\n```\n\n**Description**  \nFilter the title of the page displaying the QR code to follow the Official Account.  \n\n**Parameters**  \n`$title`\n\u003e (string) The title of the page - default \"Follow Us!\".  \n___\n\n#### wp_weixin_follower_notice\n\n```php\napply_filters( 'wp_weixin_follower_notice', string $notice );\n```\n\n**Description**  \nFilter the message displayed on the page displaying the QR code to follow the Official Account.  \n\n**Parameters**  \n`$notice`\n\u003e (string) The displayed message - default \"Please scan this QR Code to follow us before accessing this content.\".  \n___\n\n#### wp_weixin_auth_needed\n\n```php\napply_filters( 'wp_weixin_auth_needed', bool $needs_auth );\n```\n\n**Description**  \nWether the URL needs the user to be authenticated using WeChat. When \"Enable WeChat authentication\" is checked in the settings, URLs triggering WordPress's `init` action hook need authentication by default, unless they are whitelisted using this filter. By default, all the admin pages, the WP Weixin classic browser authentication page, the WordPress ajax endpoint, the WeChat responder endpoint, and the WooCommerce API endpoints are whitelisted and accessible outside WeChat.  \n\n**Parameters**  \n`$needs_auth`\n\u003e (bool) Wether authentication is needed to visit the URL.  \n___\n\n#### wp_weixin_debug\n\n```php\napply_filters( 'wp_weixin_debug', bool $debug );\n```\n\n**Description**  \nFilter wether to activate debug mode (PHP error logs, JavaScript console messages, JavaScript alerts).  \n\n**Parameters**  \n`$debug`\n\u003e (bool) Wether debug mode is activated - default `WP_DEBUG` constant value.  \n___\n\n#### wp_weixin_follower_welcome_title\n\n```php\napply_filters( 'wp_weixin_follower_welcome_title', string $title, mixed $before_subscription );\n```\n\n**Description**  \nFilter the title of the message the user receives when following the Official Account.  \n\n**Parameters**  \n`$title`\n\u003e (string) The title - default \"'Welcome `user_name`!'\" where `user_name` is the user's WeChat Name.  \n\n`$before_subscription`\n\u003e (mixed) If numeric, the `WP_Post` ID of the last page the user was visiting ; if string, the URL of the last page the user was visiting - default `home_url()`.  \n___\n\n#### wp_weixin_follower_welcome_description\n\n```php\napply_filters( 'wp_weixin_follower_welcome_description', string $description, mixed $before_subscription );\n```\n\n**Description**  \nFilter the description of the message the user receives when following the Official Account.  \n\n**Parameters**  \n`$description`\n\u003e (string) The description - default \"Thank you for subscribing our official account!\".  \n\n`$before_subscription`\n\u003e (mixed) If numeric, the `WP_Post` ID of the last page the user was visiting ; if string, the URL of the last page the user was visiting - default `home_url()`.  \n___\n\n#### wp_weixin_follower_welcome_url\n\n```php\napply_filters( 'wp_weixin_follower_welcome_url', string $url, mixed $before_subscription );\n```\n\n**Description**  \nFilter the URL the user will be redirected to when interacting with the message received when following the Official Account.  \n\n**Parameters**  \n`$url`\n\u003e (string) The URL the user will be redirected to - default `home_url()` if no URL was recorded before sending the templated message.  \n\n`$before_subscription`\n\u003e (mixed) If numeric, the `WP_Post` ID of the last page the user was visiting ; if string, the URL of the last page the user was visiting - default `home_url()`.  \n___\n\n#### wp_weixin_follower_welcome_pic_url\n\n```php\napply_filters( 'wp_weixin_follower_welcome_pic_url', string $pic_url, mixed $before_subscription );\n```\n\n**Description**  \nFilter the URL of the picture displayed on the message the user receives when following the Official Account.  \n\n**Parameters**  \n`$pic_url`\n\u003e (string) The URL of the picture - default `WP_PLUGIN_URL . '/wp-weixin/images/default-welcome.png'`.  \n\n`$before_subscription`\n\u003e (mixed) If numeric, the `WP_Post` ID of the last page the user was visiting ; if string, the URL of the last page the user was visiting - default `home_url()`.  \n___\n\n#### wp_weixin_get_access_info\n\n```php\napply_filters( 'wp_weixin_get_access_info', array $access_info );\n```\n\n**Description**  \nFilter the access token and token expiry when requesting the `WP_Weixin_WeChat` object (wrapper of a `Wechat_SDK` object) if custom persistence is used - particularly useful to avoid a race condition if the access token needs to be shared between multiple platforms.\n\n**Parameters**  \n`$access_info`\n\u003e (array) The access information in an associative array. Value types and keys: (string) `token`, (int) `expiry`.  \n___\n\n#### wp_weixin_jsapi_urls\n\n```php\napply_filters( 'wp_weixin_jsapi_urls', array $jsapi_urls );\n```\n\n**Description**  \nFilter the URLs necessary to register on the WeChat merchant account's API configuration screen - used when another plugin implements WeChat Pay integration.\n\n**Parameters**  \n`$jsapi_urls`\n\u003e (array) The URLs to register on the WeChat merchant account's API configuration screen.  \n___\n\n#### wp_weixin_pay_callback_endpoint\n\n```php\napply_filters( 'wp_weixin_pay_callback_endpoint', string $endpoint );\n```\n\n**Description**  \nFilter the endpoint of the QR Payment URL necessary to register on the WeChat merchant account's API configuration screen - used when implementing WeChat Pay integration.\n\n**Parameters**  \n`$callback_url`\n\u003e (string) The endpoint of the QR Payment URL to register on the WeChat merchant account's API configuration screen (example: `/my_plugin/notify`).  \n___\n\n#### wp_weixin_settings\n\n```php\napply_filter( 'wp_weixin_settings', $settings );\n```\n\n**Description**  \nFilter the settings used to configure the plugin.\nHooked functions or methods need to be added to this filter in a `plugins_loaded` action hook of priority of `5` or less.\n\n**Parameters**  \n`$settings`\n\u003e (array) The settings used to configure the plugin.  \n___\n\n#### wp_weixin_show_settings_section\n\n```php\napply_filters( 'wp_weixin_show_settings_section', bool $show_section, string $section_name, array $section );\n```\n\n**Description**  \nFilter wether to show a settings section on the WP Weixin settings page.\n\n**Parameters**  \n`$show_section`\n\u003e (bool) Wether to show the settings section on the WP Weixin settings page.  \n\n`$section_name`\n\u003e (string) The name of the settings section.  \n\n`$section`\n\u003e (array) The section's settings.  \n\n#### wp_weixin_show_setting\n\n```php\napply_filters( 'wp_weixin_show_setting', bool $show_setting, string $section_name, int $index, array $value );\n```\n\n**Description**  \nFilter wether to show a setting on the WP Weixin settings page.\n\n**Parameters**  \n`$show_setting`\n\u003e (bool) Wether to show the setting on the WP Weixin settings page.  \n\n`$section_name`\n\u003e (string) The name of the section the setting belongs to.  \n\n`$index`\n\u003e (int) The index of the setting in the section.  \n\n`$value`\n\u003e (array) The setting.  \n\n___\n\n#### wp_weixin_settings_fields\n\n```php\napply_filters( 'wp_weixin_settings_fields', array $settings_fields );\n```\n\n**Description**  \nFilter the settings fields displayed on the WP Weixin settings page.\n\n**Parameters**  \n`$include_section`\n\u003e (array) The settings fields displayed on the WP Weixin settings page.  \n___\n\n#### wp_weixin_auth_redirect\n\n```php\napply_filters( 'wp_weixin_auth_redirect', mixed $redirect, bool $auth, bool $has_error );\n```\n\n**Description**  \nFilter the URL to redirect to when QR code authentication in classic browsers is performed.\n\n**Parameters**  \n`$redirect`\n\u003e (mixed) The URL to redirect to when authentication is performed, or `false` if no redirect. Default is `home_url()` in case of successful authentication.  \n\n`$auth`\n\u003e (bool) Wether the authentication was a performed - `true` if successful, `false` if an error occurred.  \n\n`$has_error`\n\u003e (bool) Wether an error occurred.  \n___\n\n#### wp_weixin_scan_heartbeat_frequency\n\n```php\napply_filters( 'wp_weixin_scan_heartbeat_frequency', int $frequency );\n```\n\n**Description**  \nFilter the frequency of the checks when waiting for QR code scan confirmation in classic browsers.\n\n**Parameters**  \n`$frequency`\n\u003e (int) The frequency in milliseconds. Default `1000`.  \n___\n\n#### wp_weixin_qr_cleanup_frequency\n\n```php\napply_filters( 'wp_weixin_qr_cleanup_frequency', string $frequency );\n```\n\n**Description**  \nFilter the frequency to clean up expired QR code data.\n\n**Parameters**  \n`$frequency`\n\u003e (string) The frequency. Default `'hourly'`.  \n___\n\n#### wp_weixin_qr_lifetime\n\n```php\napply_filters( 'wp_weixin_qr_lifetime', int $lifetime );\n```\n\n**Description**  \nFilter the lifetime of a potentially sensitive QR code, such as WeChat authentication or WeChat account binding.\n\n**Parameters**  \n`$lifetime`\n\u003e (int) The lifetime in seconds. Default `600`.  \n___\n\n#### wp_weixin_user_wechat_info\n\n```php\napply_filters( 'wp_weixin_user_wechat_info', mixed $wechat_info, int $user_id );\n```\n\n**Description**  \nFilter the user WeChat information.\n\n**Parameters**  \n`$wechat_info`\n\u003e (mixed) An array of WeChat information if exist, `false` otherwise.  \n\n`$lifetime`\n\u003e (int) The user ID - default `0`.  \n___\n\n#### wp_weixin_ms_auto_add_to_blog\n\n```php\napply_filters( 'wp_weixin_ms_auto_add_to_blog', bool $auto_add_to_blog, int $blog_id, int $user_id );\n```\n\n**Description**  \nFilter wether to automatically add the user to the visited blog on the network when authenticated with WeChat.\n\n**Parameters**  \n`$auto_add_to_blog`\n\u003e (bool) Wether to automatically add the user to the visited blog on the network when authenticated with WeChat - default `true`.  \n\n`$blog_id`\n\u003e (int) The ID of the visited blog.  \n\n`$user_id`\n\u003e (int) The ID of the user visiting the blog.  \n___\n\n#### wp_weixin_ms_auth_blog_id\n\n```php\napply_filters( 'wp_weixin_ms_auth_blog_id', int $auth_blog_id );\n```\n\n**Description**  \nFilter the blog ID used for authentication - by default, it is assumed the domain name of the default blog is registered in WeChat backend.\n\n**Warning:** to make sure WP Weixin supports multiple Official Accounts, the openIDs of bound accounts are stored using a user meta record containing the value of `$auth_blog_id` in its meta key (`'wx_openid-' . $auth_blog_id`).  \nIf WeChat-bound WordPress users already exist (manually bound or automatically created when visiting the site with the WeChat browser), applying this filter and return an altered value of `$auth_blog_id` will break the relationship between the user and the recorded openID during runtime.  \nIt is up to the developer to update the database directly, or run a one-time use code snippet like below.\n\nExample of code snippet to run after changing the blog ID used for authentication in case WordPress users are already bound with WeChat: \n\n```php\nglobal $wpdb;\n\n$old_auth_blog_id = 1;\n$new_auth_blog_id = 2;\n\n$wpdb-\u003equery(\n\t$wpdb-\u003eprepare(\n\t\t\"UPDATE $wpdb-\u003eusermeta SET `meta_key` = 'wx_openid-%d' WHERE `meta_key` = 'wx_openid-%d';\",\n\t\t$new_auth_blog_id,\n\t\t$old_auth_blog_id\n\t)\n);\n```\n\n**Parameters**  \n`$auth_blog_id`\n\u003e (int) The ID of the blog to use when doing WeChat authentication. Default `1`.  \n___\n\n#### wp_weixin_ms_pay_blog_id\n\n```php\napply_filters( 'wp_weixin_ms_pay_blog_id', int $pay_blog_id );\n```\n\n**Description**  \nFilter the blog ID used to build the URLs allowed to call and receive payment notifications from the WeChat Pay API - by default, it is assumed the domain ( or subdomain ) corresponding to the ID of the the current blog is registered in WeChat backend. Useful in case several instances of WooCommerce are running on the same network, or in the case of a network connected to several Official Accounts.\n\n**Parameters**  \n`$pay_blog_id`\n\u003e (int) The ID of the blog used to build the QR Payment callback URL. Default `get_current_blog_id()`.  \n___\n\n#### wp_weixin_locate_template_paths\n\n```php\napply_filters( 'wp_weixin_locate_template_paths', array $paths, string $plugin_name );\n```\n\n**Description**  \nFilter the possible paths of templates included by WP Weixin and companion plugins.\n\n**Parameters**  \n`$paths`\n\u003e (array) The possible paths. Default (where `$template_name` is the template's file name):\n\u003e ```php\n\u003e array(\n\u003e \t'plugins/wp-weixin/' . $plugin_name . $template_name,\n\u003e \t'wp-weixin/' . $plugin_name . $template_name,\n\u003e \t'plugins/' . $plugin_name . $template_name,\n\u003e \t$plugin_name . $template_name,\n\u003e \t'wp-weixin/' . $template_name,\n\u003e \t$template_name,\n\u003e );\n\u003e ```\n\n`$plugin_name`\n\u003e (string) The name of the plugin the template belongs to.\n\n___\n#### wp_weixin_get_user_by_openid\n\n```php\napply_filters( 'wp_weixin_get_user_by_openid', $user, $openid );\n```\n\n**Description**  \nFilter the result of a query getting a WordPress user associated with a recorded WeChat openID.\n\n**Parameters**  \n`$user`\n\u003e (mixed) The `WP_User` object if the user was found, `false` otherwise.\n\n`$openid`\n\u003e (string) The openID used to search for the user\n___\n\n#### wp_weixin_pay_notify_results\n\n```php\napply_filters( 'wp_weixin_pay_notify_results', (array) $results );\n```\n**Description**  \nFilter the results of handling a payment notification.\n\nNot actually applied by WP Weixin directly itself, but only after a companion plugin has fired [wp_weixin_handle_payment_notification](#wp_weixin_handle_payment_notification).  \nSee a [WeChat Pay integration plugin skeleton](https://gist.github.com/froger-me/2c66a842ef8900b017809d7c738130c9) for how to add payment notification results.  \n\n**Parameters**  \n`$results`\n\u003e (array) An array of payment notification results. Structure of a result:\n```php\narray(\n\t'success'      =\u003e false,    // optional - (bool) wether the transaction to handle was found ; default false\n\t'data'         =\u003e $data,    // required - (array) return value of WP_Weixin_Wechat::getNotify()\n\t'refund'       =\u003e false,    // optional - (mixed) false if no refund needed, true or an refund message for the user otherwise ; default false\n\t'notify_error' =\u003e false,    // optional - (mixed) false if no error, true or an error message otherwise ; if truthy and pay_handler set to true, WeChat Pay API will continue to send notifications for the transaction ; default false\n\t'blog_id'      =\u003e $blog_id, // required for multisite, optional otherwise - (int) the ID of the blog where the original transaction was made ; default the return value of get_current_blog_id()\n\t'pay_handler'  =\u003e false,    // optional - (bool) wether the result is for the callback registered in the WeChat Pay backend ; default false\n\t/* More custom items can safely be added to the array */\n);\n```\n___\n\n#### wp_weixin_ecommerce_description\n\n```php\napply_filters( 'wp_weixin_ecommerce_description', $ecommerce_description );\n```\n\n**Description**  \nFilter the description of the WeChat Pay Settings.\n\n**Parameters**  \n`$ecommerce_description`\n\u003e (string) The description of the WeChat Pay Settings (HTML).\n___\n\n#### wp_weixin_subscribe_qr_url\n\n```php\napply_filters( 'wp_weixin_subscribe_qr_url', $wp_weixin_subscribe_qr_url );\n```\n\n**Description**  \nFilter the url for the WeChat Official Account subscription QR code.\n\n**Parameters**  \n`$wp_weixin_subscribe_qr_url`\n\u003e (string) The url for the WeChat Official Account subscription QR code.\n\n___\n\n#### wp_weixin_metabox_post_types\n\n```php\napply_filters( 'wp_weixin_metabox_post_types', $post_types );\n```\n\n**Description**\nFilter the post types to display the WP Weixin metabox.\n\n**Parameters**\n`$post_types`\n\u003e (array) The post types to display the WP Weixin metabox.\n\n___\n\n## Templates\n\nThe following template files are selected using the `locate_template()` and included with `load_template()` functions provided by WordPress. This means they can be overloaded in the active WordPress theme. Developers may place their custom template files in the following directories under the theme's folder (in order of selection priority):\n\n* `plugins/wp-weixin/`\n* `wp-weixin/`\n* `plugins/`\n* at the root of the theme's folder\n\nThe available paths of the templates may be customised with the [wp_weixin_locate_template_paths](#wp_weixin_locate_template_paths) filter. \nThe style applied to all the templates below is enqueued as `'wp-weixin-main-style'`.  \n\n___\n\n#### wp-weixin-subscribe\n\n```\nwp-weixin-subscribe.php\n```\n\n**Description**  \nThe template of the page displaying the QR code to follow the Official Account. Used when \"Force follow\" is enabled in the settings.\n\n`$title`\n\u003e (string) The title of the screen presented to the user.\n\n`$message`\n\u003e (string) The message describing why the user sees this screen.\n\n`$qr_src `\n\u003e (string) The source of the QR code image.\n\n___\n\n#### wp-weixin-browser-qr\n\n```\nwp-weixin-browser-qr.php\n```\n\n**Description**  \nThe template of the page displaying the QR code when the website is accessible only through the WeChat browser.  \n\n**Variables**  \n`$page_qr_src`\n\u003e (string) The source of the QR code image.  \n___\n\n#### wp-weixin-auth-form-link\n\n```\nwp-weixin-auth-form-link.php\n```\n\n**Description**  \nThe template of the WeChat authentication link.  \n\n**Variables**  \n`$class`\n\u003e (string) The class attribute of the link.\n\n`$target`\n\u003e (string) The target attribute of the link.  \n___\n\n#### wp-weixin-auth-page\n\n```\nwp-weixin-auth-page.php\n```\n\n**Description**  \nThe template of the WeChat screen displayed for QR code authentication in classic browsers. \n___\n\n#### wp-weixin-mobile-auth-check\n\n```\nwp-weixin-mobile-auth-check.php\n```\n\n**Description**  \nThe template of the WeChat mobile browser screen displayed when authenticating via QR code authentication in classic browsers.  \n\n**Variables**  \n`$auth_qr_data`\n\u003e (array) Data related to the authentication. Value types and keys: (bool) `auth`, (int) `user_id`, (array) `error`, (bool|string) `redirect`. The `redirect` value is not actually used for redirection by default on mobile (used after authentication on desktop).  \n___\n\n#### wp-weixin-bind-form-link\n\n```\nwp-weixin-bind-form-link.php\n```\n\n**Description**  \nThe template of the WeChat account binding link.  \n\n**Variables**  \n`$link_text`\n\u003e (string) The text of the link.\n\n`$wechat_info`\n\u003e (mixed) An array of WeChat information if exists, `false` otherwise.\n\n`$class`\n\u003e (string) The class attribute of the link.\n\n`$target`\n\u003e (string) The target attribute of the link.  \n___\n\n#### wp-weixin-bind-page\n\n```\nwp-weixin-bind-page.php\n```\n\n**Description**  \nThe template of the WeChat screen displayed for WeChat account bindind in classic browsers.  \n\n**Variables**  \n`$user_id`\n\u003e (int) The ID of the user to bind to a WeChat account.\n\n`$wechat_info`\n\u003e (mixed) An array of WeChat information if exists, `false` otherwise.  \n___\n\n#### wp-weixin-mobile-bind-check\n\n```\nwp-weixin-mobile-bind-check.php\n```\n\n**Description**  \nThe template of the WeChat mobile browser screen displayed when attempting to a WeChat account via QR code in classic browsers.  \n\n**Variables**  \n`$bind_qr_data`\n\u003e (array) Data related to the account binding. Value types and keys: (bool) `bind`, (int) `user_id`, (array) `error`, (bool|string) `redirect`. The `redirect` value is always `false` on mobile (populated and used after account binding on desktop).  \n___\n\n#### wp-weixin-public-info\n\n```\nwp-weixin-public-info.php\n```\n**Description**  \nThe template to output the WeChat public information - notably used when calling [wp_weixin_get_user_wechat_info](#wp_weixin_get_user_wechat_info) with the `$output` parameter set to `false`.\n\n**Variables**  \n`$wechat_info`\n\u003e (array) The WeChat public information. Value are all of type (string), with keys: `nickname`, `headimgurl`, `sex`, `language`, `city`, `province`, `country`, `unionid`.  \n___\n\n#### wp-weixin-account-form-password-notice\n\n```\nwp-weixin-account-form-password-notice.php\n```\n**Description**  \nThe template of the notice to show under the form to change the user account password.  \n___\n\n## JavaScript\n\nThe global variable `wx` is already properly signed and initialised with the complete `jsApiList`.  \nTo use it properly, developers must:\n- include their scripts in `wp_enqueue_scripts` action hook with a priority of `6` or more,\n- make sure to set `wp-weixin-main-script` as a dependency\n- make sure \"Enabled\" is checked in WP Weixin Main Settings\n\nIn addition, a provided list of listeners may be subscribed to.  \n\nExample for how to subscribe to the `wpWeixinShareTimelineSuccessListener` listener:\n\n```JavaScript\nwindow.wpWeixinShareTimelineSuccessListener( handleShareTimelineSuccess );\n\nfunction handleShareTimelineSuccess( shareInfo ) {\n\t// do something with the data\n\tdo_something( shareInfo );\n}\n\n```\n___\n\n#### wpWeixinShareTimelineSuccessListener\n\n```JavaScript\nwindow.wpWeixinShareTimelineSuccessListener( callback );\n```\n\nSubscribing to this listener will execute the `callback` function after sharing the post on WeChat Moments succeeded.  \n\n**Parameters passed to the callback**  \nshareInfo\n\u003e (object) The share information sent to the WeChat JS_SDK. Attributes are `title`, `desc`, `link`, `imgUrl`.  \n___\n\n#### wpWeixinShareTimelineFailureListener\n\n```JavaScript\nwindow.wpWeixinShareTimelineFailureListener( callback );\n```\n\nSubscribing to this listener will execute the `callback` function after sharing the post on WeChat Moments failed.  \n\n**Parameters passed to the callback**  \nshareInfo\n\u003e (object) The share information sent to the WeChat JS_SDK. Attributes are `title`, `desc`, `link`, `imgUrl`.  \n___\n\n#### wpWeixinShareAppMessageSuccessListener\n\n```JavaScript\nwindow.wpWeixinShareAppMessageSuccessListener( callback );\n```\n\nSubscribing to this listener will execute the `callback` function after sharing the post with WeChat \"Send to chat\" succeeded.  \n\n**Parameters passed to the callback**  \nshareInfo\n\u003e (object) The share information sent to the WeChat JS_SDK. Attributes are `title`, `desc`, `link`, `imgUrl`.  \n___\n\n#### wpWeixinShareAppMessageFailureListener\n\n```JavaScript\nwindow.wpWeixinShareAppMessageFailureListener( callback );\n```\n\nSubscribing to this listener will execute the `callback` function after sharing the post with WeChat \"Send to chat\" failed.  \n\n**Parameters passed to the callback**  \nshareInfo\n\u003e (object) The share information sent to the WeChat JS_SDK. Attributes are `title`, `desc`, `link`, `imgUrl`.  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffroger-me%2Fwp-weixin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffroger-me%2Fwp-weixin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffroger-me%2Fwp-weixin/lists"}