WPGO documentationSVG Flags

Generated product reference

Every SVG Flags control, in one place.

Use this technical reference when you know the block or shortcode you need. It is generated from the same public contracts used by SVG Flags 0.11.1.

Current documentation Version 0.11.1Released 3 October 2026See what changed
Blocks6

Editor controls and saved block attributes.

Shortcodes6

Established shortcode attributes and aliases.

Plugin settings4

Released global option contract.

Developer filters25

Public extension points verified in the released source.

Block editor

Block settings

The saved attribute name is shown below each human label. Pro rows appear only when the Pro edition provides that control.

Block · 13 settings

SVG Flag

Free

Render a CSS-backed flag symbol as an inline or block-level element.

SVG Flag settings
SettingEditionType and defaultPurpose and accepted values
FlagflagFreestringDefault: {"value":"GB","label":"United Kingdom"}

Choose a code from the bundled 271-entry flag catalogue. Blocks store the selected code and label as JSON; shortcodes accept the code directly.

  • Two-letter country or supported regional/organisation code
  • Block example: {"value":"GB","label":"United Kingdom"}
  • Shortcode example: gb
Flag sizesizeFreestringDefault: 5

Set the flag width or maximum grid-item width before the selected CSS unit is appended.

  • Non-negative numeric value
  • The legacy shortcode width attribute is also accepted by the single-flag, image, and heading renderers
Size unitsize_unitFreestringDefault: em

Choose the CSS unit appended to size.

  • px
  • em
  • rem
  • vw
  • vh
  • Grid also offers %
Square aspect ratiosquareFreebooleanDefault: false

Use the bundled 1:1 artwork instead of the default 4:3 artwork.

  • true
  • false
Country-name captioncaptionFreebooleanDefault: false

Show the catalogue name below a non-inline flag or each grid image.

  • true
  • false
  • Single inline flags suppress captions
Inline displayinlineFreebooleanDefault: false

Render a single flag inline rather than as a block-level element.

  • true
  • false
Inline vertical alignmentinline_valignFreestringDefault: middle

Align an inline flag relative to surrounding text.

  • baseline
  • bottom
  • middle
  • sub
  • super
  • text-bottom
  • text-top
  • top
Random flagrandomFreebooleanDefault: false

Choose one supported flag for each server-side render instead of using flag.

  • true
  • false
Element IDidProstringDefault: Empty

Add an HTML id to the rendered single-flag element.

  • A valid HTML id
  • Empty for no id
Custom CSS classflag_classProstringDefault: Empty

Append a custom CSS class to the rendered flag element.

  • A CSS class token
  • Empty for no additional class
Country tooltiptooltipProbooleanDefault: false

Add a title tooltip containing the catalogue country name or custom_tooltip.

  • true
  • false
Custom tooltipcustom_tooltipProstringDefault: Empty

Replace the catalogue name used by an enabled tooltip.

  • Plain text
  • Empty to use the catalogue name
Custom captioncustom_captionProstringDefault: Empty

Replace the catalogue country name shown by an enabled caption.

  • Plain text
  • Empty to use the catalogue name

Block · 17 settings

SVG Flag Image

Free

Render an accessible, lazy-loaded SVG image with optional caption and Pro presentation controls.

SVG Flag Image settings
SettingEditionType and defaultPurpose and accepted values
FlagflagFreestringDefault: {"value":"GB","label":"United Kingdom"}

Choose a code from the bundled 271-entry flag catalogue. Blocks store the selected code and label as JSON; shortcodes accept the code directly.

  • Two-letter country or supported regional/organisation code
  • Block example: {"value":"GB","label":"United Kingdom"}
  • Shortcode example: gb
Flag sizesizeFreestringDefault: 5

Set the flag width or maximum grid-item width before the selected CSS unit is appended.

  • Non-negative numeric value
  • The legacy shortcode width attribute is also accepted by the single-flag, image, and heading renderers
Size unitsize_unitFreestringDefault: em

Choose the CSS unit appended to size.

  • px
  • em
  • rem
  • vw
  • vh
  • Grid also offers %
Square aspect ratiosquareFreebooleanDefault: false

Use the bundled 1:1 artwork instead of the default 4:3 artwork.

  • true
  • false
Country-name captioncaptionFreebooleanDefault: false

Show the catalogue name below a non-inline flag or each grid image.

  • true
  • false
  • Single inline flags suppress captions
Inline displayinlineFreebooleanDefault: false

Render a single flag inline rather than as a block-level element.

  • true
  • false
Inline vertical alignmentinline_valignFreestringDefault: middle

Align an inline flag relative to surrounding text.

  • baseline
  • bottom
  • middle
  • sub
  • super
  • text-bottom
  • text-top
  • top
Random flagrandomFreebooleanDefault: false

Choose one supported flag for each server-side render instead of using flag.

  • true
  • false
Element IDidProstringDefault: Empty

Add an HTML id to the rendered single-flag element.

  • A valid HTML id
  • Empty for no id
Custom CSS classflag_classProstringDefault: Empty

Append a custom CSS class to the rendered flag element.

  • A CSS class token
  • Empty for no additional class
Country tooltiptooltipProbooleanDefault: false

Add a title tooltip containing the catalogue country name or custom_tooltip.

  • true
  • false
Custom tooltipcustom_tooltipProstringDefault: Empty

Replace the catalogue name used by an enabled tooltip.

  • Plain text
  • Empty to use the catalogue name
Custom captioncustom_captionProstringDefault: Empty

Replace the catalogue country name shown by an enabled caption.

  • Plain text
  • Empty to use the catalogue name
Image borderborderProstringDefault: Empty

Apply a CSS border to an SVG Flag Image.

  • Valid CSS border shorthand
  • Empty for no custom border
