Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#19150 closed defect (bug) (fixed)

Redundant caps checks in wp_admin_bar_appearance_menu()

Reported by: duck_'s profile duck_ Owned by: duck_'s profile duck_
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.3
Component: General Keywords: has-patch
Focuses: Cc:

Description

if ( ! current_user_can('switch_themes') && ! current_user_can( 'edit_theme_options' ) )
    return;

if ( ! current_user_can( 'edit_theme_options' ) )
    return;

The first set can just be removed.

However, I think that the correct behaviour would be to display "Themes" if the user has either switch_themes or edit_theme_options and only display the rest if they have edit_theme_options.

Related: [17741] and #15931; [19006], [19026] and #18197.

Attachments (2)

19150.diff (909 bytes) - added by duck_ 12 years ago.
19150.2.diff (1.1 KB) - added by nacin 12 years ago.

Download all attachments as: .zip

Change History (4)

@duck_
12 years ago

#1 @nacin
12 years ago

  • Milestone changed from Awaiting Review to 3.3

As wp_admin_bar_appearance_menu() had the parent removed, the cap checks can be simplified quite a bit.

@nacin
12 years ago

#2 @duck_
12 years ago

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

In [19153]:

Fix caps logic in wp_admin_bar_appearance_menu(). Show Themes on either switch_themes or edit_theme_options, and the rest of the appearance items on edit_theme_options. Fixes #19150.

Note: See TracTickets for help on using tickets.