Skip to content

Feature: template sharing#18

Closed
up1512001 wants to merge 28 commits intomainfrom
chore/template
Closed

Feature: template sharing#18
up1512001 wants to merge 28 commits intomainfrom
chore/template

Conversation

@up1512001
Copy link
Member

@up1512001 up1512001 commented Oct 6, 2025

  • added templates posts type and by default creating one for template sharing.
  • fix release workflow.
  • added utils/constants classes for better code quality.
  • added pot command to generate onedesign.pot file
  • separate out Patterns & Templates REST files.

@up1512001 up1512001 self-assigned this Oct 6, 2025
@up1512001 up1512001 requested a review from Copilot October 6, 2025 06:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a comprehensive template sharing feature for the OneDesign plugin, enabling templates to be shared across connected sites along with their associated patterns and template parts. The implementation includes a new Templates post type, REST API endpoints for template management, utility functions for template processing, and a React-based admin interface for template management.

Key changes:

  • Added template sharing functionality with Templates post type and REST endpoints
  • Implemented utility classes for constants management and common functions
  • Added comprehensive template library UI with site selection and template management
  • Fixed release workflow and improved code organization by separating Patterns and Templates REST classes

Reviewed Changes

Copilot reviewed 30 out of 31 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
webpack.config.js Added templates-library entry point for new template management interface
uninstall.php Enhanced cleanup to remove template-related options and posts on uninstall
languages/onedesign.pot Updated translation file with new template-related strings and corrected URLs
inc/helpers/custom-functions.php Added template parsing utility function for extracting blocks, template parts, and patterns
inc/classes/rest/class-templates.php New REST API class for template sharing endpoints including apply, remove, and sync operations
inc/classes/rest/class-patterns.php Extracted patterns-specific REST functionality from main REST class
inc/classes/post-type/class-template.php New Templates post type registration
inc/classes/plugin-configs/class-constants.php New constants management class for better code organization
inc/classes/class-utils.php New utility class with site management and template processing functions
inc/classes/class-settings.php Added Templates submenu and redirect handling for template management
inc/classes/class-rest.php Refactored to instantiate separate Patterns and Templates REST classes
inc/classes/class-plugin.php Added Template post type initialization
inc/classes/class-hooks.php Enhanced with template creation logic and block type restrictions
inc/classes/class-cpt-restriction.php Extended restrictions to include Templates post type
inc/classes/class-assets.php Added template library script and style enqueuing
composer.json Added pot generation script and custom functions autoloading
assets/src/* New React components and utilities for template management interface
.github/workflows/release_on_tag.yml Fixed release workflow to include uninstall.php and corrected title format
.eslintrc Added TemplateLibraryData global for ESLint

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Utsav Patel <75293077+up1512001@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@up1512001 up1512001 requested a review from Copilot October 6, 2025 11:19
@up1512001 up1512001 marked this pull request as ready for review October 6, 2025 11:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 30 out of 31 changed files in this pull request and generated 5 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@up1512001
Copy link
Member Author

The Copilot review focuses on removing PHP function return types & parameter return types, which are supported as of 8.0+.

@up1512001 up1512001 removed the request for review from vishalkakadiya October 14, 2025 05:52
@up1512001
Copy link
Member Author

Closing this PR in favor of #19

@up1512001 up1512001 closed this Oct 14, 2025
@up1512001 up1512001 deleted the chore/template branch October 17, 2025 11:14
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.

2 participants