Image border radiusborder_radiusProstringDefault: Empty

Apply a CSS border radius to an SVG Flag Image.

  • Valid CSS border-radius value
  • Empty for no custom radius
Image paddingpaddingProstringDefault: Empty

Apply CSS padding to an SVG Flag Image.

  • Valid CSS padding value
  • Empty for no custom padding
Image marginmarginProstringDefault: Empty

Apply CSS margin to an SVG Flag Image.

  • Valid CSS margin value
  • Empty for no custom margin

Block · 20 settings

SVG Flag Grid

Free

Render up to 100 unique valid flags in a responsive grid, with Pro links, custom captions, search, filtering and card presentation.

SVG Flag Grid settings
SettingEditionType and defaultPurpose and accepted values
FlagsflagsFreearrayDefault: ["GB","US","CA","FR","DE","JP"]

Choose the ordered flags rendered by the grid.

  • Block: array of supported uppercase codes
  • Shortcode: comma- or whitespace-separated codes
  • Duplicate and invalid codes are removed; at most 100 are rendered
Grid columnscolumnsFreenumberDefault: 3

Set the responsive grid column count.

  • Integer from 1 to 8
Grid gapgapFreestringDefault: 1

Set the distance between grid items before gap_unit is appended.

  • Non-negative numeric value
Gap unitgap_unitFreestringDefault: rem

Choose the CSS unit appended to gap.

  • px
  • em
  • rem
  • %
  • vw
Flag sizesizeFreestringDefault: 8

Set the flag width or maximum grid-item width before the selected CSS unit is appended.

  • Non-negative numeric value
  • The legacy shortcode width attribute is also accepted by the single-flag, image, and heading renderers
Size unitsize_unitFreestringDefault: rem

Choose the CSS unit appended to size.

  • px
  • em
  • rem
  • vw
  • vh
  • Grid also offers %
Square aspect ratiosquareFreebooleanDefault: false

Use the bundled 1:1 artwork instead of the default 4:3 artwork.

  • true
  • false
Country-name captioncaptionFreebooleanDefault: true

Show the catalogue name below a non-inline flag or each grid image.

  • true
  • false
  • Single inline flags suppress captions
Tablet columnscolumns_tabletPronumberDefault: 3

Set the Pro column count used at tablet widths.

  • Integer from 1 to 8
Mobile columnscolumns_mobilePronumberDefault: 2

Set the Pro column count used at mobile widths.

  • Integer from 1 to 8
Per-flag contentitem_dataProobjectDefault: Empty array

Store optional Pro captions and destination URLs keyed by flag code.

  • Object keyed by supported uppercase flag code
  • Each entry may contain caption and url
Open links in a new tablink_new_tabProbooleanDefault: false

Open configured grid links in a new browser tab with safe relationship attributes.

  • true
  • false
Grid searchenable_searchProbooleanDefault: false

Show a live client-side search field above a Pro Flag Grid.

  • true
  • false
Region filterenable_filterProbooleanDefault: false

Show a region selector based on the flags currently in a Pro grid.

  • true
  • false
Search placeholdersearch_placeholderProstringDefault: Search this flag collection

Set the prompt shown inside a grid or directory search field.

  • Plain text
Card stylingcard_styleProbooleanDefault: false

Present Pro grid items as bordered cards.

  • true
  • false
Card backgroundcard_backgroundProstringDefault: #ffffff

Set a hexadecimal background colour for Pro grid cards.

  • Six-digit hexadecimal colour
Card border colourcard_border_colorProstringDefault: #dcdcde

Set a hexadecimal border colour for Pro grid cards.

  • Six-digit hexadecimal colour
Card corner radiuscard_radiusProstringDefault: 10

Set the Pro grid card corner radius in pixels.

  • Number from 0 to 100
Card paddingcard_paddingProstringDefault: 16

Set the Pro grid card padding in pixels.

  • Number from 0 to 100

Block · 19 settings

SVG Flag Heading

Pro

Render a semantic heading containing a decorative flag followed by plain heading text.

SVG Flag Heading settings
SettingEditionType and defaultPurpose and accepted values
FlagflagProstringDefault: {"value":"GB","label":"United Kingdom"}

Choose a code from the bundled 271-entry flag catalogue. Blocks store the selected code and label as JSON; shortcodes accept the code directly.

  • Two-letter country or supported regional/organisation code
  • Block example: {"value":"GB","label":"United Kingdom"}
  • Shortcode example: gb
Flag sizesizeProstringDefault: 1

Set the flag width or maximum grid-item width before the selected CSS unit is appended.

  • Non-negative numeric value
  • The legacy shortcode width attribute is also accepted by the single-flag, image, and heading renderers
Size unitsize_unitProstringDefault: em

Choose the CSS unit appended to size.

  • px
  • em
  • rem
  • vw
  • vh
  • Grid also offers %
Square aspect ratiosquareProbooleanDefault: false

Use the bundled 1:1 artwork instead of the default 4:3 artwork.

  • true
  • false
Country-name captioncaptionProbooleanDefault: false

Show the catalogue name below a non-inline flag or each grid image. This saved compatibility attribute is registered by the retained heading block but is not consumed by its current renderer.

  • true
  • false
  • Single inline flags suppress captions
Inline displayinlineProbooleanDefault: true

Render a single flag inline rather than as a block-level element. This saved compatibility attribute is registered by the retained heading block but is not consumed by its current renderer.

  • true
  • false
Inline vertical alignmentinline_valignProstringDefault: baseline

Align an inline flag relative to surrounding text.

  • baseline
  • bottom
  • middle
  • sub
  • super
  • text-bottom
  • text-top
  • top
Random flagrandomProbooleanDefault: false

Choose one supported flag for each server-side render instead of using flag.

  • true
  • false
Element IDidProstringDefault: Empty

