WordPress.org

Make WordPress Core

Opened 9 days ago

Closed 6 days 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: trunk
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 (6)

#1 @SergeyBiryukov
9 days ago

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

#3 @SergeyBiryukov
8 days ago

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

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

#4 @johnbillion
8 days ago

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

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


6 days ago

#6 @johnbillion
6 days 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

Note: See TracTickets for help on using tickets.