Skip to content
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

feat: Automate admin notice when it is required by an extension #3204

Open
josephfusco opened this issue Sep 4, 2024 · 0 comments
Open

feat: Automate admin notice when it is required by an extension #3204

josephfusco opened this issue Sep 4, 2024 · 0 comments
Labels
type: enhancement Improvements to existing functionality

Comments

@josephfusco
Copy link
Member

josephfusco commented Sep 4, 2024

As a WPGraphQL extension author, I would like to have my WPGraphQL extension be suggested if the plugin that it depends on is active. This behavior would be similar to how WPGraphQL for ACF is suggested when both WPGraphQL and ACF are active.

register_graphql_admin_notice(
'wpgraphql-acf-announcement',
[
'type' => 'info',
'message' => __( 'You are using WPGraphQL and Advanced Custom Fields. Have you seen the new <a href="https://acf.wpgraphql.com/" target="_blank" rel="nofollow">WPGraphQL for ACF</a>?', 'wp-graphql' ),
'is_dismissable' => true,
'conditions' => static function () {
if ( ! class_exists( 'ACF' ) ) {
return false;
}
// Bail if new version of WPGraphQL for ACF is active.
if ( class_exists( 'WPGraphQLAcf' ) ) {
return false;
}
return true;
},
]
);

CleanShot 2024-09-04 at 14 14 51@2x

@josephfusco josephfusco changed the title Automate admin notice when it is required by an extension feat: Automate admin notice when it is required by an extension Sep 4, 2024
@josephfusco josephfusco added the type: enhancement Improvements to existing functionality label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvements to existing functionality
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant