• I have a plugin which adds a menu page with the update_plugins capability. There is another plugin I noticed which removes the plugin icon from the menu bar, but the plugin page can still be accessed directly via URL. Instead of the plugin icon, there is only a black void (see image).

    Workarounds:
    1) When I change the update_plugins capability in the add_menu_page method to activate_plugins, the problem is resolved.
    2) If I were to have submenu pages for the plugin, the problem is resolved and the plugin icon is visible as it should be.

    To reproduce:
    1) add menu page:

    $settings_page = \add_menu_page(
        'Plugin Page Title',
        'Menu title',
        'update_plugins',
         'menu_slug',
         array( $this, 'callback_fn' ),
         'images/icon.png'
    );

    2) Remove update_plugins option from bulk operations select list (from a separate plugin):

    global $current_user;
    $current_user->allcaps['update_plugins'] = 0;

    I have using WP 5.8, PHP 8.0.8, non-multisite install (locally and on prod).
    Screenshot

    The two conflicting plugins I am using are “Pre Party Browser Hints” (adds submenu page) and “Disable All WordPress Updates (removes update_plugins operation). I suspect this could be an issue with WP core code, because it does not seem like an intentional feature.

    • This topic was modified 3 years, 2 months ago by Sam Perrow.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator t-p

    (@t-p)

    The two conflicting plugins I am using are “Pre Party Browser Hints” (adds submenu page) and “Disable All WordPress Updates (removes update_plugins operation).

    I recommend reporting the issue at the plugin’s support so the plugin’s developers and support community can help you with this.

    Thread Starter Sam Perrow

    (@samperrow)

    @t-p I am that plugins’ support. It seems like this is more likely an issue with WP core code, probably JS related, than something plugin-specific. But I can be wrong.

    Moderator t-p

    (@t-p)

    If you think you found a bug in core, Create a ticket in our bug tracker

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Plugin removes menu items with no submenu page’ is closed to new replies.