Add an HTML id to the rendered single-flag element. This saved compatibility attribute is registered by the retained heading block but is not consumed by its current renderer.

  • A valid HTML id
  • Empty for no id
Custom CSS classflag_classProstringDefault: Empty

Append a custom CSS class to the rendered flag element. This saved compatibility attribute is registered by the retained heading block but is not consumed by its current renderer.

  • A CSS class token
  • Empty for no additional class
Country tooltiptooltipProbooleanDefault: false

Add a title tooltip containing the catalogue country name or custom_tooltip. This saved compatibility attribute is registered by the retained heading block but is not consumed by its current renderer.

  • true
  • false
Custom tooltipcustom_tooltipProstringDefault: Empty

Replace the catalogue name used by an enabled tooltip. This saved compatibility attribute is registered by the retained heading block but is not consumed by its current renderer.

  • Plain text
  • Empty to use the catalogue name
Custom captioncustom_captionProstringDefault: Empty

Replace the catalogue country name shown by an enabled caption. This saved compatibility attribute is registered by the retained heading block but is not consumed by its current renderer.

  • Plain text
  • Empty to use the catalogue name
Image borderborderProstringDefault: Empty

Apply a CSS border to an SVG Flag Image. This saved compatibility attribute is registered by the retained heading block but is not consumed by its current renderer.

  • Valid CSS border shorthand
  • Empty for no custom border
Image border radiusborder_radiusProstringDefault: Empty

Apply a CSS border radius to an SVG Flag Image. This saved compatibility attribute is registered by the retained heading block but is not consumed by its current renderer.

  • Valid CSS border-radius value
  • Empty for no custom radius
Image paddingpaddingProstringDefault: Empty

Apply CSS padding to an SVG Flag Image. This saved compatibility attribute is registered by the retained heading block but is not consumed by its current renderer.

  • Valid CSS padding value
  • Empty for no custom padding
Image marginmarginProstringDefault: Empty

Apply CSS margin to an SVG Flag Image. This saved compatibility attribute is registered by the retained heading block but is not consumed by its current renderer.

  • Valid CSS margin value
  • Empty for no custom margin
Heading levelheading_tagProstringDefault: h2

Choose the semantic HTML heading element that wraps the Pro flag heading.

  • h1
  • h2
  • h3
  • h4
  • h5
  • h6
Heading textheadingProstringDefault: Empty

Set the plain-text content displayed after the decorative flag in a Pro heading.

  • Plain text
  • Empty while editing displays a temporary prompt only

Block · 14 settings

Linked Flag Card

Pro

Render a linked or static country card with a flag, title, description and controlled presentation.

Linked Flag Card settings
SettingEditionType and defaultPurpose and accepted values
FlagflagProstringDefault: {"value":"GB","label":"United Kingdom"}

Choose a code from the bundled 271-entry flag catalogue. Blocks store the selected code and label as JSON; shortcodes accept the code directly.

  • Two-letter country or supported regional/organisation code
  • Block example: {"value":"GB","label":"United Kingdom"}
  • Shortcode example: gb
Card titletitleProstringDefault: Empty

Set the Linked Flag Card title, or leave it empty to use the catalogue name.

  • Plain text
  • Empty to use the flag name
Card descriptiondescriptionProstringDefault: Empty

Add optional supporting text to a Linked Flag Card.

  • Plain text
  • Empty for no description
Destination URLurlProstringDefault: Empty

Set an optional destination for a Linked Flag Card.

  • Absolute or site-relative URL
  • Empty for a static card
Open in a new tabnew_tabProbooleanDefault: false

Open Linked Flag Card or Directory links in a new browser tab with safe relationship attributes.

  • true
  • false
Card layoutlayoutProstringDefault: horizontal

Arrange Linked Flag Card content horizontally or vertically.

  • horizontal
  • vertical
Card or directory flag sizeflag_sizeProstringDefault: 4

Set the flag width before flag_size_unit is appended.

  • Positive numeric value
Flag size unitflag_size_unitProstringDefault: rem

Choose the CSS unit appended to flag_size.

  • px
  • em
  • rem
  • vw
  • vh
Square aspect ratiosquareProbooleanDefault: false

Use the bundled 1:1 artwork instead of the default 4:3 artwork.

  • true
  • false
Background colourbackground_colorProstringDefault: #ffffff

Set a Linked Flag Card hexadecimal background colour.

  • Six-digit hexadecimal colour
Text colourtext_colorProstringDefault: #1d2327

Set a Linked Flag Card hexadecimal text colour.

  • Six-digit hexadecimal colour
Border colourborder_colorProstringDefault: #dcdcde

Set a Linked Flag Card hexadecimal border colour.

  • Six-digit hexadecimal colour
Image border radiusborder_radiusProstringDefault: Empty

Apply a CSS border radius to an SVG Flag Image.

  • Valid CSS border-radius value
  • Empty for no custom radius
Image paddingpaddingProstringDefault: Empty

Apply CSS padding to an SVG Flag Image.

  • Valid CSS padding value
  • Empty for no custom padding

Block · 29 settings

Searchable Flag Directory

Pro

Render a curated, searchable and progressively revealed flag directory with responsive branded cards.

Searchable Flag Directory settings
SettingEditionType and defaultPurpose and accepted values
Included regionscontinentsProarrayDefault: Empty array

Limit a Flag Directory to one or more catalogue continents or regions.

  • Block: array of region names
  • Shortcode: comma- or pipe-separated region names
  • Empty for every region
Included flagsinclude_flagsProarrayDefault: Empty array

Limit a Flag Directory to an explicit ordered set of supported flag codes.

  • Block: array of supported uppercase codes
  • Shortcode: comma-, space-, or pipe-separated codes
  • Empty to include every flag from the selected regions
