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.9.7.
Editor controls and saved block attributes.
Established shortcode attributes and aliases.
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
Render a CSS-backed flag symbol as an inline or block-level element.
| Setting | Edition | Type and default | Purpose and accepted values |
|---|---|---|---|
Flagflag | Free | stringDefault: {"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.
|
Flag sizesize | Free | stringDefault: 5 | Set the flag width or maximum grid-item width before the selected CSS unit is appended.
|
Size unitsize_unit | Free | stringDefault: em | Choose the CSS unit appended to size.
|
Square aspect ratiosquare | Free | booleanDefault: false | Use the bundled 1:1 artwork instead of the default 4:3 artwork.
|
Country-name captioncaption | Free | booleanDefault: false | Show the catalogue name below a non-inline flag or each grid image.
|
Inline displayinline | Free | booleanDefault: false | Render a single flag inline rather than as a block-level element.
|
Inline vertical alignmentinline_valign | Free | stringDefault: middle | Align an inline flag relative to surrounding text.
|
Random flagrandom | Free | booleanDefault: false | Choose one supported flag for each server-side render instead of using flag.
|
Element IDid | Pro | stringDefault: Empty | Add an HTML id to the rendered single-flag element.
|
Custom CSS classflag_class | Pro | stringDefault: Empty | Append a custom CSS class to the rendered flag element.
|
Country tooltiptooltip | Pro | booleanDefault: false | Add a title tooltip containing the catalogue country name or custom_tooltip.
|
Custom tooltipcustom_tooltip | Pro | stringDefault: Empty | Replace the catalogue name used by an enabled tooltip.
|
Custom captioncustom_caption | Pro | stringDefault: Empty | Replace the catalogue country name shown by an enabled caption.
|
Block · 17 settings
SVG Flag Image
Render an accessible, lazy-loaded SVG image with optional caption and Pro presentation controls.
| Setting | Edition | Type and default | Purpose and accepted values |
|---|---|---|---|
Flagflag | Free | stringDefault: {"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.
|
Flag sizesize | Free | stringDefault: 5 | Set the flag width or maximum grid-item width before the selected CSS unit is appended.
|
Size unitsize_unit | Free | stringDefault: em | Choose the CSS unit appended to size.
|
Square aspect ratiosquare | Free | booleanDefault: false | Use the bundled 1:1 artwork instead of the default 4:3 artwork.
|
Country-name captioncaption | Free | booleanDefault: false | Show the catalogue name below a non-inline flag or each grid image.
|
Inline displayinline | Free | booleanDefault: false | Render a single flag inline rather than as a block-level element.
|
Inline vertical alignmentinline_valign | Free | stringDefault: middle | Align an inline flag relative to surrounding text.
|
Random flagrandom | Free | booleanDefault: false | Choose one supported flag for each server-side render instead of using flag.
|
Element IDid | Pro | stringDefault: Empty | Add an HTML id to the rendered single-flag element.
|
Custom CSS classflag_class | Pro | stringDefault: Empty | Append a custom CSS class to the rendered flag element.
|
Country tooltiptooltip | Pro | booleanDefault: false | Add a title tooltip containing the catalogue country name or custom_tooltip.
|
Custom tooltipcustom_tooltip | Pro | stringDefault: Empty | Replace the catalogue name used by an enabled tooltip.
|
Custom captioncustom_caption | Pro | stringDefault: Empty | Replace the catalogue country name shown by an enabled caption.
|
Image borderborder | Pro | stringDefault: Empty | Apply a CSS border to an SVG Flag Image.
|
Image border radiusborder_radius | Pro | stringDefault: Empty | Apply a CSS border radius to an SVG Flag Image.
|
Image paddingpadding | Pro | stringDefault: Empty | Apply CSS padding to an SVG Flag Image.
|
Image marginmargin | Pro | stringDefault: Empty | Apply CSS margin to an SVG Flag Image.
|
Block · 8 settings
SVG Flag Grid
Render up to 100 unique valid flags in a responsive grid with optional country-name captions.
| Setting | Edition | Type and default | Purpose and accepted values |
|---|---|---|---|
Flagsflags | Free | arrayDefault: ["GB","US","CA","FR","DE","JP"] | Choose the ordered flags rendered by the grid.
|
Grid columnscolumns | Free | numberDefault: 3 | Set the responsive grid column count.
|
Grid gapgap | Free | stringDefault: 1 | Set the distance between grid items before gap_unit is appended.
|
Gap unitgap_unit | Free | stringDefault: rem | Choose the CSS unit appended to gap.
|
Flag sizesize | Free | stringDefault: 8 | Set the flag width or maximum grid-item width before the selected CSS unit is appended.
|
Size unitsize_unit | Free | stringDefault: rem | Choose the CSS unit appended to size.
|
Square aspect ratiosquare | Free | booleanDefault: false | Use the bundled 1:1 artwork instead of the default 4:3 artwork.
|
Country-name captioncaption | Free | booleanDefault: true | Show the catalogue name below a non-inline flag or each grid image.
|
Block · 19 settings
SVG Flag Heading
Render a semantic heading containing a decorative flag followed by plain heading text.
| Setting | Edition | Type and default | Purpose and accepted values |
|---|---|---|---|
Flagflag | Pro | stringDefault: {"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.
|
Flag sizesize | Pro | stringDefault: 1 | Set the flag width or maximum grid-item width before the selected CSS unit is appended.
|
Size unitsize_unit | Pro | stringDefault: em | Choose the CSS unit appended to size.
|
Square aspect ratiosquare | Pro | booleanDefault: false | Use the bundled 1:1 artwork instead of the default 4:3 artwork.
|
Country-name captioncaption | Pro | booleanDefault: false | Show the catalogue name below a non-inline flag or each grid image. This saved compatibility attribute is registered by the 0.9.7 heading block but is not consumed by its current renderer.
|
Inline displayinline | Pro | booleanDefault: true | Render a single flag inline rather than as a block-level element. This saved compatibility attribute is registered by the 0.9.7 heading block but is not consumed by its current renderer.
|
Inline vertical alignmentinline_valign | Pro | stringDefault: baseline | Align an inline flag relative to surrounding text.
|
Random flagrandom | Pro | booleanDefault: false | Choose one supported flag for each server-side render instead of using flag.
|
Element IDid | Pro | stringDefault: Empty | Add an HTML id to the rendered single-flag element. This saved compatibility attribute is registered by the 0.9.7 heading block but is not consumed by its current renderer.
|
Custom CSS classflag_class | Pro | stringDefault: Empty | Append a custom CSS class to the rendered flag element. This saved compatibility attribute is registered by the 0.9.7 heading block but is not consumed by its current renderer.
|
Country tooltiptooltip | Pro | booleanDefault: false | Add a title tooltip containing the catalogue country name or custom_tooltip. This saved compatibility attribute is registered by the 0.9.7 heading block but is not consumed by its current renderer.
|
Custom tooltipcustom_tooltip | Pro | stringDefault: Empty | Replace the catalogue name used by an enabled tooltip. This saved compatibility attribute is registered by the 0.9.7 heading block but is not consumed by its current renderer.
|
Custom captioncustom_caption | Pro | stringDefault: Empty | Replace the catalogue country name shown by an enabled caption. This saved compatibility attribute is registered by the 0.9.7 heading block but is not consumed by its current renderer.
|
Image borderborder | Pro | stringDefault: Empty | Apply a CSS border to an SVG Flag Image. This saved compatibility attribute is registered by the 0.9.7 heading block but is not consumed by its current renderer.
|
Image border radiusborder_radius | Pro | stringDefault: Empty | Apply a CSS border radius to an SVG Flag Image. This saved compatibility attribute is registered by the 0.9.7 heading block but is not consumed by its current renderer.
|
Image paddingpadding | Pro | stringDefault: Empty | Apply CSS padding to an SVG Flag Image. This saved compatibility attribute is registered by the 0.9.7 heading block but is not consumed by its current renderer.
|
Image marginmargin | Pro | stringDefault: Empty | Apply CSS margin to an SVG Flag Image. This saved compatibility attribute is registered by the 0.9.7 heading block but is not consumed by its current renderer.
|
Heading levelheading_tag | Pro | stringDefault: h2 | Choose the semantic HTML heading element that wraps the Pro flag heading.
|
Heading textheading | Pro | stringDefault: Empty | Set the plain-text content displayed after the decorative flag in a Pro heading.
|
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]
Render one CSS-backed flag. The svg-flags alias remains supported for established content.
Aliases: [svg-flags]
[svg-flag]| Attribute | Edition | Type and default | Purpose and accepted values |
|---|---|---|---|
Flagflag | Free | stringDefault: {"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.
|
Flag sizesize | Free | stringDefault: 5 | Set the flag width or maximum grid-item width before the selected CSS unit is appended.
|
Size unitsize_unit | Free | stringDefault: em | Choose the CSS unit appended to size.
|
Square aspect ratiosquare | Free | booleanDefault: false | Use the bundled 1:1 artwork instead of the default 4:3 artwork.
|
Country-name captioncaption | Free | booleanDefault: false | Show the catalogue name below a non-inline flag or each grid image.
|
Inline displayinline | Free | booleanDefault: false | Render a single flag inline rather than as a block-level element.
|
Inline vertical alignmentinline_valign | Free | stringDefault: middle | Align an inline flag relative to surrounding text.
|
Random flagrandom | Free | booleanDefault: false | Choose one supported flag for each server-side render instead of using flag.
|
Element IDid | Pro | stringDefault: Empty | Add an HTML id to the rendered single-flag element.
|
Custom CSS classflag_class | Pro | stringDefault: Empty | Append a custom CSS class to the rendered flag element.
|
Country tooltiptooltip | Pro | booleanDefault: false | Add a title tooltip containing the catalogue country name or custom_tooltip.
|
Custom tooltipcustom_tooltip | Pro | stringDefault: Empty | Replace the catalogue name used by an enabled tooltip.
|
Custom captioncustom_caption | Pro | stringDefault: Empty | Replace the catalogue country name shown by an enabled caption.
|
Shortcode · 17 attributes
[svg-flag-image]
Render one lazy-loaded SVG image with meaningful alternative text.
[svg-flag-image]| Attribute | Edition | Type and default | Purpose and accepted values |
|---|---|---|---|
Flagflag | Free | stringDefault: {"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.
|
Flag sizesize | Free | stringDefault: 5 | Set the flag width or maximum grid-item width before the selected CSS unit is appended.
|
Size unitsize_unit | Free | stringDefault: em | Choose the CSS unit appended to size.
|
Square aspect ratiosquare | Free | booleanDefault: false | Use the bundled 1:1 artwork instead of the default 4:3 artwork.
|
Country-name captioncaption | Free | booleanDefault: false | Show the catalogue name below a non-inline flag or each grid image.
|
Random flagrandom | Free | booleanDefault: false | Choose one supported flag for each server-side render instead of using flag.
|
Inline displayinline | Free | booleanDefault: false | Render a single flag inline rather than as a block-level element.
|
Inline vertical alignmentinline_valign | Free | stringDefault: middle | Align an inline flag relative to surrounding text.
|
Element IDid | Pro | stringDefault: Empty | Add an HTML id to the rendered single-flag element.
|
Custom CSS classflag_class | Pro | stringDefault: Empty | Append a custom CSS class to the rendered flag element.
|
Country tooltiptooltip | Pro | booleanDefault: false | Add a title tooltip containing the catalogue country name or custom_tooltip.
|
Custom tooltipcustom_tooltip | Pro | stringDefault: Empty | Replace the catalogue name used by an enabled tooltip.
|
Custom captioncustom_caption | Pro | stringDefault: Empty | Replace the catalogue country name shown by an enabled caption.
|
Image borderborder | Pro | stringDefault: Empty | Apply a CSS border to an SVG Flag Image.
|
Image border radiusborder_radius | Pro | stringDefault: Empty | Apply a CSS border radius to an SVG Flag Image.
|
Image paddingpadding | Pro | stringDefault: Empty | Apply CSS padding to an SVG Flag Image.
|
Image marginmargin | Pro | stringDefault: Empty | Apply CSS margin to an SVG Flag Image.
|
Shortcode · 8 attributes
[svg-flag-grid]
Render a validated, deduplicated grid of up to 100 flags.
[svg-flag-grid]| Attribute | Edition | Type and default | Purpose and accepted values |
|---|---|---|---|
Flagsflags | Free | arrayDefault: ["GB","US","CA","FR","DE","JP"] | Choose the ordered flags rendered by the grid.
|
Grid columnscolumns | Free | numberDefault: 3 | Set the responsive grid column count.
|
Grid gapgap | Free | stringDefault: 1 | Set the distance between grid items before gap_unit is appended.
|
Gap unitgap_unit | Free | stringDefault: rem | Choose the CSS unit appended to gap.
|
Flag sizesize | Free | stringDefault: 8 | Set the flag width or maximum grid-item width before the selected CSS unit is appended.
|
Size unitsize_unit | Free | stringDefault: rem | Choose the CSS unit appended to size.
|
Square aspect ratiosquare | Free | booleanDefault: false | Use the bundled 1:1 artwork instead of the default 4:3 artwork.
|
Country-name captioncaption | Free | booleanDefault: true | Show the catalogue name below a non-inline flag or each grid image.
|
Shortcode · 8 attributes
[svg-flag-heading]
Render a semantic heading with a decorative flag image.
[svg-flag-heading]| Attribute | Edition | Type and default | Purpose and accepted values |
|---|---|---|---|
Flagflag | Pro | stringDefault: {"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.
|
Flag sizesize | Pro | stringDefault: 1 | Set the flag width or maximum grid-item width before the selected CSS unit is appended.
|
Size unitsize_unit | Pro | stringDefault: em | Choose the CSS unit appended to size.
|
Square aspect ratiosquare | Pro | booleanDefault: false | Use the bundled 1:1 artwork instead of the default 4:3 artwork.
|
Inline vertical alignmentinline_valign | Pro | stringDefault: middle | Align an inline flag relative to surrounding text.
|
Random flagrandom | Pro | booleanDefault: false | Choose one supported flag for each server-side render instead of using flag.
|
Heading textheading | Pro | stringDefault: Empty | Set the plain-text content displayed after the decorative flag in a Pro heading.
|
Heading levelheading_tag | Pro | stringDefault: h2 | Choose the semantic HTML heading element that wraps the Pro flag heading.
|
Developer API
Developer filters
These WordPress filters are public extension points. Return the same value type described for each filter.
svg_flag_shortcode_custom_flagFreeFilter 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_tagFreeFilter 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_idFreeFilter 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_classFreeFilter 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_textFreeFilter 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_attributeFreeFilter 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_attributeFreeFilter 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_attributeFreeFilter 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_flagFreeFilter 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_styleFreeFilter the image display declaration.
- Value
string- Parameters
- $style — display declaration; $atts — resolved attributes
- Return
- CSS declaration string
svg_flag_image_shortcode_idFreeFilter 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_textFreeFilter 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_attributeFreeFilter image classes; Pro appends flag_class here.
- Value
array- Parameters
- $classes — class list; $atts — resolved attributes
- Return
- Class list
svg_flag_image_shortcode_style_attributeFreeFilter 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_attributeFreeFilter 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_flagsFreeFilter 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_item_htmlFreeFilter 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_heading_shortcode_custom_flagProFilter 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_attributeProFilter 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_attributeProFilter 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_idProFilter the Pro heading id attribute.
- Value
string- Parameters
- $id — empty by default; $atts — resolved attributes
- Return
- Sanitised id attribute or empty string