Skip to content

Conversation

@jasonbahl
Copy link
Collaborator

What does this implement/fix? Explain your changes.

This PR introduces the following:

  • graphql_admin_notices_render_notices action
  • graphql_admin_notices_render_notice action
  • graphql_admin_notices_is_plugin_scoped_page filter

These actions and filters enable 3rd party codebases to hook into the rendering of admin notices registered via register_graphql_admin_notice and modify things like:

  • which page(s) the notices can be displayed on
  • styles applied to the notices

Does this close any currently open issues?

closes #3090

Any other comments?

While working on the new WPGraphQL IDE (https://github.com/wp-graphql/wpgraphql-ide) I wanted to add support for the admin notices registered via register_graphql_admin_notice() but because of the lack of actions/filters I was not able to add proper support without modifying core WPGraphQL.

By introducing these actions/filters I can now add support for GraphQL Admin Notices to additional pages, such as the new IDE.

ex:

CleanShot 2024-04-03 at 12 16 24

- introduce `graphql_admin_notices_render_notice` action
- introduce `graphql_admin_notices_is_plugin_scoped_page` filter
@jasonbahl jasonbahl requested a review from josephfusco April 3, 2024 18:17
@jasonbahl jasonbahl self-assigned this Apr 3, 2024
@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit 057cad3 and detected 0 issues on this pull request.

View more on Code Climate.

@jasonbahl jasonbahl merged commit 5f29bfd into wp-graphql:develop Apr 3, 2024
@coveralls
Copy link

coveralls commented Apr 4, 2024

Coverage Status

coverage: 84.373% (-0.02%) from 84.396%
when pulling 057cad3 on jasonbahl:feat/graphql-admin-notice-style-adjustments
into 8a790e0 on wp-graphql:develop.

@jasonbahl jasonbahl mentioned this pull request Apr 10, 2024
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.

Introduce actions/filters for the register_graphql_admin_notice API

3 participants