-
Notifications
You must be signed in to change notification settings - Fork 5
[FEATURE] Announcements #245
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: main
Are you sure you want to change the base?
Conversation
…-block [MOOSE-263] FE Announcement Block
…eduling_Rule.php Co-authored-by: Copilot <[email protected]>
…se into feature/announcements-be
Co-authored-by: Copilot <[email protected]>
…se into feature/announcements-be
Feature/announcements be
|
Hey @dpellenwood I believe both the FE & BE have gone through code reviews but I'd like to get another once-over on the whole feature from you before we merge. I'm going to get this feature into DQA/QA though, so no rush. |
dpellenwood
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.
🟢 Just one tiny suggestion., This is good to merge, imho!
| 'index.php', | ||
| 'separator1', | ||
| 'edit.php?post_type=page', | ||
| 'edit.php?post_type=' . Page::NAME, |
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.
😍
| 'edit.php', | ||
| 'upload.php', | ||
| 'gf_edit_forms', | ||
| 'edit.php?post_type=' . Announcement::NAME, |
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.
Nit-picky, but I wonder if announcements should come before forms?
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.
I'll confirm this in QA. I wasn't sure where it made most sense.
What does this do/fix?
This pull request introduces a new Announcements feature to the core plugin, enabling the definition, filtering, and rendering of announcements based on placement, page visibility, scheduling, and other rules. The implementation is modular, using a controller and a set of rule classes to determine which announcements should be shown in various contexts. Additionally, the necessary dependencies and block types are registered.
Announcements feature implementation:
Announcement_Controller, which retrieves and filters announcements for a given placement using a rule pipeline (placement, front page, page visibility, scheduling) (wp-content/plugins/core/src/Components/Announcements/Announcement_Controller.php).Rule_Interfaceto encapsulate announcement display logic:Placement_Rule: Filters by placementFront_Page_Rule: Handles front page display logicPage_Visibility_Rule: Handles inclusion/exclusion by page, taxonomy, or post typeScheduling_Rule: Enables time-based scheduling for announcementsRule_Interface: Defines the contract for all rulesAnnouncement_Renderer, which generates block markup for announcements and renders them as HTML (wp-content/plugins/core/src/Components/Announcements/Announcement_Renderer.php).Integration and registration:
tribe/announcement-renderer,tribe/announcements) in the block definer (wp-content/plugins/core/src/Blocks/Blocks_Definer.php).Announcement_Subscriberpost type and theAnnouncement_Metameta object in the core plugin and meta definer, respectively (wp-content/plugins/core/src/Core.php,wp-content/plugins/core/src/Object_Meta/Meta_Definer.php) [1] [2] [3].Developer tooling:
wp-content/themes/core/dist/directory from static analysis (phpstan.neon.dist).QA
Links to relevant issues
Screenshots/video:
Test Environment: