Guide

Quote Sorter architecture

Bootstrap class PRC\Platform\PRC_Quote_Sorter\Bootstrap in includes/class-plugin.php registers REST, query vars, block context, and block PHP from src/*/.

Blocks

BlockNamespace
Controllerprc-block/quote-sorter
Quote templateprc-block/quote-sorter-quote-template
Quote text / attribution / labelprc-block/quote-sorter-quote-text, …-attribution, …-label
Filterprc-block/quote-sorter-filter
Dynamic textprc-block/quote-sorter-dynamic-text

Controller provides context: prc-quote-sorter/quote-sorter-hash (sorterId), categories, typologies, and selected options on load. filteredValues query var is merged into block context for filter/template/controller blocks.

Data store

Custom table {prefix}prc_quote_sorter (includes/class-database.php): columns id, hash, quotes. Rows are keyed by MD5 of the JSON quote payload. Quote_Data shapes records for retrieve.

Editor CSV upload (src/controller/dropzone.jsx) POSTs to submit; the template editor GETs retrieve by hash.

Interactivity

Controller and template use the Interactivity API (interactiveNamespace prc-block/quote-sorter). Default insert template includes a search prc-block/form-input-text and a quote template.

Was this helpful?