Wp-graphql: Provide option to remove "GraphiQL IDE" toolbar button

Created on 30 Sep 2020  路  3Comments  路  Source: wp-graphql/wp-graphql

Hey guys, I don't want to have a link to the GraphiQL IDE in my admin toolbar.

image

Please provide a way to remove it.

Actionable Good First Issue

Most helpful comment

@benknight I'll work up a PR to provide a setting to enable/disable this link.

In the mean time, you can filter it out like so:

add_action( 'admin_bar_menu', 'remove_graphiql_from_admin_bar_menu', 999 );

function remove_graphiql_from_admin_bar_menu( $wp_admin_bar ) {
    // replace 'updraft_admin_node' with your node id
    $wp_admin_bar->remove_node( 'graphiql-ide' );
}

All 3 comments

@benknight I'll work up a PR to provide a setting to enable/disable this link.

In the mean time, you can filter it out like so:

add_action( 'admin_bar_menu', 'remove_graphiql_from_admin_bar_menu', 999 );

function remove_graphiql_from_admin_bar_menu( $wp_admin_bar ) {
    // replace 'updraft_admin_node' with your node id
    $wp_admin_bar->remove_node( 'graphiql-ide' );
}

Thanks for the quick follow-up!

My PR didn't really note this but there's now a setting to turn this off. Noting here for reference.

Screen Shot 2020-10-02 at 12 37 27 AM

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasonbahl picture jasonbahl  路  4Comments

jasonbahl picture jasonbahl  路  4Comments

TylerBarnes picture TylerBarnes  路  4Comments

TylerBarnes picture TylerBarnes  路  4Comments

BE-Webdesign picture BE-Webdesign  路  3Comments