Skip to content

Bug: reorder_graphql_submenu_items() strips out other 3rd-party submenus. #3757

Description

@justlevine

Issue

When activating the plugin, other submenus registered to the graphql-ide menu get stripped out.

This is caused by WPGraphQLIDE\reorder_graphql_submenu_items

Expected Behavior

Other GraphQL submenu items should be preserved.

To test

  1. Register a custom submenu:

    add_action( 'admin_menu',
      static function() {
        add_submenu_page(
          'graphiql-ide'
          'SnapWP',
          'SnapWP',
          static function() => echo '<div>Hello World</div>',
          999
        );
      }
    );
  2. Confirm the menu item exists when WPGraphQL IDE is deactivated.
    image

  3. Activate WPGraphQL IDE and watch it disappear
    image

Additional notes.

This can be temporarily worked around by setting the admin_menu callback to a priority of > 100 so it runs after WPGraphQL IDE bugs out.

Metadata

Metadata

Labels

graphiql ideIssues or pull requests related to the GraphiQL IDEtype: bugIssue that causes incorrect or unexpected behavior

Type

No type
No fields configured for issues without a type.

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions