WHA Docs
Development

Custom Post Types

All custom post types, their data models, relationships and how they're used across the site.

Overview

WHA registers most of its content types as custom post types, each from a dedicated mu-plugin in src/wp-content/mu-plugins/wha-*. The model system (the yax-model mu-plugin) gives each plugin a fluent builder API to declare its post type, taxonomies and metaboxes.

A few wha-* plugins aren't post types. wha-articles relabels WordPress's built-in Posts as "Articles" and adds taxonomies to them (see Articles below). wha-provider-ratings and wha-doctorcom-sync are data integrations (see Data integrations). Two others ship disabled (wha-national-provider-identifier, wha-photo-sync).

Core content types

Providers (wha_providers)

The most complex post type. Each provider has a detail page with bio, specialties, locations, ratings and an interactive map.

FieldSourceNotes
Name, bio, photoPost content + ACFStandard post fields + custom fields
SpecialtiesACF relationshipLinks to wha_services
LocationsACF relationshipLinks to wha_locations
Ratings{prefix}provider_ratings tablesSynced from Press Ganey via wha-provider-ratings (keyed by NPI)
NPIACF fieldNational Provider Identifier

URL pattern: /providers/{slug}/

Listing behavior: The provider archive at /providers/ renders cards client-side via AJAX, not server-side PHP. The flow:

  1. Page loads with skeleton cards (card.provider.skeleton.php)
  2. JS fetches provider data via AJAX (functions/api/providers.php)
  3. Cards populate from the card.provider.dynamic.php template

Templates: single-wha_providers.php, taxonomy-post_providers.php

Locations (wha_locations)

Physical office locations with addresses, hours, phone numbers and interactive maps.

FieldSourceNotes
Address, contactACF fieldsAddress formatted by yax_format_address(); contact is a repeater of type/number rows (phone, fax)
HoursACF repeaterDay/time pairs, formatted by yax_format_hours()
MapAuto-geocodedCoordinates geocoded from the address via Mapbox on save — no manual lat/lng field
Associated providersACF relationshipReverse lookup from providers

URL pattern: /locations/{slug}/

Templates: single-wha_locations.php, taxonomy-post_locations.php

Services (wha_services)

Medical services and specialties offered by WHA.

FieldSourceNotes
DescriptionPost content + ACFService detail content
Related providersACF relationshipProviders who offer this service
Life stage associationsACF relationshipWhich life stages this service applies to

URL pattern: /services/{slug}/

Templates: single-wha_services.php, taxonomy-post_services.php

Life Stages (wha_life_stages)

Content organized by patient life stage (e.g., teens, pregnancy, menopause).

FieldSourceNotes
DescriptionPost content + ACFLife stage overview
Related servicesACF relationshipServices relevant to this life stage
ResourcesACF relationshipLinks to wha_resources

URL pattern: Uses custom template single-wha_life_stages.php

Templates: single-wha_life_stages.php, taxonomy-post_life_stages.php

News (wha_news)

Blog posts and news articles.

URL pattern: Archive at /news/, singles at standard WordPress permalink

Templates: archive-wha_news.php, single-wha_news.php

Supporting content types

Topics (wha_topics)

Health topics with associated terminology and educational content. Loaded via AJAX with tabbed content interface.

Insurance (wha_insurance)

Insurance plans accepted by WHA. Displayed via the insurance section component.

Resources (wha_resources)

Downloadable resources, guides and educational materials for patients.

Appointments (wha_appointments)

Appointment types and scheduling information. Has a dedicated template at appointments.php.

Articles

Articles aren't a custom post type. wha-articles renames WordPress's built-in Posts to "Articles" in the admin and attaches four taxonomies to them: Services, Life Stages, Locations and Providers (under /articles/...). They're the long-form educational content, separate from the timely wha_news posts.

Provider attribution runs through the Providers taxonomy (post_providers): a term links to a provider post via an ACF related_post field, which relates articles and providers across the site (see wha_get_attributed_provider_ids() in the Developer Reference).

Did You Know (wha_did_you_know)

Quick health facts displayed in callout components throughout the site.

Utility post types

Search Terms (wha_search_terms)

Custom search term mappings to improve internal search relevance.

Tooltips (wha_tooltips)

Medical terminology tooltips that can be referenced inline in content.

Protected Content (wha_protected_content)

Content that requires authentication or specific user roles to access.

Data integrations (not post types)

These two wha-* plugins handle external data sync and don't register a custom post type:

Provider Ratings (wha-provider-ratings)

Patient satisfaction ratings and comments fetched from the Press Ganey API (by NPI) and stored in custom tables ({prefix}provider_ratings, provider_ratings_comments, provider_ratings_questions). It registers a provider_ratings audit-log object type, not a post type. Ratings show via the stars.php UI component on provider detail pages and the provider-ratings section component.

Doctor.com Sync (wha-doctorcom-sync)

Syncs provider and location profile data from Doctor.com into the wha_providers / wha_locations post types. Provides admin sync pages (Providers → Doctor.com) and a scheduler; tracks status via the doctorcom_sync audit-log object type.

Data relationships

Most relationships are stored as ACF relationship fields. The data handlers in functions/data/ provide helper functions for querying them, and functions/queries.wha.php has WHA-specific helpers for common lookups like "all providers at a location" or "all services for a life stage." See the Developer Reference for query examples.

On this page