Documentation · Developer Documentation
Shortcodes For Developers
This document lists every shortcode registered by the ADP Car Market Hub plugin, including the supported attributes, the rendered output, and the feature toggles that affect availability. Use it as the reference when embedding plugin content inside pages, posts or custom block layouts.
When to use this document
Read this document when you need to:
- Embed the vehicle archive, comparison page, search filter, favorites list, or location/hours blocks inside a regular WordPress page.
- Build a custom landing page that uses one of these shortcodes with pre-filled attributes.
- Confirm which feature toggle disables which shortcode.
For the templates these shortcodes load, see Template System And Overrides. For the post types they query, see Custom Post Types And Taxonomies.
Overview
The plugin registers six shortcodes. Three render the public catalogue (archive, search filter, comparison page); one renders the customer-facing favorites/wishlist; and two render seller location information for the current vehicle.
The shortcodes themselves are the supported, stable public interface. The internal classes that register them and the WordPress hook used for registration are implementation details and are not documented here.
Requirements or prerequisites
- The plugin must be active.
- At least one published vehicle for the catalogue and comparison shortcodes to produce useful output.
- The relevant feature toggle must be enabled in the plugin's admin UI (see the table below).
- For the comparison shortcode, a comparison page (containing
[as24ci_compare]) must exist. The plugin creates one on activation. - For the favorites shortcode, the public REST API toggle must be enabled from the plugin's admin UI so the favorites endpoint is reachable.
Shortcode reference
[as24ci_archive]
Renders the same vehicle list as the public archive (/cars/), including filters, sorting, and pagination. Use this shortcode to embed the catalogue inside any regular WordPress page or block layout.
Attributes
| Attribute | Allowed values | Notes |
|---|---|---|
make | string | Pre-filter by make. |
model | string | Pre-filter by model. |
price_min | integer | Lower price bound. |
price_max | integer | Upper price bound. |
fuel | string | Pre-filter by fuel type. |
body | string | Pre-filter by body type. |
order_by | price, mileage, date | Sort column. |
order | asc, desc | Sort direction. |
per_page | 12, 24, 48, 72, all | Page size. |
GET parameters provided by the visitor (filters, sort, pagination) override the shortcode attributes, so the embedded list still behaves as a fully interactive archive.
Feature gate: none (the shortcode is always registered).
[as24ci_compare]
Renders the vehicle comparison page. Vehicles are selected by visitors through compare buttons in the catalogue and stored client-side; this shortcode displays the comparison table for the current selection.
Attributes: none.
Feature gate: requires the compare feature to be enabled in the plugin's admin UI.
[as24ci_search_filter]
Renders the search filter form on its own (without the result list). Use it to build a dedicated search landing page that posts results to a separate page (for example a page that contains [as24ci_archive]).
Attributes
| Attribute | Allowed values | Notes |
|---|---|---|
results_url | URL | Page that will receive the submitted search criteria. |
Feature gate: none.
[as24ci_favorites]
Renders the customer-facing favorites/wishlist page. Favorites are stored client-side and synchronised through the plugin's REST endpoint when the REST API is enabled.
Attributes: none.
Feature gate: requires the favorites feature and the public REST API to be enabled in the plugin's admin UI.
[as24ci_location_box]
Renders a location/contact information box for a vehicle. Inside a single vehicle template the box uses the current vehicle's seller; on other pages, supply a post_id.
Attributes
| Attribute | Allowed values | Notes |
|---|---|---|
post_id | integer | Vehicle post ID. Defaults to the current post when used inside a single-vehicle template. |
Feature gate: none, but the displayed information depends on the locations and dealer-profile data configured from the admin.
[as24ci_hours_box]
Renders the opening-hours box for the location associated with a vehicle. Same selection rule as [as24ci_location_box].
Attributes
| Attribute | Allowed values | Notes |
|---|---|---|
post_id | integer | Vehicle post ID. Defaults to the current post when used inside a single-vehicle template. |
Feature gate: none. Output depends on the configured locations.
Step by step instructions
Build a dedicated search landing page
- Create a new WordPress page that will display the results — for example a page named "Browse cars" that contains
[as24ci_archive]. - Create another page that will host the search form — for example "Find a car".
- Add
[as24ci_search_filter results_url="/browse-cars/"]to the search page. - Publish both pages and link to "Find a car" from your menu.
Embed a curated list of vehicles
- On the page where you want the list, add
[as24ci_archive make="BMW" body="SUV" order_by="price" order="asc" per_page="12"]. - Publish the page. Visitors can still refine the list using the displayed filters; their selections override the shortcode's defaults.
Show the favorites page
- Create a "My favorites" page.
- Add
[as24ci_favorites]and publish. - Confirm that the favorites and REST features are both enabled in the plugin settings.
Operational notes
- Asset enqueueing. When a shortcode is detected on a page, the plugin's asset loader enqueues the matching front-end assets automatically.
- Feature toggles. Disabling the corresponding feature from the admin UI prevents the shortcode's UI from appearing or, in the case of
[as24ci_compare], suppresses the compare scripts even though the shortcode itself remains registered. - Render context.
[as24ci_location_box]and[as24ci_hours_box]rely on a vehicle context. When called outside of a single-vehicle template, always passpost_id. - Layout manager. The vehicle archive and the single-vehicle layout are also affected by the plugin's layout manager, configured from the admin UI. Embedding
[as24ci_archive]re-uses the same layout configuration. - Caching. If you use a full-page cache, ensure it does not strip the dynamic markup or the inline data attributes used by the favorites and compare scripts.
- Customisation. Prefer overriding theme-overridable templates (see Template System And Overrides) before forking the underlying plugin templates.
Troubleshooting
- Empty list when using
[as24ci_archive]. Make sure there are published vehicles, and that any restrictive attributes (make,model,price_min,price_max,fuel,body) are not over-filtering the result. Visitor GET parameters override shortcode defaults — try the page in a private window with a clean URL. [as24ci_compare]shows nothing. Confirm that the compare feature is enabled in the admin and that the visitor has actually selected vehicles to compare. The selection is client-side, so different browsers see different lists.[as24ci_search_filter]does not redirect to the right page. Confirm theresults_urlattribute is set to a valid URL on your site. If absent, the form submits to the current page and may show no results unless the page also contains[as24ci_archive].[as24ci_favorites]works locally but not on staging. Confirm the public REST API is enabled in the plugin's admin UI and reachable, and that no security plugin is blocking the plugin's REST namespace.- Location or hours box is empty. Verify that the vehicle's seller has location data and dealer-profile fields configured.
- Verify behaviour in the current plugin version before publishing a custom integration. Shortcode attributes and rendered markup can evolve between releases.