Skip to content

Fix: Render notices after page actions if present#14

Merged
JasonTheAdams merged 4 commits intomainfrom
fix/render-notice-below-page-actions
Jul 10, 2025
Merged

Fix: Render notices after page actions if present#14
JasonTheAdams merged 4 commits intomainfrom
fix/render-notice-below-page-actions

Conversation

@JoshuaHungDinh
Copy link
Contributor

@JoshuaHungDinh JoshuaHungDinh commented Jul 10, 2025

Description

On certain admin pages, such as the Plugins page, there is a page action link (e.g., "Add Plugin") displayed immediately after the H1 header. Currently, notices with the below_header location are rendered directly after the H1 tag, which places them between the header and the page action. This can lead to an inconsistent and visually confusing user interface.

This PR introduces a conditional check for the presence of a page title action element. If the element exists, notices with the location set to below_header will be rendered immediately after the page action instead of directly after the H1, ensuring a more consistent and intuitive layout.

Also updates the GitHub Actions workflow to use actions/cache@v4 instead of the deprecated v2 version. This change resolves the deprecation error in the unit tests.

Affects

Admin notices rendered with below_header on pages with page-title-action links.

Visuals

Issue

Screenshot 2025-07-09 at 8 58 04 PM

Resolved

Screenshot 2025-07-09 at 9 06 49 PM

Testing Instructions

  • Render a notice on the plugins page.
  • Set the location to below_header.
  • Verify the notice renders after the "Add Plugins" link.
  • Verify the notice renders properly after the H1 on any other admin page.

Copy link
Contributor

@JasonTheAdams JasonTheAdams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @JoshuaHungDinh! One little suggestion!

@jdghinson
Copy link

@JoshuaHungDinh Can you add a hover state to the explore campaign button?

@JasonTheAdams
Copy link
Contributor

Wrong repo, @jdghinson. 😄

This is an independent package that displays admin notices in WordPress. It has no specific tie to GiveWP.

@JasonTheAdams JasonTheAdams merged commit 1d4c25a into main Jul 10, 2025
2 checks passed
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.

3 participants