Skip to content

Update/removing tags - #175

Open
amerk-sitecrafting wants to merge 5 commits into
mainfrom
update/removing-tags
Open

Update/removing tags#175
amerk-sitecrafting wants to merge 5 commits into
mainfrom
update/removing-tags

Conversation

@amerk-sitecrafting

Copy link
Copy Markdown
Contributor

Ticket: # 234

Issue

Currently, removing tags is functionality that is hardcoded in Groot.

Solution

This update extracts that logic from Groot and adds it to Conifer's Site.php class. It also exposes additional functionality, allowing downstream users to explicitly disable tag support for specified post types.

Impact

This shouldn't affect any sites.

Usage Changes

Conifer now has a public disable_tags_for_post_types function which takes an array of post types and disables tags and unregisters taxonomies for those post types.

It also includes a private disable_tags function, which disables tags for all post types excluding tribe_events.

Considerations

There is one included comment in the code for a future consideration, Site.php:864

Testing

This update passes all tests and PHPStan

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 moves tag-removal behavior into Conifer\Site, adds a new public helper for disabling tags on selected post types, and documents the new capability while adding integration tests to validate expected behavior.

Changes:

  • Added Site::disable_tags_for_post_types() plus private helpers to remove post_tag taxonomy associations.
  • Added an integration test suite covering tag-removal behavior (including excluded post types).
  • Updated docs/site.md with corrected wording and new “Disabling Tags” documentation.

Reviewed changes

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

File Description
test/integration/SiteTagRemovalTest.php Adds integration coverage for tag-removal helpers on Conifer\Site.
lib/Conifer/Site.php Introduces new tag-removal methods and internal implementation.
docs/site.md Fixes typos/wording and documents how to disable tags for specific post types.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/integration/SiteTagRemovalTest.php
Comment thread lib/Conifer/Site.php
Comment on lines +841 to +846
public function disable_tags_for_post_types(array $postTypes): void
{
foreach ($postTypes as $postType) {
$this->disable_tags_for_post_type($postType);
}
}
Comment thread lib/Conifer/Site.php
Comment on lines +888 to +893
private function disable_tags_for_post_type(string $postType): bool
{
remove_post_type_support($postType, 'post_tag');

return unregister_taxonomy_for_object_type('post_tag', $postType);
}
Comment thread lib/Conifer/Site.php
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploying conifer-plugin with  Cloudflare Pages  Cloudflare Pages

Latest commit: e49e397
Status: ✅  Deploy successful!
Preview URL: https://6e390db6.conifer-plugin.pages.dev
Branch Preview URL: https://update-removing-tags.conifer-plugin.pages.dev

View logs

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