Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#48294 closed defect (bug) (fixed)

5.3 breaks counters used in submenu items

Reported by: netweblogic's profile netweblogic Owned by: johnbillion's profile johnbillion
Milestone: 5.3 Priority: normal
Severity: minor Version: 5.3
Component: Administration Keywords:
Focuses: ui Cc:


Changes in CSS for 5.3 breaks the use of counters in submenu pages. There are plugins that add counter alerts within menus for various reasons (for example, a new CPT needing revision from an admin).

Previously the snippet below would work in <5.3 and now the number is not styled:

add_action('admin_menu', function(){
        $count = '<span class="update-plugins count-10"><span class="plugin-count">10</span></span>';
        add_options_page('Example', 'Example'.$count, 'manage_options', 'example', '__return_false');

It might be worth creating a sub-menu css class, or at least warning devs of this breaking change in a blog post.

Change History (7)

#1 @SergeyBiryukov
4 years ago

  • Component changed from General to Administration
  • Focuses ui added
  • Milestone changed from Awaiting Review to 5.3

#3 @SergeyBiryukov
4 years ago

Introduced in [46453] as a follow-up to [46332].

The latest patch on #42201 appears to resolve the issue.

#4 @johnbillion
4 years ago

Note that this affects core's Dashboard -> Updates menu too.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.

4 years ago

#6 @johnbillion
4 years ago

  • Owner set to johnbillion
  • Resolution set to fixed
  • Status changed from new to closed

In 46555:

Administration: Fix the appearance of update bubbles in submenus and when the admin menu is collapsed.

Props afercia, amolv, sabernhardt

Fixes #42201, #48294

#7 @netweblogic
4 years ago

I can confirm this does fix the problem for me on latest nightlies. Thanks all!

Note: See TracTickets for help on using tickets.