WordPress.org

Make WordPress Core

Opened 5 weeks ago

Closed 4 weeks ago

Last modified 2 weeks ago

#48294 closed defect (bug) (fixed)

5.3 breaks counters used in submenu items

Reported by: netweblogic Owned by: johnbillion
Milestone: 5.3 Priority: normal
Severity: minor Version: 5.3
Component: Administration Keywords:
Focuses: ui Cc:
PR Number:

Description

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:

<?php
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
5 weeks ago

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

#3 @SergeyBiryukov
5 weeks ago

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

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

#4 @johnbillion
5 weeks 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 weeks ago

#6 @johnbillion
4 weeks 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
2 weeks ago

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

Note: See TracTickets for help on using tickets.