diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 765921f..c52fbf0 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -69,7 +69,11 @@ peptide-repo-core/ │ ├── class-pr-core-seed-data.php # Dev fixture: 3 peptides, 10 dosing rows, 5 legal cells │ │ │ ├── cpt/ -│ │ └── class-pr-core-peptide-cpt.php # CPT + peptide_category registration (guarded), meta fields, sanitizers +│ │ ├── class-pr-core-peptide-cpt.php # CPT + peptide_category registration (guarded), meta fields, sanitizers +│ │ └── class-pr-core-repo-daily-cpt.php # Repo Daily CPT registration for editorial content +│ │ +│ ├── taxonomies/ +│ │ └── class-pr-core-repo-daily-taxonomy.php # repo_daily_category taxonomy + term seeding │ │ │ ├── migrations/ │ │ ├── class-pr-core-migration-runner.php # Sequential migration engine @@ -90,10 +94,11 @@ peptide-repo-core/ │ │ └── class-pr-core-candidate-queue-repository.php # CRUD + approve/reject for queue │ │ │ ├── admin/ -│ │ ├── class-pr-core-admin.php # Admin initialization, menu, styles -│ │ ├── class-pr-core-peptide-metaboxes.php # Identifiers, dosing, legal meta boxes -│ │ ├── class-pr-core-admin-columns.php # Evidence, editorial, dosing count columns -│ │ └── class-pr-core-candidate-queue-page.php # AI candidate review admin screen +│ │ ├── class-pr-core-admin.php # Admin initialization, menu, styles +│ │ ├── class-pr-core-peptide-metaboxes.php # Identifiers, dosing, legal meta boxes +│ │ ├── class-pr-core-repo-daily-metaboxes.php # Author byline and clinical review flag meta boxes +│ │ ├── class-pr-core-admin-columns.php # Evidence, editorial, dosing count columns +│ │ └── class-pr-core-candidate-queue-page.php # AI candidate review admin screen │ │ │ ├── frontend/ │ │ ├── class-pr-core-disclaimer.php # Shortcode + static API for surface disclaimers @@ -110,6 +115,17 @@ peptide-repo-core/ --- +## Content Types + +| CPT | Slug | Taxonomy | Purpose | Registrant | +|-----|------|----------|---------|-----------| +| `peptide` | `/peptides/[slug]/` | `peptide_category` | Canonical peptide monographs with dosing, legal, evidence metadata | PR Core v0.2.0 (consolidated from PSA) | +| `repo_daily` | `/daily/[slug]/` | `repo_daily_category` | Editorial publications (articles, guides, comparisons, news) generated by PRAutoBlogger, published under Boo Sheeran byline | PR Core v0.5.0 | + +**Verification scanner scope:** The verification scanner (class-pr-core-verification-scanner.php) queries `post_type=peptide` only. `repo_daily` posts are excluded automatically by CPT separation and do not appear in the overdue queue. + +--- + ## Custom Tables ### `{prefix}pr_dosing_rows` diff --git a/CHANGELOG.md b/CHANGELOG.md index 21620fe..48789b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,29 @@ All notable changes to Peptide Repo Core are documented here. Format: [Semantic Versioning](https://semver.org/). +## [0.5.0] — 2026-04-27 + +### Added +- **Repo Daily CPT**: New `repo_daily` custom post type at `/daily/[slug]/` for editorial publications (articles, guides, comparisons, news) generated by PRAutoBlogger and published under the Boo Sheeran byline. +- **Repo Daily Category Taxonomy**: Non-hierarchical `repo_daily_category` taxonomy with four seeded terms (article, guide, comparison, news) for editorial classification. +- **Repo Daily Meta Fields**: + - `_repo_daily_author` (string, default "Boo Sheeran") — byline displayed in theme templates. Never hardcoded; always read from meta. + - `_repo_daily_clinical_review_required` (bool, stored as '1'/'') — editorial flag marking posts that require PR Clinical Review before publication. +- **Repo Daily Admin Meta Box**: "Article Settings" meta box on repo_daily edit screen with author byline field and clinical review flag checkbox. +- **Bulk Author Migration**: On activation, sets `_repo_daily_author = 'Boo Sheeran'` on all post_type=post posts bearing the psa_source meta key (autoblogged articles). Idempotent; existing meta values preserved. Posts remain post_type=post; forward-only migration for byline retroactivity. + +### Changed +- `PR_Core_Admin::register_hooks()` now registers repo_daily metaboxes alongside peptide metaboxes. + +### Technical +- New classes: `PR_Core_Repo_Daily_CPT`, `PR_Core_Repo_Daily_Taxonomy`, `PR_Core_Repo_Daily_Metaboxes`. +- New method: `PR_Core_Activator::migrate_autoblogged_author_meta()` — idempotent bulk meta setter. +- Taxonomy seeding: `PR_Core_Repo_Daily_Taxonomy::seed_terms()` called on activation. + +### Documentation +- ARCHITECTURE.md: Added repo_daily CPT to content-type table; documented scanner exclusion by CPT separation. +- CONVENTIONS.md: Added "How to add a new post meta field to repo_daily posts" extension pattern. + ## [0.4.0] — 2026-04-27 ### Added diff --git a/CONVENTIONS.md b/CONVENTIONS.md index 0169889..7defd34 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -14,7 +14,7 @@ Autoloader convention: `PR_Core_Foo_Bar` maps to `class-pr-core-foo-bar.php`. Files live in `includes/` or one level of subdirectory under `includes/`. -## How To: Add a New Post-Meta Field +## How To: Add a New Post-Meta Field to Peptide Posts 1. Add the field to `PR_Core_Peptide_CPT::get_meta_fields()` in `cpt/class-pr-core-peptide-cpt.php`. 2. Add the field to `PR_Core_Peptide_DTO` constructor and `to_array()` in `dto/class-pr-core-peptide-dto.php`. @@ -22,6 +22,13 @@ Files live in `includes/` or one level of subdirectory under `includes/`. 4. Add a form input in `PR_Core_Peptide_Metaboxes::render_identifiers_box()` in `admin/class-pr-core-peptide-metaboxes.php`. 5. The `save_meta()` method reads from the same field list — no changes needed unless custom save logic applies. +## How To: Add a New Post-Meta Field to Repo Daily Posts + +1. Define the meta key (start with `_repo_daily_`) and sanitization logic (use `sanitize_text_field()` for strings, cast to bool for checkboxes). +2. Create a new metabox or extend `PR_Core_Repo_Daily_Metaboxes::render_meta_box()` in `admin/class-pr-core-repo-daily-metaboxes.php`. +3. In `PR_Core_Repo_Daily_Metaboxes::save_meta()`, handle the field: read from `$_POST`, sanitize, and call `update_post_meta()`. +4. Example: The `_repo_daily_clinical_review_required` checkbox checks for `isset( $_POST['key'] )` and stores `'1'` or `''`; `get_post_meta()` is type-safe because the value is always one of two strings, never a bool. + ## How To: Add a New Migration 1. Create `includes/migrations/class-pr-core-migration-NNNN-description.php`. diff --git a/includes/admin/class-pr-core-admin.php b/includes/admin/class-pr-core-admin.php index 060b292..ad54619 100644 --- a/includes/admin/class-pr-core-admin.php +++ b/includes/admin/class-pr-core-admin.php @@ -34,6 +34,11 @@ class PR_Core_Admin { add_filter( 'manage_' . PR_Core_Peptide_CPT::POST_TYPE . '_posts_columns', [ $columns, 'add_columns' ] ); add_action( 'manage_' . PR_Core_Peptide_CPT::POST_TYPE . '_posts_custom_column', [ $columns, 'render_column' ], 10, 2 ); + // Repo Daily meta boxes. + $repo_daily_metaboxes = new PR_Core_Repo_Daily_Metaboxes(); + add_action( 'add_meta_boxes', [ $repo_daily_metaboxes, 'add_meta_boxes' ] ); + add_action( 'save_post_' . PR_Core_Repo_Daily_CPT::POST_TYPE, [ $repo_daily_metaboxes, 'save_meta' ], 10, 2 ); + add_action( 'admin_menu', [ $this, 'add_admin_pages' ] ); add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_admin_styles' ] ); } diff --git a/includes/admin/class-pr-core-repo-daily-metaboxes.php b/includes/admin/class-pr-core-repo-daily-metaboxes.php new file mode 100755 index 0000000..0393d46 --- /dev/null +++ b/includes/admin/class-pr-core-repo-daily-metaboxes.php @@ -0,0 +1,113 @@ +ID, '_repo_daily_author', true ) ?: self::DEFAULT_AUTHOR + ); + $requires_review = get_post_meta( $post->ID, '_repo_daily_clinical_review_required', true ); + + echo '
| %s |