Skip to content

Conversation

@pfefferle
Copy link
Member

@pfefferle pfefferle commented Nov 27, 2025

Proposed changes:

Adds a new Tag transformer class to handle WP_Term objects, converting them to ActivityPub OrderedCollection objects. This enables support for turning tags, categories, and custom taxonomies into federated collections in the Reader view.

  • New Transformer: Tag class in includes/transformer/class-tag.php
  • Factory Integration: Added WP_Term case to Factory::get_transformer()
  • Tests: Comprehensive PHPUnit tests for Tag transformer and Factory integration

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Create a WP_Term (tag or category) in WordPress
  • Use the Factory to get a transformer: Factory::get_transformer( $term )
  • Verify it returns a Tag transformer instance
  • Call to_object() and verify it returns an OrderedCollection
  • Run the test suite: npm run env-test -- --filter=Test_Tag

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Adds support for turning tags, categories, and custom taxonomies into federated collections in the Reader view so you can browse and follow topics more seamlessly.

Introduces the Tag transformer class to handle WP_Term objects in the Factory. The Factory now returns a Tag instance for 'WP_Term' type, enabling transformation of terms to ActivityPub objects.
Copilot AI review requested due to automatic review settings November 27, 2025 17:17
@pfefferle pfefferle self-assigned this Nov 27, 2025
Copilot finished reviewing on behalf of pfefferle November 27, 2025 17:19
@pfefferle pfefferle requested a review from obenland November 27, 2025 17:19
Copy link

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 pull request adds support for transforming WordPress WP_Term objects into ActivityPub OrderedCollection objects. The implementation introduces a new Tag transformer class that handles taxonomy terms (tags, categories, and custom taxonomies) and integrates it into the existing transformer factory pattern.

Key Changes

  • New Tag transformer class that converts WP_Term objects to ActivityPub OrderedCollection type
  • Factory pattern integration to automatically route WP_Term objects to the Tag transformer
  • Comprehensive test coverage for the new transformer and factory integration

Reviewed changes

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

File Description
includes/transformer/class-tag.php New transformer class that converts WP_Term objects to OrderedCollection ActivityPub objects with term link as ID
includes/transformer/class-factory.php Added WP_Term case to factory switch statement to instantiate Tag transformer
tests/phpunit/tests/includes/transformer/class-test-tag.php New test file with comprehensive coverage for Tag transformer functionality across different taxonomies
tests/phpunit/tests/includes/transformer/class-test-factory.php Added test case and setup for WP_Term factory integration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

pfefferle and others added 3 commits December 2, 2025 14:13
Refactored the Tag transformer class to Term, updating all references and related test files. This change improves clarity by aligning the transformer name with the WP_Term object it handles.
@pfefferle pfefferle requested a review from obenland December 2, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants