Community statistics presentation adapter for cl-reso-link.
Stats endpoint behavior, market/statistical meaning, and canonical geo context authority live in ../cl-reso-link/docs/DOCS_AUTHORITY.md. This README is the local usage and presentation guide for cl-community-stats.
- SSR-first rendering for Bricks and shortcodes via shared presenter:
includes/class-community-stats-presenter.php - Presentation-only plugin: no MLS/statistical calculations are performed here
- Canonical stats authority remains
cl-reso-link
Accepted context inputs:
geo_shape_id/geo_shape_id_input(preferred)community/community_input(fallback)community_key/community_key_input(legacy fallback)
Resolution precedence is strict:
geo_shape_id -> community -> community_key
Only the highest-precedence valid context param is sent to:
GET /wp-json/cl-reso-link/v1/stats/community
median_list_pricemedian_sale_pricesale_to_list_ratiomonths_of_inventoryactive_listing_countclosed_sales_count
geo_shape_id_inputcommunity_inputcommunity_key_input(legacy savedcommunity_keystill supported)months(1..60, default12)metrics(multi-select)display_mode:cards,inline,list,singlemetric(single-mode metric)show_label(true/false)number_format(default/compact)empty_state(hide/message)
Grouped modes:
.cl-community-stats.cl-community-stats--cards.cl-community-stats--inline.cl-community-stats--list.cl-community-stats__item.cl-community-stats__value.cl-community-stats__label.cl-community-stats__empty
Single metric mode:
.cl-community-stat.cl-community-stat--{metric-slug}.cl-community-stat__value.cl-community-stat__label
Grouped stats:
[cl_community_stats geo_shape_id="mount_pleasant" metrics="median_sale_price,months_of_inventory"]
Single stat:
[cl_community_stat geo_shape_id="mount_pleasant" metric="median_sale_price"]
Single stat value-only:
[cl_community_stat geo_shape_id="mount_pleasant" metric="median_sale_price" output="value"]
Optional shortcode attrs:
months(default12)empty_state(hide/message)show_label(true/false, single mode)number_format(default/compact; price metrics only)display_mode(cards/inline/list/single, grouped shortcode)metric(for grouped shortcode whendisplay_mode="single")output(full/value;valueapplies to single-stat rendering)
Presentation-only formatting:
- price metrics as currency (
default) or compact currency (compact, e.g.$858k,$1.4m) sale_to_list_ratioas percentagemonths_of_inventoryas decimal- counts as formatted integers
Missing/null metrics are hidden. Values are never invented.