Excluded flagsexclude_flagsProarrayDefault: Empty array

Remove selected flag codes after region and include rules are applied.

  • Block: array of supported uppercase codes
  • Shortcode: comma-, space-, or pipe-separated codes
  • Excluded codes take precedence over included codes
Directory ordersort_orderProstringDefault: name_asc

Choose the stable order used for Flag Directory items.

  • name_asc
  • name_desc
  • code_asc
  • code_desc
  • include_order
Initial regioninitial_continentProstringDefault: Empty

Select the region filter shown when a Flag Directory first loads.

  • A region present in the rendered directory
  • Empty for All regions
Grid columnscolumnsPronumberDefault: 3

Set the responsive grid column count.

  • Integer from 1 to 8
Tablet columnscolumns_tabletPronumberDefault: 3

Set the Pro column count used at tablet widths.

  • Integer from 1 to 8
Mobile columnscolumns_mobilePronumberDefault: 2

Set the Pro column count used at mobile widths.

  • Integer from 1 to 8
Grid gapgapProstringDefault: 1

Set the distance between grid items before gap_unit is appended.

  • Non-negative numeric value
Gap unitgap_unitProstringDefault: rem

Choose the CSS unit appended to gap.

  • px
  • em
  • rem
  • %
  • vw
Card or directory flag sizeflag_sizeProstringDefault: 5

Set the flag width before flag_size_unit is appended.

  • Positive numeric value
Flag size unitflag_size_unitProstringDefault: rem

Choose the CSS unit appended to flag_size.

  • px
  • em
  • rem
  • vw
  • vh
Square aspect ratiosquareProbooleanDefault: false

Use the bundled 1:1 artwork instead of the default 4:3 artwork.

  • true
  • false
Directory searchshow_searchProbooleanDefault: true

Show live search above a Flag Directory.

  • true
  • false
Directory region filtershow_filterProbooleanDefault: true

Show a region selector above a Flag Directory.

  • true
  • false
Flag codesshow_codesProbooleanDefault: false

Show the catalogue code below each directory flag.

  • true
  • false
A–Z filtershow_alphabet_navProbooleanDefault: false

Show accessible letter buttons that filter a Flag Directory by country-name initial.

  • true
  • false
Progressive loadingprogressive_loadProbooleanDefault: false

Initially reveal one batch of matching directory flags and provide a Load more button.

  • true
  • false
Flags per batchitems_per_pagePronumberDefault: 40

Set the number of matching flags revealed in each progressive-loading batch.

  • Integer from 8 to 100
Search placeholdersearch_placeholderProstringDefault: Search countries and territories

Set the prompt shown inside a grid or directory search field.

  • Plain text
No-results messageempty_messageProstringDefault: No flags match your search.

Set the message announced and displayed when directory filters have no matches.

  • Plain text
  • Empty uses the default message
Directory URL patternlink_patternProstringDefault: Empty

Create a destination per flag using code and name placeholders.

  • URL containing %code% and/or %name%
  • Empty for unlinked items
Open in a new tabnew_tabProbooleanDefault: false

Open Linked Flag Card or Directory links in a new browser tab with safe relationship attributes.

  • true
  • false
Card backgroundcard_backgroundProstringDefault: #ffffff

Set a hexadecimal background colour for Pro grid cards.

  • Six-digit hexadecimal colour
Directory text colourcard_text_colorProstringDefault: #1d2327

Set the hexadecimal text colour used by directory cards.

  • Six-digit hexadecimal colour
Card border colourcard_border_colorProstringDefault: #dcdcde

Set a hexadecimal border colour for Pro grid cards.

  • Six-digit hexadecimal colour
Directory interaction colourcard_hover_colorProstringDefault: #0f766e

Set the hexadecimal border, button and focus colour used for interactive directory states.

  • Six-digit hexadecimal colour
Card corner radiuscard_radiusProstringDefault: 10

Set the Pro grid card corner radius in pixels.

  • Number from 0 to 100
Card paddingcard_paddingProstringDefault: 16

Set the Pro grid card padding in pixels.

  • Number from 0 to 100

Established workflows

Shortcode attributes

Shortcodes remain supported for existing content and code-led builds. Add only attributes whose defaults you need to change.

Shortcode · 13 attributes

[svg-flag]

Free

Render one CSS-backed flag. The svg-flags alias remains supported for established content.

Aliases: [svg-flags]

[svg-flag]
[svg-flag] attributes
AttributeEditionType and defaultPurpose and accepted values
FlagflagFreestringDefault: {"value":"GB","label":"United Kingdom"}

Choose a code from the bundled 271-entry flag catalogue. Blocks store the selected code and label as JSON; shortcodes accept the code directly.

  • Two-letter country or supported regional/organisation code
  • Block example: {"value":"GB","label":"United Kingdom"}
  • Shortcode example: gb
Flag sizesizeFreestringDefault: 5

Set the flag width or maximum grid-item width before the selected CSS unit is appended.

  • Non-negative numeric value
  • The legacy shortcode width attribute is also accepted by the single-flag, image, and heading renderers
Size unitsize_unitFreestringDefault: em

Choose the CSS unit appended to size.

  • px
  • em
  • rem
  • vw
  • vh
  • Grid also offers %
Square aspect ratiosquareFreebooleanDefault: false

Use the bundled 1:1 artwork instead of the default 4:3 artwork.

  • true
  • false
Country-name captioncaptionFreebooleanDefault: false

Show the catalogue name below a non-inline flag or each grid image.

  • true
  • false
  • Single inline flags suppress captions
Inline displayinlineFreebooleanDefault: false

Render a single flag inline rather than as a block-level element.

  • true
  • false
Inline vertical alignmentinline_valignFreestringDefault: middle

