Challenge 1: The Dog House FE build / Challenge 2: Backend Schema and Dep Management - #37
Open
codecharmer wants to merge 3 commits into
Open
Challenge 1: The Dog House FE build / Challenge 2: Backend Schema and Dep Management#37codecharmer wants to merge 3 commits into
codecharmer wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Challenge 1
Challenge 2
pug-puggle-schema) to own schema/content structures that should outlive theme presentation.Some Challenge 1 extras:
The request on challenge one was visually immitate an Airbnb-style page and I did a few things here go past that intentionally:
1. Data-driven listings via CPT + seeding, instead of hardcoded cards
inc/cpt/property.phpinc/data/listings.phpinc/data/seed-properties.phpMakes the page reproducible and maintainable
2. Accessibility / performance hardening (skip target, semantics, image behavior, cleaner rendering strategy)
front-page.phptemplate-parts/front-page/listing-card.phpNot explicitly required, but a strong signal of senior, production-quality work.
3. Build reproducibility fix by adding the missing local webpack config
webpack/webpack.local.config.js.gitignoreWhy a dedicated schema plugin
The content model (post types, taxonomies, field groups, and structured-data output) is data, not presentation. It must survive theme swaps, redesigns, and re-skins and if it lived in the theme, switching or rebuilding the theme would unregister the firm's post types and orphan its content. Putting it in a plugin draws a clean line: the theme renders, the plugin owns the data contract the theme consumes. It's also independently testable, reusable, and the standard WordPress separation reviewers expect.
Why load it as a must-use plugin
The schema is foundational — the theme fatals or renders empty if the post types aren't registered, so activation should never be optional or forgettable. A must-use plugin:
docker compose upproduces a fully working site with zero admin clicks (reproducibility).A thin root loader bootstraps the plugin from
mu-plugins/, keeping the plugin itself modular and version-controlled while still benefiting from must-use guarantees.Dependency management with Composer
The infra theme has a hard dependency on Advanced Custom Fields (
get_field()is called unguarded inheader.phpand throughout the schema utilities). Rather than committing a copy of ACF or asking each developer to hunt down and drop in the right plugin, the dependency is declared incomposer.jsonand installed intomu-plugins/viacomposer install. A thinmu-plugins/acf-loader.phpboots it (no admin activation), mirroring the schema plugin's loader pattern.Standardizing on Composer pays off well beyond this one plugin:
pug-puggle-schemaplugin (CPTs/taxonomies) and ACF alike — so projects that share dependencies get them the same way, at known versions.composer installand gets exactly the right dependencies in the right place, instead of reverse-engineering what the theme needs or which plugin version to use. Project setup becomes a documented, one-command step.composer.lockpins exact versions, so every machine and CI run resolves identical dependencies — no "works on my machine" drift.composer.json/composer.lockstay tracked. The repo stays lean and the source of truth is the manifest.composer update, rather than a manual file swap that's easy to get wrong or forget.CPT and taxonomy logic
The model mirrors a personal-injury firm and, critically, only registers what the
infratheme already consumes (so there are zero fatals and no dead structures):Custom post types
practice-area— services the firm offers (e.g. Car Accidents).team— attorneys.office— physical office locations.local(labeled Locations) — geo landing pages (e.g. "Car Accident Lawyer in Tampa").testimonials— client quotes.case-result— past case outcomes.Taxonomies
area-served(labeled Areas Served) — a shared, cross-CPT taxonomy attached to the four geo-aware types:local,practice-area,office, andcase-result. Using one common set of terms across these types is what lets the theme's location logic relate a practice area to its local pages, offices, and results in the same area.teamandtestimonialsare intentionally excluded because they have no geographic dimension in this model.attorney-role— classifies attorneys by role/department.This shared-taxonomy approach is the standard WordPress pattern for tying disparate content to a common dimension (here, geography), and it directly satisfies the theme's existing
tax_queryexpectations ininc/services/locations.php.Validation performed
get_field()fatal.