Skip to content

Listdom Developer Best Practices Documentation

Practical guidance backed by source patterns

Section titled “Practical guidance backed by source patterns”

These recommendations are derived from observed core behavior and extension points in extracted data.

  1. Initialize on listdom_loaded

    • Core emits this action after initialization.
  2. Use hooks/filters, not core file patches

    • Prefer extension points like lsd_template, lsd_addons, and API lifecycle hooks.
  3. Follow API auth contract exactly

    • Send lsd-token for API token checks.
    • Send lsd-user for user-protected routes.
  4. Match sanitization/escaping patterns

    • Use sanitization before persistence and escaped output in UI contexts.
  5. Prefer theme template overrides

    • Override in /wp-content/themes/{theme}/listdom/... rather than editing plugin templates.
  6. Integrate with existing JS event contracts

    • listdom:modal:opened, listdom:modal:closed, lsd-autocomplete-select, lsd-mapsearch.