Align an inline flag relative to surrounding text.

  • baseline
  • bottom
  • middle
  • sub
  • super
  • text-bottom
  • text-top
  • top
Random flagrandomFreebooleanDefault: false

Choose one supported flag for each server-side render instead of using flag.

  • true
  • false
Element IDidProstringDefault: Empty

Add an HTML id to the rendered single-flag element.

  • A valid HTML id
  • Empty for no id
Custom CSS classflag_classProstringDefault: Empty

Append a custom CSS class to the rendered flag element.

  • A CSS class token
  • Empty for no additional class
Country tooltiptooltipProbooleanDefault: false

Add a title tooltip containing the catalogue country name or custom_tooltip.

  • true
  • false
Custom tooltipcustom_tooltipProstringDefault: Empty

Replace the catalogue name used by an enabled tooltip.

  • Plain text
  • Empty to use the catalogue name
Custom captioncustom_captionProstringDefault: Empty

Replace the catalogue country name shown by an enabled caption.

  • Plain text
  • Empty to use the catalogue name

Shortcode · 17 attributes

[svg-flag-image]

Free

Render one lazy-loaded SVG image with meaningful alternative text.

[svg-flag-image]
[svg-flag-image] attributes
AttributeEditionType and defaultPurpose and accepted values
FlagflagFreestringDefault: {"value":"GB","label":"United Kingdom"}

Choose a code from the bundled 271-entry flag catalogue. Blocks store the selected code and label as JSON; shortcodes accept the code directly.

  • Two-letter country or supported regional/organisation code
  • Block example: {"value":"GB","label":"United Kingdom"}
  • Shortcode example: gb
Flag sizesizeFreestringDefault: 5

Set the flag width or maximum grid-item width before the selected CSS unit is appended.

  • Non-negative numeric value
  • The legacy shortcode width attribute is also accepted by the single-flag, image, and heading renderers
Size unitsize_unitFreestringDefault: em

Choose the CSS unit appended to size.

  • px
  • em
  • rem
  • vw
  • vh
  • Grid also offers %
Square aspect ratiosquareFreebooleanDefault: false

Use the bundled 1:1 artwork instead of the default 4:3 artwork.

  • true
  • false
Country-name captioncaptionFreebooleanDefault: false

Show the catalogue name below a non-inline flag or each grid image.

  • true
  • false
  • Single inline flags suppress captions
Random flagrandomFreebooleanDefault: false

Choose one supported flag for each server-side render instead of using flag.

  • true
  • false
Inline displayinlineFreebooleanDefault: false

Render a single flag inline rather than as a block-level element.

  • true
  • false
Inline vertical alignmentinline_valignFreestringDefault: middle

Align an inline flag relative to surrounding text.

  • baseline
  • bottom
  • middle
  • sub
  • super
  • text-bottom
  • text-top
  • top
Element IDidProstringDefault: Empty

Add an HTML id to the rendered single-flag element.

  • A valid HTML id
  • Empty for no id
Custom CSS classflag_classProstringDefault: Empty

Append a custom CSS class to the rendered flag element.

  • A CSS class token
  • Empty for no additional class
Country tooltiptooltipProbooleanDefault: false

Add a title tooltip containing the catalogue country name or custom_tooltip.

  • true
  • false
Custom tooltipcustom_tooltipProstringDefault: Empty

Replace the catalogue name used by an enabled tooltip.

  • Plain text
  • Empty to use the catalogue name
Custom captioncustom_captionProstringDefault: Empty

Replace the catalogue country name shown by an enabled caption.

  • Plain text
  • Empty to use the catalogue name
Image borderborderProstringDefault: Empty

Apply a CSS border to an SVG Flag Image.

  • Valid CSS border shorthand
  • Empty for no custom border
Image border radiusborder_radiusProstringDefault: Empty

Apply a CSS border radius to an SVG Flag Image.

  • Valid CSS border-radius value
  • Empty for no custom radius
Image paddingpaddingProstringDefault: Empty

Apply CSS padding to an SVG Flag Image.

  • Valid CSS padding value
  • Empty for no custom padding
Image marginmarginProstringDefault: Empty

Apply CSS margin to an SVG Flag Image.

  • Valid CSS margin value
  • Empty for no custom margin

Shortcode · 20 attributes

[svg-flag-grid]

Free

Render a validated, deduplicated grid of up to 100 flags, with optional Pro search, filters, links and card presentation.

[svg-flag-grid]
[svg-flag-grid] attributes
AttributeEditionType and defaultPurpose and accepted values
FlagsflagsFreearrayDefault: ["GB","US","CA","FR","DE","JP"]

Choose the ordered flags rendered by the grid.

  • Block: array of supported uppercase codes
  • Shortcode: comma- or whitespace-separated codes
  • Duplicate and invalid codes are removed; at most 100 are rendered
Grid columnscolumnsFreenumberDefault: 3

Set the responsive grid column count.

  • Integer from 1 to 8
Grid gapgapFreestringDefault: 1

Set the distance between grid items before gap_unit is appended.

  • Non-negative numeric value
Gap unitgap_unitFreestringDefault: rem

Choose the CSS unit appended to gap.

  • px
  • em
  • rem
  • %
  • vw
Flag sizesizeFreestringDefault: 8

Set the flag width or maximum grid-item width before the selected CSS unit is appended.

  • Non-negative numeric value
  • The legacy shortcode width attribute is also accepted by the single-flag, image, and heading renderers
Size unitsize_unitFreestringDefault: rem

Choose the CSS unit appended to size.

  • px
  • em
  • rem
  • vw
  • vh
  • Grid also offers %
Square aspect ratiosquareFreebooleanDefault: false

Use the bundled 1:1 artwork instead of the default 4:3 artwork.

  • true
  • false
Country-name captioncaptionFreebooleanDefault: true

