-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CMM-814 hide or show taxonomies in the menu depending on the server configuration #22255
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
base: trunk
Are you sure you want to change the base?
CMM-814 hide or show taxonomies in the menu depending on the server configuration #22255
Conversation
Generated by 🚫 Danger |
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 implements dynamic taxonomies display in the site settings menu based on server configuration. The system fetches taxonomy information from self-hosted WordPress sites and shows only those taxonomies that are configured to appear in navigation menus.
- Adds a new ViewModel to fetch and filter taxonomies from the WordPress API
- Updates the site settings UI to dynamically display taxonomy preferences based on server response
- Removes hardcoded writing section preferences in favor of dynamic taxonomy handling
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
strings.xml | Adds "Taxonomies" title string for the new preference section |
key_strings.xml | Adds preference key for taxonomies section |
TaxonomiesNavMenuViewModel.kt | New ViewModel that fetches taxonomies and filters by nav menu visibility |
SiteSettingsFragment.java | Integrates taxonomy fetching and dynamically creates preference UI |
ViewModelModule.java | Registers the new ViewModel for dependency injection |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java
Outdated
Show resolved
Hide resolved
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22255-b3e623b | |
Commit | b3e623b | |
Direct Download | jetpack-prototype-build-pr22255-b3e623b.apk |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22255-b3e623b | |
Commit | b3e623b | |
Direct Download | wordpress-prototype-build-pr22255-b3e623b.apk |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #22255 +/- ##
==========================================
+ Coverage 39.91% 39.93% +0.01%
==========================================
Files 2165 2166 +1
Lines 102511 102536 +25
Branches 14771 14774 +3
==========================================
+ Hits 40922 40945 +23
- Misses 58122 58123 +1
- Partials 3467 3468 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Code looks good. Test plan succeeded for me. That said...
This PR implements dynamic taxonomies display in the site settings menu based on server configuration. The system fetches taxonomy information from self-hosted WordPress sites and shows only those taxonomies that are configured to appear in navigation menus.
Why do we toggle visibility in the app based upon show_in_nav_menus
? My perception is that this property is used for controlling taxonomy visibility when creating WordPress menus rendered on a site's front end. Is my understanding incorrect?
An aside: this currently includes changes from #22252 due to the stacked branch and recent merge. Unsure if it is worth rebase or not.
…-menu-depending-on-the-server-configuration
My bad because of wrong targeting. Fixed! |
|
If I understood it correctly, we don't want to show all the given taxonomies if the visibility setting is set to false. I see now that I might be using Related question to @jkmassel too: On https://cpt.wpmt.co/wp-admin/ I don't see Categories and Tags, but the response when requesting taxonomies doesn't contain any ![]() |
@adalpari is correct – not all taxonomies are user-facing, and custom-registered ones might deliberately not want to be. We want to match the behaviour of |
Thank you for elaborating. I understand and agree with the desired outcome. However, my understanding from |
I think you are right. I'll go with those ones. |
Description
This PR implements dynamic taxonomies display in the site settings menu based on server configuration. The system fetches taxonomy information from self-hosted WordPress sites and shows only those taxonomies that are configured to appear in navigation menus.
Important note: Categories and Tags are the only supported taxonomies until we build the TaxonomyDataView. So, the current screen calls are hardcoded.
Testing instructions
Screen.Recording.2025-10-02.at.18.15.57.mov