WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 8 years ago

#5480 closed enhancement (worksforme)

Main navigation move 'current' class declaration from <a> to <li>

Reported by: oaoao Owned by: hempsworth
Milestone: Priority: normal
Severity: normal Version: 2.5
Component: UI Keywords:
Focuses: Cc:

Description

The format of the ul-based admin navigation puts the "current" class in the link itself:

<ul id="adminmenu">
<li><a href='themes.php'>Presentation</a></li>
<li><a href='options-general.php' class="current">Options</a></li>

This is bad, and makes styling difficult. It should be in the <li> element, as children can be targeted, but not parents.

<li class="current"><a href='options-general.php'>Options</a></li>

You can always target the link as before with

li.current a

And now you can also style the <li> element, as many tab-based CSS approaches require.

This requires a change in: menu-header.php wp-admin.css

Attachments (3)

move-class-main-navigation.patch (1.7 KB) - added by hempsworth 10 years ago.
This changes the position of the classname just in the main navigation
move-class-all-navigation.patch (5.6 KB) - added by hempsworth 10 years ago.
This changes the position of the classname in all of the navigation menus
5480.patch (6.5 KB) - added by hempsworth 10 years ago.
Now works fine with #5868

Download all attachments as: .zip

Change History (11)

#1 @hempsworth
10 years ago

  • Keywords admin nav removed
  • Milestone changed from 2.5 to 2.6
  • Owner changed from anonymous to hempsworth
  • Status changed from new to assigned
  • Summary changed from Enhance admin navigation CSS style by moving class declaration to proper location to Main navigation move 'current' class declaration from <a> to <li>
  • Type changed from defect to enhancement
  • Version set to 2.5

Definitely agree with this, I was surprised to see the current method when I was making the patch for #5868

I'm going to make two patches, one which changes the position of [class="current"] just in the main navigation, and one which changes it for all of the navigation lists.

Ideally we want the latter, but I'm unsure as to whether it might break some plugins?

@hempsworth
10 years ago

This changes the position of the classname just in the main navigation

@hempsworth
10 years ago

This changes the position of the classname in all of the navigation menus

#2 @hempsworth
10 years ago

  • Keywords has-patch added
  • Resolution set to fixed
  • Status changed from assigned to closed

#3 @hempsworth
10 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Oops, sorry about that! Needs to be committed first :P

#4 @ryan
10 years ago

Patch breaks the fix for #5868. If we can fix that, I'm all for committing this.

@hempsworth
10 years ago

Now works fine with #5868

#5 @Denis-de-Bernardy
9 years ago

  • Component changed from Administration to UI
  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 2.9 to Future Release

#6 @johnbillion
8 years ago

  • Keywords needs-patch removed
  • Milestone Future Release deleted
  • Resolution set to fixed
  • Status changed from reopened to closed

Stale ticket.

(Quite funny to see how quaint the admin menu markup was 2 years ago...)

#7 @nacin
8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#8 @nacin
8 years ago

  • Resolution set to worksforme
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.