Custom Func
Headless site functionality plugin for abcnorio.org.
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/madeofpeople/abcnorio-func/archive/refs/heads/main.zipCustom functionality plugin
This plugin is Composer-first, PSR-4 autoloaded, and structured around declarative content model definitions plus small registrar classes. It is used with Bedrock and provides the site's custom post types, taxonomies, headless admin behavior, and other sundries.
Component Ingestion Contract
- Source of truth for web component fixtures/assets is
node_modules/abcnorio-webcomponents/dist. - Plugin-owned runtime artifacts are copied to
resources/vendor/components/distduringnpm run build. - Runtime PHP reads fixtures/assets only from plugin-local path (
resources/vendor/components/dist). - Runtime CSS is enqueued as a static plugin URL from that same plugin-local path.
- Contract is fail-loud: missing dist/manifest/css is a hard error.
Component dep enqueue
manifest.components[name].depsis a flat array of relative dist paths for transitive CSS/JS deps declared in fixture metadata.ComponentIngestor::enqueue_component_deps(string $component_name)infers asset type from file extension and enqueues under namespaced handles:abcnorio-dep-{type}-{component}-{slug}-{hash}.- Handle is deterministic per path; WordPress deduplicates re-enqueues automatically.
ComponentIngestor::render()callsenqueue_component_depsautomatically.- Direct-query blocks (
EventListingQuery,ContentListingQuery) callenqueue_component_depsexplicitly for each component they render, including child teasers.
- Install dependencies in
abcnorio-func. - Run
npm run buildinabcnorio-func.
Content Listing Contract
- Endpoint:
GET /wp-json/abcnorio/v1/content-listing. - Allowed
post_types[]are strict and backend-limited toeventandarticle. countis backend-capped at50.time_filtersupportsall,upcoming,past(event filtering usesevent_effective_end).tags[]maps toevent_tagfor events andpost_tagfor articles (when taxonomy exists).