Skip to content

Conversation

@GeoffDusome
Copy link
Contributor

@GeoffDusome GeoffDusome commented Sep 2, 2025

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:

  • Added 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).
  • Added rule classes implementing Rule_Interface to encapsulate announcement display logic:
  • Added Announcement_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:

  • Registered new announcement-related block types (tribe/announcement-renderer, tribe/announcements) in the block definer (wp-content/plugins/core/src/Blocks/Blocks_Definer.php).
  • Registered the Announcement_Subscriber post type and the Announcement_Meta meta 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:

  • Updated the PHPStan configuration to exclude the wp-content/themes/core/dist/ directory from static analysis (phpstan.neon.dist).

QA

Links to relevant issues

Screenshots/video:

Test Environment:

@GeoffDusome GeoffDusome self-assigned this Sep 2, 2025
@GeoffDusome GeoffDusome added the Launch Environment Deploys to dokku label Sep 2, 2025
@GeoffDusome GeoffDusome marked this pull request as ready for review September 2, 2025 14:23
@dotjon dotjon added Launch Environment Deploys to dokku and removed Launch Environment Deploys to dokku labels Oct 17, 2025
@GeoffDusome
Copy link
Contributor Author

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.

Copy link
Collaborator

@dpellenwood dpellenwood left a 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,
Copy link
Collaborator

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,
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@GeoffDusome GeoffDusome added the In QA Waiting on QA label Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In QA Waiting on QA Launch Environment Deploys to dokku

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants