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. |
hide_sold |
type setting | true or false. Leave empty to follow the type's "Hide sold listings" setting. |
Listings in statuses hidden from the frontend are never counted.
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.).
Embedding an SRP Built in Another Builder¶
[dms_get_page_content]¶
Renders another page's built content inside the current page. Its purpose: build a pre-filtered SRP as an Elementor page, then drop it into a page managed by a different builder (typically WPBakery) without rebuilding the SRP layout there.
| Attribute | Default | Description |
|---|---|---|
page_id |
'' |
Post ID of the page to pull in. Required. |
How the SRP keeps working: on save of the host page, a save_post handler (shortcodes.php dms_page_content_save_post()) scans the content, and if the referenced page is an SRP (dms_srp meta set) it mirrors that page's dms_srp and dms_srp_options onto the host page (tracked with _dms_page_content_srp_source, the only meta it will later delete). The queried page is then a real SRP as far as dms_type_match_page(), Conditionals, Listing\Query and the AJAX filter/pagination endpoints are concerned - all of which read that meta from the queried object.
Notes / limits:
- Save the host page after adding or changing the shortcode - the meta mirror runs on save, not on render.
- One SRP per page still applies. Do not combine with a
[dms_srp_<type>]shortcode on the same page. - Pre-filters are configured on the Elementor SRP element ("Pre-Filtered Values" section), not on this shortcode.
- The source page can stay
privateordraft- it is rendered directly from its Elementor data, not through the public template. - Non-Elementor source pages fall back to
apply_filters( 'the_content', ... ). - Self-referential embeds (a page pulling itself, directly or via a loop) are guarded and render nothing.
- Misconfiguration (missing/invalid
page_id) shows an inline notice to logged-in editors only.
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.