Show the catalogue name below a non-inline flag or each grid image.

  • true
  • false
  • Single inline flags suppress captions
Tablet columnscolumns_tabletPronumberDefault: 3

Set the Pro column count used at tablet widths.

  • Integer from 1 to 8
Mobile columnscolumns_mobilePronumberDefault: 2

Set the Pro column count used at mobile widths.

  • Integer from 1 to 8
Per-flag contentitem_dataProobjectDefault: Empty array

Store optional Pro captions and destination URLs keyed by flag code.

  • Object keyed by supported uppercase flag code
  • Each entry may contain caption and url
Open links in a new tablink_new_tabProbooleanDefault: false

Open configured grid links in a new browser tab with safe relationship attributes.

  • true
  • false
Grid searchenable_searchProbooleanDefault: false

Show a live client-side search field above a Pro Flag Grid.

  • true
  • false
Region filterenable_filterProbooleanDefault: false

Show a region selector based on the flags currently in a Pro grid.

  • true
  • false
Search placeholdersearch_placeholderProstringDefault: Search this flag collection

Set the prompt shown inside a grid or directory search field.

  • Plain text
Card stylingcard_styleProbooleanDefault: false

Present Pro grid items as bordered cards.

  • true
  • false
Card backgroundcard_backgroundProstringDefault: #ffffff

Set a hexadecimal background colour for Pro grid cards.

  • Six-digit hexadecimal colour
Card border colourcard_border_colorProstringDefault: #dcdcde

Set a hexadecimal border colour for Pro grid cards.

  • Six-digit hexadecimal colour
Card corner radiuscard_radiusProstringDefault: 10

Set the Pro grid card corner radius in pixels.

  • Number from 0 to 100
Card paddingcard_paddingProstringDefault: 16

Set the Pro grid card padding in pixels.

  • Number from 0 to 100

Shortcode · 8 attributes

[svg-flag-heading]

Pro

Render a semantic heading with a decorative flag image.

[svg-flag-heading]
[svg-flag-heading] attributes
AttributeEditionType and defaultPurpose and accepted values
FlagflagProstringDefault: {"value":"GB","label":"United Kingdom"}

Choose a code from the bundled 271-entry flag catalogue. Blocks store the selected code and label as JSON; shortcodes accept the code directly.

  • Two-letter country or supported regional/organisation code
  • Block example: {"value":"GB","label":"United Kingdom"}
  • Shortcode example: gb
Flag sizesizeProstringDefault: 1

Set the flag width or maximum grid-item width before the selected CSS unit is appended.

  • Non-negative numeric value
  • The legacy shortcode width attribute is also accepted by the single-flag, image, and heading renderers
Size unitsize_unitProstringDefault: em

Choose the CSS unit appended to size.

  • px
  • em
  • rem
  • vw
  • vh
  • Grid also offers %
Square aspect ratiosquareProbooleanDefault: false

Use the bundled 1:1 artwork instead of the default 4:3 artwork.

  • true
  • false
Inline vertical alignmentinline_valignProstringDefault: middle

Align an inline flag relative to surrounding text.

  • baseline
  • bottom
  • middle
  • sub
  • super
  • text-bottom
  • text-top
  • top
Random flagrandomProbooleanDefault: false

Choose one supported flag for each server-side render instead of using flag.

  • true
  • false
Heading textheadingProstringDefault: Empty

Set the plain-text content displayed after the decorative flag in a Pro heading.

  • Plain text
  • Empty while editing displays a temporary prompt only
Heading levelheading_tagProstringDefault: h2

Choose the semantic HTML heading element that wraps the Pro flag heading.

  • h1
  • h2
  • h3
  • h4
  • h5
  • h6

Shortcode · 14 attributes

[svg-flag-card]

Pro

Render a linked or static country card.

[svg-flag-card]
[svg-flag-card] attributes
AttributeEditionType and defaultPurpose and accepted values
FlagflagProstringDefault: {"value":"GB","label":"United Kingdom"}

Choose a code from the bundled 271-entry flag catalogue. Blocks store the selected code and label as JSON; shortcodes accept the code directly.

  • Two-letter country or supported regional/organisation code
  • Block example: {"value":"GB","label":"United Kingdom"}
  • Shortcode example: gb
Card titletitleProstringDefault: Empty

Set the Linked Flag Card title, or leave it empty to use the catalogue name.

  • Plain text
  • Empty to use the flag name
Card descriptiondescriptionProstringDefault: Empty

Add optional supporting text to a Linked Flag Card.

  • Plain text
  • Empty for no description
Destination URLurlProstringDefault: Empty

Set an optional destination for a Linked Flag Card.

  • Absolute or site-relative URL
  • Empty for a static card
Open in a new tabnew_tabProbooleanDefault: false

Open Linked Flag Card or Directory links in a new browser tab with safe relationship attributes.

  • true
  • false
Card layoutlayoutProstringDefault: horizontal

Arrange Linked Flag Card content horizontally or vertically.

  • horizontal
  • vertical
Card or directory flag sizeflag_sizeProstringDefault: 4

Set the flag width before flag_size_unit is appended.

  • Positive numeric value
Flag size unitflag_size_unitProstringDefault: rem

Choose the CSS unit appended to flag_size.

  • px
  • em
  • rem
  • vw
  • vh
Square aspect ratiosquareProbooleanDefault: false

Use the bundled 1:1 artwork instead of the default 4:3 artwork.

  • true
  • false
Background colourbackground_colorProstringDefault: #ffffff

Set a Linked Flag Card hexadecimal background colour.

  • Six-digit hexadecimal colour
Text colourtext_colorProstringDefault: #1d2327

Set a Linked Flag Card hexadecimal text colour.

  • Six-digit hexadecimal colour
