Shortcodes
Drop wallet UI on any page or post.
Quick Reference
| Shortcode | Renders |
|---|---|
[wkwp_wallet_balance] | Live balance pill for logged-in user |
[wkwp_wallet_recharge] | Top-up form (preset chips + custom amount) |
[wkwp_wallet_transfer] | Send-money form with OTP |
[wkwp_wallet_history] | Recent activity list |
[wkwp_kyc_form] | KYC submission form |
[wkwp_wallet_coupon_redeem] | Redeem-code form |
[wkwp_invite_friends_form] | Email invite form |
[wkwp_referral_link] | Personal referral link + Copy button |
[wkwp_qr_receive] | QR code to receive wallet |
[wkwp_qr_scan_pay] | Scanner UI for QR pay |
All shortcodes need a logged-in customer unless noted.
[wkwp_wallet_balance]
Renders the customer's current wallet balance.
[wkwp_wallet_balance show_currency="yes" hide_zero="no" class="my-wallet-pill"]
| Attribute | Default | Notes |
|---|---|---|
show_currency | yes | prefix currency symbol |
hide_zero | no | hide entirely when balance = 0 |
class | empty | extra CSS class on the wrapper |
link_to | /my-account/my_wallet/ | URL the pill links to (none to disable) |
Header / footer placement
Drop it in your menu via WordPress menu items (custom HTML) or add it to a header widget area.
[wkwp_wallet_recharge]
Recharge form — same as the Add money panel but standalone.
[wkwp_wallet_recharge presets="100,500,1000,2500" min="50" max="10000" allow_custom="yes"]
| Attribute | Default | Notes |
|---|---|---|
presets | from settings | comma list of chip amounts |
min | from settings | min top-up |
max | from settings | max per order |
allow_custom | yes | enable custom amount input |
bonus_preview | yes | live "Pay X get Y" hint |
redirect | empty | URL after submit |
Posts to standard WC add-to-cart with the recharge product.
[wkwp_wallet_transfer]
Send-money form. OTP-protected.
[wkwp_wallet_transfer fee_visible="yes" notes_field="yes"]
| Attribute | Default | Notes |
|---|---|---|
fee_visible | yes | show transfer fee row |
notes_field | yes | optional message input |
recipient_lookup | email_username | email / username / email_username |
Both sender and recipient must be registered. Sender needs balance ≥ amount + fee. Sender must be KYC-approved if transfer is in _wkwp_wallet_kyc_required_features. See Wallet Transfer.
[wkwp_wallet_history]
Recent ledger rows for the logged-in user.
[wkwp_wallet_history limit="20" types="credit,debit,refund,cashback,transfer" show_filter="yes"]
| Attribute | Default | Notes |
|---|---|---|
limit | 20 | rows per page |
types | all | comma list to filter |
show_filter | yes | render the filter bar |
pagination | yes | Prev / Next |
date_format | WP setting | strftime format |
Renders iconised rows matching the My Wallet page style.
[wkwp_kyc_form]
Standalone KYC submission form.
[wkwp_kyc_form max_documents="3" allowed_types="image/jpeg,image/png,application/pdf"]
| Attribute | Default | Notes |
|---|---|---|
max_documents | from settings (1-5) | per-user upload cap |
allowed_types | jpeg / png / pdf | MIME whitelist |
max_size_mb | 5 | per-file size cap |
redirect | empty | URL after submit |
Validates server-side, writes to wkwp_wallet_kyc and wkwp_wallet_kyc_documents. See KYC.
[wkwp_wallet_coupon_redeem]
Redeem-code form. Used inside the Redeem dialog on My Wallet.
[wkwp_wallet_coupon_redeem placeholder="Enter code"]
Posts to admin-post.php?action=wkwp_redeem_code. Resolves the code as either:
- a wallet credit code minted via Bulk Credit / Debit
- a referral promo code
- a WC coupon (if you want to allow direct WC coupons here, filter
wkwp_redeem_allow_wc_couponsto true)
[wkwp_invite_friends_form]
Email invite form. Shoots invitations from the logged-in user to a list of email addresses.
[wkwp_invite_friends_form max_emails="10" message_field="yes"]
| Attribute | Default | Notes |
|---|---|---|
max_emails | from settings | per-submit cap |
message_field | yes | optional personal message |
daily_limit | from wkwp_invite_friends_daily_limit | per-user per day |
POST → admin-post.php?action=wkwp_invite_friends_submit. SMTP failure is non-fatal — DB row still saved, action wkwp_invite_friends_mail_failed fires for retry. See Invite Friends.
[wkwp_referral_link]
Personal referral link + Copy button + share row.
[wkwp_referral_link show_code="yes" share_buttons="whatsapp,x,email,messenger"]
| Attribute | Default | Notes |
|---|---|---|
show_code | yes | also render the alpha code (e.g. BOB22) |
share_buttons | all | comma list — whatsapp / x / email / messenger |
class | empty | extra wrapper class |
See Referral Program.
[wkwp_qr_receive]
Renders the per-user wallet QR code.
[wkwp_qr_receive size="200" caption="Scan to send me wallet"]
QR encodes the user's wallet ID + nonce. Scanners must use the wallet QR scan-pay flow to settle. See QR Code Payments.
[wkwp_qr_scan_pay]
Renders the html5-qrcode scanner UI to pay another user's QR.
[wkwp_qr_scan_pay camera="environment"]
| Attribute | Default | Notes |
|---|---|---|
camera | environment | user for selfie cam |
qrbox | 250 | scan box pixel size |
Requires camera permission and HTTPS. Falls back to "Upload QR image" on permission deny.
Common Filters
| Filter | Purpose |
|---|---|
wkwp_shortcode_atts_<name> | mutate parsed attributes per shortcode |
wkwp_shortcode_render_<name> | replace rendered HTML |
wkwp_shortcode_logged_out_html | message shown when guest hits a logged-in-only shortcode |
See Filters & Hooks.
Block Editor Equivalents
Each shortcode also ships as a Gutenberg block under the Webkul Wallet category — no shortcode-string typing needed.
