Texas Hold'em Cards

Description

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.
  • aligninline (default), left, center or right. Non-inline values wrap the hand in a block-level div.
  • colors2 (default: ♠♣ black, ♥♦ red) or 4 (♠ 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.

Screenshots

Installation

  1. In your WordPress admin, go to Plugins Add New, search for Texas Hold’em Cards and click Install Now. Or upload the texas-holdem-cards folder to /wp-content/plugins/ manually.
  2. Activate the plugin in Plugins Installed Plugins.
  3. Optional: adjust settings in Settings Texas Hold’em Cards.
  4. Use the [wouf_card] shortcode in any post, page, widget or comment.

FAQ

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-hand and thc-colors-2 or thc-colors-4. Individual SVGs have inline styles; override them with !important if needed.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Texas Hold'em Cards” is open source software. The following people have contributed to this plugin.

Contributors

Translate “Texas Hold'em Cards” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

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 colors attribute.
  • Added gap attribute 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-4 CSS 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] with width and align parameters.
  • Special tokens: ?? (card back), PP (face-down deck), _ (spacer).