LotPress developer reference

Use WordPress APIs and the supported LotPress extension points so caches, capabilities, stable URLs, feed ownership, and future upgrades continue to work correctly.

Verified with Inventory 1.6.9 ยท Sync 0.4.0

Vehicle data model

Vehicles use the public lotpress_vehicle post type. Canonical structured values use _dinv_* post metadata. Make, model, year, and body style use lotpress_vehicle_make, lotpress_vehicle_model, lotpress_vehicle_year, and lotpress_vehicle_body.

Use LotPress_Inventory_Vehicle_Schema::fields() as the field contract. Store ordered gallery attachment IDs in _dinv_gallery and set the first as the post thumbnail. Sanitize YouTube values with LotPress_Inventory_Vehicle_Schema::sanitize_youtube_url().

Preserve identity and feed ownership

  • Match imported records by a trusted VIN, stock number, or _dinv_source_id.
  • Set _dinv_source, _dinv_source_id, _dinv_last_synced_at, and the current schema version.
  • Create a stable post_name for new records and do not rewrite it when vehicle values change.
  • Update only vehicles owned by the same connector source.
  • Use wp_insert_post(), update_post_meta(), and wp_set_object_terms().

LotPress Sync identifies records by Source identifier plus External ID and treats mapped values as authoritative.

Override storefront templates

Copy bundled files into the active theme at:

lotpress-inventory/archive-vehicle.php\nlotpress-inventory/single-vehicle.php\nlotpress-inventory/vehicle-card.php\nlotpress-inventory/vehicle-sections/{section-id}.php

Keep overrides under version control and compare them with plugin changes after updates. A complete Single override or Elementor Single template can bypass the native Vehicle Display layout.

Use supported hooks

  • dinv_vehicle_schema_fields: extend canonical field definitions.
  • dinv_standard_vehicle_features: change the standard feature checklist.
  • dinv_vehicle_contact_url: filter the final contact destination.
  • dinv_vehicle_saved: react after the editor saves a vehicle.
  • dinv_vdp_sections: register a movable native Vehicle Display section.
  • lotpress_inventory_vehicle_social_data: filter prepared public social-card data.

The older lotpress_inventory_vehicle_sidebar_before_contact hook remains for legacy integrations; new presentation extensions should register a VDP section.

Register Vehicle Display sections

A dinv_vdp_sections definition supports label, description, allowed regions, optional required, default_zone, default_before, replaces, and an optional render_callback. Supported regions are top, main, sidebar, and bottom.

Without a callback, the section ID maps to a theme-overridable file under lotpress-inventory/vehicle-sections/. Treat additions to the callback context as forward compatible and check optional keys before use.

Respect REST and capability boundaries

Most public vehicle fields are registered for the WordPress REST API. Full VINs, gallery attachment IDs, and connector-only metadata are intentionally excluded and should be handled by trusted server-side code.

Vehicle administration uses dedicated lotpress_vehicle/lotpress_vehicles capabilities. Custom roles must receive the precise capabilities they need; do not substitute broad Administrator access.

Extend Sync conservatively

Sync downloads remote files to temporary storage, validates the entire normalized feed before applying records, locks overlapping runs, and queues photos separately. The lotpress_sync_vehicle_applied action remains available after a vehicle is written.

Do not log raw credentials, Authorization headers, feed contents, full VIN collections, or shopper data. Preserve source identity, fingerprints, and photo ownership metadata when extending the lifecycle.

Still need help?Tell us what you are trying to accomplish and what happened.
Contact LotPress โ†’