Border colourborder_colorProstringDefault: #dcdcde

Set a Linked Flag Card hexadecimal border colour.

  • Six-digit hexadecimal colour
Image border radiusborder_radiusProstringDefault: Empty

Apply a CSS border radius to an SVG Flag Image.

  • Valid CSS border-radius value
  • Empty for no custom radius
Image paddingpaddingProstringDefault: Empty

Apply CSS padding to an SVG Flag Image.

  • Valid CSS padding value
  • Empty for no custom padding

Shortcode · 29 attributes

[svg-flag-directory]

Pro

Render a curated, searchable and progressively revealed directory from the complete catalogue or selected flags.

[svg-flag-directory]
[svg-flag-directory] attributes
AttributeEditionType and defaultPurpose and accepted values
Included regionscontinentsProarrayDefault: Empty array

Limit a Flag Directory to one or more catalogue continents or regions.

  • Block: array of region names
  • Shortcode: comma- or pipe-separated region names
  • Empty for every region
Included flagsinclude_flagsProarrayDefault: Empty array

Limit a Flag Directory to an explicit ordered set of supported flag codes.

  • Block: array of supported uppercase codes
  • Shortcode: comma-, space-, or pipe-separated codes
  • Empty to include every flag from the selected regions
Excluded flagsexclude_flagsProarrayDefault: Empty array

Remove selected flag codes after region and include rules are applied.

  • Block: array of supported uppercase codes
  • Shortcode: comma-, space-, or pipe-separated codes
  • Excluded codes take precedence over included codes
Directory ordersort_orderProstringDefault: name_asc

Choose the stable order used for Flag Directory items.

  • name_asc
  • name_desc
  • code_asc
  • code_desc
  • include_order
Initial regioninitial_continentProstringDefault: Empty

Select the region filter shown when a Flag Directory first loads.

  • A region present in the rendered directory
  • Empty for All regions
Grid columnscolumnsPronumberDefault: 3

Set the responsive grid column count.

  • Integer from 1 to 8
Tablet columnscolumns_tabletPronumberDefault: 3

Set the Pro column count used at tablet widths.

  • Integer from 1 to 8
Mobile columnscolumns_mobilePronumberDefault: 2

Set the Pro column count used at mobile widths.

  • Integer from 1 to 8
Grid gapgapProstringDefault: 1

Set the distance between grid items before gap_unit is appended.

  • Non-negative numeric value
Gap unitgap_unitProstringDefault: rem

Choose the CSS unit appended to gap.

  • px
  • em
  • rem
  • %
  • vw
Card or directory flag sizeflag_sizeProstringDefault: 5

Set the flag width before flag_size_unit is appended.

  • Positive numeric value
Flag size unitflag_size_unitProstringDefault: rem

Choose the CSS unit appended to flag_size.

  • px
  • em
  • rem
  • vw
  • vh
Square aspect ratiosquareProbooleanDefault: false

Use the bundled 1:1 artwork instead of the default 4:3 artwork.

  • true
  • false
Directory searchshow_searchProbooleanDefault: true

Show live search above a Flag Directory.

  • true
  • false
Directory region filtershow_filterProbooleanDefault: true

Show a region selector above a Flag Directory.

  • true
  • false
Flag codesshow_codesProbooleanDefault: false

Show the catalogue code below each directory flag.

  • true
  • false
A–Z filtershow_alphabet_navProbooleanDefault: false

Show accessible letter buttons that filter a Flag Directory by country-name initial.

  • true
  • false
Progressive loadingprogressive_loadProbooleanDefault: false

Initially reveal one batch of matching directory flags and provide a Load more button.

  • true
  • false
Flags per batchitems_per_pagePronumberDefault: 40

Set the number of matching flags revealed in each progressive-loading batch.

  • Integer from 8 to 100
Search placeholdersearch_placeholderProstringDefault: Search countries and territories

Set the prompt shown inside a grid or directory search field.

  • Plain text
No-results messageempty_messageProstringDefault: No flags match your search.

Set the message announced and displayed when directory filters have no matches.

  • Plain text
  • Empty uses the default message
Directory URL patternlink_patternProstringDefault: Empty

Create a destination per flag using code and name placeholders.

  • URL containing %code% and/or %name%
  • Empty for unlinked items
Open in a new tabnew_tabProbooleanDefault: false

Open Linked Flag Card or Directory links in a new browser tab with safe relationship attributes.

  • true
  • false
Card backgroundcard_backgroundProstringDefault: #ffffff

Set a hexadecimal background colour for Pro grid cards.

  • Six-digit hexadecimal colour
Directory text colourcard_text_colorProstringDefault: #1d2327

Set the hexadecimal text colour used by directory cards.

  • Six-digit hexadecimal colour
Card border colourcard_border_colorProstringDefault: #dcdcde

Set a hexadecimal border colour for Pro grid cards.

  • Six-digit hexadecimal colour
Directory interaction colourcard_hover_colorProstringDefault: #0f766e

Set the hexadecimal border, button and focus colour used for interactive directory states.

  • Six-digit hexadecimal colour
Card corner radiuscard_radiusProstringDefault: 10

Set the Pro grid card corner radius in pixels.

  • Number from 0 to 100
Card paddingcard_paddingProstringDefault: 16

Set the Pro grid card padding in pixels.

  • Number from 0 to 100

WordPress options

Plugin settings

Global settings apply only where described; each row states its edition, default, and accepted values.

Plugin settings
SettingEditionType and defaultPurpose and accepted values
Single flag defaultsSingle flag defaultsFreestringDefault: Empty

Starting flag, size, aspect ratio and caption for new single-flag blocks.

Flag Grid defaultsFlag Grid defaultsFreestringDefault: Empty

Starting flags, columns, gap, size, aspect ratio and captions for new grids.

