Shortcodes Reference (Developers)¶
Technical reference for DMS's text shortcodes: attributes, context requirements, and output. For plain-language usage aimed at site admins, see the end-user shortcode guide.
Many shortcodes require listing context - they read dms_get_current_listing(), which is only set inside the SRP loop or on a VDP. Used outside that context they output an empty string. Each entry notes its context requirement.
Listing Data¶
[dms_get_listing_value]¶
Outputs the selected value of a category (a structured attribute) for the current listing. File-type categories render as a download link.
| Attribute | Default | Description |
|---|---|---|
category |
'' |
Category ID or slug to read. Numeric strings are treated as IDs. |
Context: current listing. Falls back to the category's configured default value when the listing has no value. Filterable via dms_get_listing_value_shortcode.
[dms_get_meta_value]¶
Outputs a raw post-meta value for the current listing. Use for meta not modelled as a category.
| Attribute | Default | Description |
|---|---|---|
meta |
'' |
The post-meta key. |
Context: current listing.
[dms_get_views]¶
Outputs the view count for the current listing.
| Attribute | Default | Description |
|---|---|---|
type |
unique |
unique or total. |
Context: current listing.
Counts & Labels¶
[dms_get_total_listings]¶
Outputs the total number of listings, wrapped in <span class="dms-total-listings">.
Context: standalone. No attributes.
[dms_get_number_of_results]¶
Outputs the number of listings matching a specific term, optionally with a singular/plural suffix.
| Attribute | Default | Description |
|---|---|---|
term |
'' |
Term ID or slug to count. |
type |
'' |
Inventory type ID or slug to scope the count. |
singular |
'' |
Word appended when the count is 1. |
plural |
'' |
Word appended when the count is not 1. |
Context: standalone (runs its own query).
[dms_get_singular_plural]¶
Outputs the current inventory type's singular or plural label based on the current SRP result count. Emits a <span> with data-singular-text / data-plural-text for live JS updates.
| Attribute | Default | Description |
|---|---|---|
lowercase |
false |
Lowercase the output when truthy. |
Context: SRP.
Pricing (Fees & Discounts)¶
All pricing shortcodes read the current listing. Each accepts raw="1" to output the bare number instead of the currency-formatted string.
[dms_final_price]¶
Price after all fees and discounts.
| Attribute | Default | Description |
|---|---|---|
raw |
'' |
1 outputs the unformatted float. |
[dms_fees_total] / [dms_discounts_total]¶
Sum of applicable fees / discounts for the current listing.
| Attribute | Default | Description |
|---|---|---|
raw |
'' |
1 outputs the unformatted float. |
[dms_listing_fee] / [dms_listing_discount]¶
Output a single named fee/discount line item. Outputs nothing if the item doesn't exist, is disabled, or is the wrong kind (a fee ID won't render as a discount and vice-versa).
| Attribute | Default | Description |
|---|---|---|
id |
'' |
The fee/discount reference ID (required). |
raw |
'' |
1 outputs the unformatted float. |
label |
'' |
1 prefixes the value with the item's name (Doc Fee: $499). |
Context: current listing. See the Listings API for the equivalent PHP methods (get_final_price(), get_fees_total(), etc.).
Registering Your Own Shortcode¶
DMS keeps a registry so your shortcode can participate in the page builder element list:
For a plain WordPress shortcode, add_shortcode() works too - the DMS registry is only needed for builder/Elementor integration.
Elementor / Builder Elements¶
Beyond the text shortcodes above, DMS registers a large set of builder elements (used as Elementor widgets and internally as shortcode classes) covering listing display, SRP filters, forms, and comparison. These are configured visually in the page builder rather than hand-written, and include:
- Listing display - title, image, slideshow, info table, pricing, pricing table, overview, tabs, badge, video, map.
- SRP - listings grid, dropdown filters, pagination, order-by, view selector, search input, compare buttons, result matching.
- Filters - range filter, checkboxes, radio, color, image, term toggle, reset button.
- Forms - text, search, select, textarea, radio, checkbox, consent, file, captcha, category dropdown, UTM hidden, signature, submit, reset.
- General - comparison, scroller, form, category links, map, breadcrumbs, attribution, stock alert.
Per the project standard, DMS Elementor elements use containers only (never sections/columns). Building custom Elementor elements is out of scope for this reference - extend via the registrar helpers in Building Extensions.
See also¶
- Using Shortcodes - plain-language guide for admins.
- Listings API - the PHP equivalents of these shortcodes.