外掛說明
Texas Hold’em Cards lets you insert playing cards anywhere in your posts, pages or comments using a shortcode.
The main shortcode is [wouf_card]. A configurable alias (default [card]) is also available.
Cards are rendered as inline SVG: crisp at any size, no external images, no JavaScript.
Basic usage:
[wouf_card]As Kh[/wouf_card]
Displays an Ace of Spades and a King of Hearts.
Rank notation: A K Q J T 9 8 7 6 5 4 3 2
Suit notation: s (♠ spades) h (♥ hearts) d (♦ diamonds) c (♣ clubs)
Special tokens:
??— face-down card (card back)PP— face-down deck (stack of cards)_— half-card spacer (visually separates hole cards from the board)
Spaces, commas, semicolons, hyphens and pipes may be used as visual separators between cards and are ignored during parsing.
Shortcode attributes:
width— card width in pixels (default: plugin setting, initially 60 px; min 20, max 300). Height scales automatically at ratio ×1.4.align—inline(default),left,centerorright. Non-inline values wrap the hand in a block-level div.colors—2(default: ♠♣ black, ♥♦ red) or4(♠ black, ♥ red, ♦ blue, ♣ green). The 4-color mode is widely used in online poker for readability.gap— gap between cards in pixels. Defaults to ~8% of card width.
Plugin settings (Settings Texas Hold’em Cards):
- Shortcode alias (default:
card) - Default card width
- Default alignment
- Default color scheme (2-color / 4-color)
- Enable shortcodes in comments
Examples:
[wouf_card]As Kh[/wouf_card]
Inline: A♠ K♥
[wouf_card width="90" align="center"]As Kh _ Td Jc Qh[/wouf_card]
Centered, larger cards. Hole cards separated from the flop by a half-card spacer.
[wouf_card align="center"]?? Kh _ Td Jc Qh _ PP[/wouf_card]
Hidden card, K♥, flop, remaining deck.
[wouf_card colors="4"]As Kh Qd Jc[/wouf_card]
4-color deck: ♠ black, ♥ red, ♦ blue, ♣ green.
[wouf_card gap="2"]As Kh[/wouf_card]
Tighter gap between cards.
螢幕擷圖
![Inline hand in a paragraph — [wouf_card]As Kh[/wouf_card]](https://ps.w.org/texas-holdem-cards/assets/screenshot-1.png?rev=3583014)
[wouf_card]As Kh[/wouf_card]![Full board with spacer and deck — [wouf_card align="center"]As Kh _ Td Jc Qh _ PP[/wouf_card]](https://ps.w.org/texas-holdem-cards/assets/screenshot-2.png?rev=3583014)
[wouf_card align="center"]As Kh _ Td Jc Qh _ PP[/wouf_card]![Face-down hand and board — [wouf_card align="center"]?? Kh _ Td Jc Qh[/wouf_card]](https://ps.w.org/texas-holdem-cards/assets/screenshot-3.png?rev=3583014)
[wouf_card align="center"]?? Kh _ Td Jc Qh[/wouf_card]![4-color deck — [wouf_card colors="4"]As Kh Qd Jc[/wouf_card]](https://ps.w.org/texas-holdem-cards/assets/screenshot-4.png?rev=3583014)
[wouf_card colors="4"]As Kh Qd Jc[/wouf_card]安裝方式
- In your WordPress admin, go to Plugins Add New, search for Texas Hold’em Cards and click Install Now.
Or upload the
texas-holdem-cardsfolder to/wp-content/plugins/manually. - Activate the plugin in Plugins Installed Plugins.
- Optional: adjust settings in Settings Texas Hold’em Cards.
- Use the
[wouf_card]shortcode in any post, page, widget or comment.
常見問題集
-
Does it work in the block editor (Gutenberg)?
-
Yes. Use a Shortcode block and paste your
[wouf_card]shortcode. -
Can I change the shortcode alias?
-
Yes. Go to Settings Texas Hold’em Cards. The main
[wouf_card]shortcode always remains available. -
What is the 4-color mode?
-
In 4-color mode, each suit has a distinct color: ♠ black, ♥ red, ♦ blue, ♣ green. This is standard in online poker clients and greatly improves readability when suits matter (flushes, flush draws).
-
Can readers post hands in comments?
-
Yes — enable “Shortcodes in comments” in the plugin settings.
-
What happens if I write an invalid card (e.g. `Xz`)?
-
Invalid cards are silently ignored. The shortcode never produces broken output.
-
Are there any external requests?
-
No. Everything is inline SVG generated server-side. No fonts, no CDN, no JavaScript.
-
Can I style the cards with CSS?
-
The hand wrapper has classes
thc-handandthc-colors-2orthc-colors-4. Individual SVGs have inline styles; override them with!importantif needed.
使用者評論
這個外掛目前沒有任何使用者評論。
參與者及開發者
變更記錄
1.1.1
- Removed the explicit
load_plugin_textdomain()call — translations for WordPress.org-hosted plugins are loaded automatically since WordPress 4.6. - Renamed all internal functions, options and settings groups to use the unique
wouf_texas_holdem_cards_prefix, avoiding any naming collision with other plugins.
1.1.0
- Added 4-color deck mode (♠ black · ♥ red · ♦ blue · ♣ green) — global setting and per-shortcode
colorsattribute. - Added
gapattribute to control spacing between cards. - Added shortcode support inside comments (configurable, enabled by default).
- Improved SVG card design: subtle inner border, refined corner layout, slightly larger center suit.
- Added
wouf-texas-holdem-cards-colors-2/wouf-texas-holdem-cards-colors-4CSS classes on the hand wrapper for easier styling. - Updated admin settings page with new options and examples.
1.0.3
- Renamed the admin link from Documentation to Settings.
- Added plugin settings for shortcode alias, default card width and default alignment.
- Kept
[wouf_card]as the permanent main shortcode. - Set the default alignment to inline, with no block wrapper unless requested.
1.0.2
- Added a lightweight admin documentation page.
1.0.1
- Added
[wouf_card]as the main shortcode. - Kept
[card]as a backward-compatible alias. - Added support for spaces and common visual separators in shortcode content.
- Updated plugin description and WordPress compatibility metadata.
- Added translation template.
1.0.0
- Initial release.
- Inline SVG cards — no images required.
- Shortcode
[card]withwidthandalignparameters. - Special tokens:
??(card back),PP(face-down deck),_(spacer).
