Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 20, 2026

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original prompt

This section details on the original issue you should resolve

<issue_title>Implement JSON-based Post Type, Taxonomy, and Field Loading System</issue_title>
<issue_description>## Overview

Implement a JSON-based loading system for post types, taxonomies, and custom fields, similar to the Tour Operator content models system.

This will replace the current hardcoded PHP classes (class-post-types.php, class-taxonomies.php, class-fields.php) with a dynamic loader that reads from JSON configuration files.

Goals

  1. JSON-driven Configuration: Load post types, taxonomies, and SCF fields from JSON files in /post-types/ folder
  2. Maintain Mustache Templating: All generated PHP classes must retain {{mustache}} placeholders for generator compatibility
  3. Validation: Create JSON schema for post-type.json files
  4. Backward Compatibility: Existing scaffold functionality should remain intact

Reference Implementation

Github

Tour Operator Implementation:

Proposed Structure

1. Directory Structure

block-plugin-scaffold/
├── post-types/
│   ├── {{slug}}.json              # Main post type config
│   └── schema.json                # JSON Schema for validation
├── inc/
│   ├── class-post-types.php       # Modified to load from JSON
│   ├── class-taxonomies.php       # Modified to load from JSON
│   └── class-fields.php           # Modified to load from JSON
└── scripts/
    └── validate-post-types.js     # JSON validation script

2. JSON Schema Requirements

The post-type.json schema should include all parameters from:

register_post_type() Parameters

  • label (string)
  • labels (object with all label variations)
  • description (string)
  • public (boolean)
  • hierarchical (boolean)
  • exclude_from_search (boolean)
  • publicly_queryable (boolean)
  • show_ui (boolean)
  • show_in_menu (boolean|string)
  • show_in_nav_menus (boolean)
  • show_in_admin_bar (boolean)
  • show_in_rest (boolean)
  • rest_base (string)
  • rest_namespace (string)
  • rest_controller_class (string)
  • menu_position (integer)
  • menu_icon (string)
  • capability_type (string)
  • capabilities (object)
  • map_meta_cap (boolean)
  • supports (array)
  • register_meta_box_cb (string)
  • taxonomies (array)
  • has_archive (boolean|string)
  • rewrite (object|boolean)
  • query_var (boolean|string)
  • can_export (boolean)
  • delete_with_user (boolean)
  • template (array)
  • template_lock (string|boolean)
  • _builtin (boolean)
  • _edit_link (string)

register_taxonomy() Parameters

  • slug (string)
  • object_type (array) - which post types to associate with
  • labels (object)
  • description (string)
  • public (boolean)
  • publicly_queryable (boolean)
  • hierarchical (boolean)
  • show_ui (boolean)
  • show_in_menu (boolean)
  • show_in_nav_menus (boolean)
  • show_in_rest (boolean)
  • rest_base (string)
  • rest_namespace (string)
  • rest_controller_class (string)
  • show_tagcloud (boolean)
  • show_in_quick_edit (boolean)
  • show_admin_column (boolean)
  • meta_box_cb (string|boolean)
  • meta_box_sanitize_cb (string)
  • capabilities (object)
  • rewrite (object|boolean)
  • query_var (string|boolean)
  • update_count_callback (string)
  • default_term (string|array)
  • sort (boolean)
  • args (array)
  • _builtin (boolean)

SCF (Secure Custom Fields) Parameters

  • fields (array of field objects)
    • slug (string)
    • type (string) - text, textarea, number, email, url, password, wysiwyg, oembed, image, file, gallery, select, checkbox, radio, true_false, link, post_object, relationship, taxonomy, user, etc.
    • label (string)
    • description (string)
    • required (boolean)
    • conditional_logic (array)
    • wrapper (object)
    • default_value (mixed)
    • placeholder (string)
    • prepend (string)
    • append (string)
    • maxlength (integer)
    • readonly (boolean)
    • disabled (boolean)
    • return_format (string)
    • library (string)
    • min_size (string)
    • max_size (string)
    • mime_types (string)
    • choices (object) - for select/radio/checkbox
    • allow_null (boolean)
    • multiple (boolean)
    • ui (boolean)
    • ajax (boolean)
    • post_type (array)
    • taxonomy (array)
    • filters (array)
    • `visible...

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

.coderabbit.yml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: '$schema', 'path_filters', 'auto_review', 'path_instructions'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement JSON-based Post Type, Taxonomy, and Field Loading System

2 participants