Pro Grid and Linked Flag Card defaultsPro Grid and Linked Flag Card defaultsProstringDefault: Empty

Responsive columns, search, filters, card presentation and linked-card styling for new Pro blocks.

Flag Directory defaultsFlag Directory defaultsProstringDefault: Empty

Responsive columns, search, region and A–Z filtering, progressive batches, ordering and branded card presentation for new directories.

Developer API

Developer filters

These WordPress filters are public extension points. Return the same value type described for each filter.

svg_flag_shortcode_custom_flagFree

Filter the requested CSS-backed flag code before validation.

Value
string
Parameters
$flag — requested code; $atts — resolved attributes
Return
A supported flag code
svg_flag_shortcode_tagFree

Filter the CSS-backed flag wrapper element.

Value
string
Parameters
$tag — div or span; $atts — resolved attributes
Return
div or span; other values are replaced with div
svg_flag_shortcode_idFree

Filter the CSS-backed flag id attribute; Pro uses this to apply id.

Value
string
Parameters
$id — empty by default; $atts — resolved attributes
Return
Sanitised id attribute or empty string
svg_flag_shortcode_flag_classFree

Filter the base CSS classes for a CSS-backed flag.

Value
string
Parameters
$classes — generated class string; $flag — normalized code; $atts — resolved attributes
Return
CSS class string
svg_flag_caption_textFree

Filter a CSS-backed flag caption; Pro uses this for custom captions.

Value
string
Parameters
$text — catalogue name; $atts — resolved attributes
Return
Caption text
svg_flag_shortcode_class_attributeFree

Filter the CSS-backed flag class list; Pro appends flag_class here.

Value
array
Parameters
$classes — class list; $atts — resolved attributes
Return
Class list
svg_flag_shortcode_style_attributeFree

Filter inline CSS declarations for a CSS-backed flag.

Value
array
Parameters
$styles — style list; $atts — resolved attributes
Return
Style declaration list
svg_flag_shortcode_title_attributeFree

Filter the CSS-backed flag title tooltip; Pro supplies tooltip behaviour here.

Value
string
Parameters
$title — empty by default; $atts — resolved attributes; $flag — normalized code
Return
Tooltip text or empty string
svg_flag_image_shortcode_custom_flagFree

Filter the requested image flag code before validation.

Value
string
Parameters
$flag — requested code; $atts — resolved attributes
Return
A supported flag code
svg_flag_image_shortcode_inline_styleFree

Filter the image display declaration.

Value
string
Parameters
$style — display declaration; $atts — resolved attributes
Return
CSS declaration string
svg_flag_image_shortcode_idFree

Filter the image id attribute; Pro uses this to apply id.

Value
string
Parameters
$id — empty by default; $atts — resolved attributes
Return
Sanitised id attribute or empty string
svg_flag_image_caption_textFree

Filter an image caption; Pro uses this for custom captions.

Value
string
Parameters
$text — catalogue name; $atts — resolved attributes
Return
Caption text
svg_flag_image_shortcode_class_attributeFree

Filter image classes; Pro appends flag_class here.

Value
array
Parameters
$classes — class list; $atts — resolved attributes
Return
Class list
svg_flag_image_shortcode_style_attributeFree

Filter image CSS declarations; Pro appends border and spacing here.

Value
array
Parameters
$styles — style list; $atts — resolved attributes
Return
Style declaration list
svg_flag_image_shortcode_title_attributeFree

Filter the image title tooltip; Pro supplies tooltip behaviour here.

Value
string
Parameters
$title — empty by default; $atts — resolved attributes; $flag — normalized code; $countries — catalogue map
Return
Tooltip text or empty string
svg_flag_grid_flagsFree

Filter the normalized grid flag codes before a second validation pass.

Value
array
Parameters
$flags — normalized code list; $atts — resolved attributes
Return
Flag-code array; invalid values are removed
svg_flag_grid_caption_textFree

Filter each grid caption; Pro supplies per-flag captions here.

Value
string
Parameters
$caption — catalogue name; $code — normalized code; $atts — resolved attributes
Return
Caption text
svg_flag_grid_item_htmlFree

Filter each complete grid figure element.

Value
string
Parameters
$html — figure markup; $code — normalized code; $name — catalogue name; $atts — resolved attributes
Return
Grid item HTML
svg_flag_grid_classFree

Filter the Flag Grid class attribute; Pro adds responsive and card classes.

Value
string
Parameters
$class — generated class string; $atts — resolved attributes
Return
CSS class string
svg_flag_grid_styleFree

Filter inline grid declarations; Pro adds responsive and card variables.

Value
string
Parameters
$style — generated CSS declarations; $atts — resolved attributes
Return
CSS declaration string
svg_flag_grid_htmlFree

Filter the complete grid; Pro adds optional search and region controls.

Value
string
Parameters
$html — complete grid markup; $flags — normalized codes; $atts — resolved attributes
Return
Grid HTML
svg_flag_heading_shortcode_custom_flagPro

Filter the requested Pro heading flag code before validation.

Value
string
Parameters
$flag — requested code; $atts — resolved attributes
Return
A supported flag code
svg_flag_heading_shortcode_style_attributePro

Filter CSS declarations applied to the decorative heading image.

Value
array
Parameters
$styles — style list; $atts — resolved attributes
Return
Style declaration list
svg_flag_heading_shortcode_title_attributePro

Filter the decorative heading image title attribute.

Value
string
Parameters
$title — empty by default; $atts — resolved attributes; $flag — normalized code; $countries — catalogue map
Return
Tooltip text or empty string
svg_flag_heading_shortcode_idPro

Filter the Pro heading id attribute.

Value
string
Parameters
$id — empty by default; $atts — resolved attributes
Return
Sanitised id attribute or empty string