-
Notifications
You must be signed in to change notification settings - Fork 0
Chore: taxonomy cleanup [round 1] #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 performs a significant cleanup of the codebase by removing taxonomy-based media classification and replacing it with a simpler meta-based approach. The changes remove dead code, unused functionality, and streamline the sync/non-sync media filtering mechanism.
- Removed custom taxonomy implementation (
onemedia_media_type) and related term restriction logic - Replaced taxonomy-based filtering with post meta-based filtering using the
is_onemedia_syncmeta key - Consolidated sync status tracking to use a single boolean meta field instead of both taxonomy terms and string-based meta values
- Removed unused AJAX handler for sync media upload and associated frontend code
- Simplified media library column display and filtering logic
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| inc/Utils.php | Removed WPVIP wrapper function term_exists() that is no longer needed |
| inc/Modules/Taxonomies/Term_Restriction.php | Deleted entire file - removed taxonomy term protection and restriction logic |
| inc/Modules/Taxonomies/Media.php | Deleted entire file - removed custom taxonomy registration for media types |
| inc/Modules/Taxonomies/Abstract_Taxonomy.php | Deleted entire file - removed abstract base class for taxonomy registration |
| inc/Modules/Rest/Media_Sharing_Controller.php | Replaced taxonomy-based filtering with meta-based queries; updated method signatures to remove taxonomy term handling; simplified sync status management |
| inc/Modules/MediaSharing/UserInterface.php | Renamed methods and updated column display to show sync status badge instead of term labels |
| inc/Modules/MediaSharing/MediaProtection.php | Removed taxonomy term assignment logic, keeping only meta-based sync status updates |
| inc/Modules/MediaSharing/MediaActions.php | Removed unused sync media upload AJAX handler and taxonomy term handling from update operations |
| inc/Modules/MediaSharing/Attachment.php | Removed taxonomy-related methods (get_terms, get_post_terms, etc.); removed string-based SYNC_STATUS_POSTMETA_KEY in favor of boolean IS_SYNC_POSTMETA_KEY; renamed update_is_syncing to set_is_sync |
| inc/Modules/MediaLibrary/ConsumerAdmin.php | Removed source column, sync filter UI, and filter query logic; simplified to use class constants for transient keys |
| inc/Modules/MediaLibrary/Admin.php | Added sync filter functionality moved from ConsumerAdmin; updated meta queries to use IS_SYNC_POSTMETA_KEY with string values '1' and '0' |
| inc/Main.php | Removed taxonomy class registrations from the main initialization |
| assets/src/css/admin.scss | Added column width styling for sync status column |
| assets/src/components/api.js | Removed unused isSyncMediaUpload parameter from uploadMedia function signature |
| assets/src/admin/media-sharing/index.js | Updated uploadMedia call to remove the removed parameter |
| assets/src/admin/media-sharing/components/browser-uploader.js | Removed sync media upload AJAX fallback logic; simplified to always use 'onemedia_replace_media' action |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
justlevine
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this 🤩 Two comments and we should be good to merge.
What
Why
Part of https://github.com/rtCamp/OnePress/issues/62
Checklist
npm run changeset.