Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#21451 closed enhancement (fixed)

Default Widgets don't all use selected() consistently

Reported by: iamfriendly's profile iamfriendly Owned by: nacin's profile nacin
Milestone: 3.5 Priority: normal
Severity: trivial Version: 3.4.1
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description

I was looking through the default widgets /wp-includes/default-widgets.php to see how certain things were achieved (w.r.t menus) and noticed that on 3 of the default widgets the selected() function wasn't used.

Could well be reasons for this, but I couldn't spot anything obvious, so thought I'd write a very quick patch for that (attached).

It couldn't be any more minor, but thought I'd point it out anyway.

Attachments (2)

default-widgets-use-selected.diff (1.5 KB) - added by iamfriendly 13 years ago.
Patch for use of selected() in default widgets
21451.patch (1.6 KB) - added by SergeyBiryukov 13 years ago.

Download all attachments as: .zip

Change History (7)

@iamfriendly
13 years ago

Patch for use of selected() in default widgets

#1 @iamfriendly
13 years ago

As an aside, I've not produced a diff before, so I've probably got that entirely wrong. I tried to follow the instructions from the handbook and from Mark's guide, so if I've done something wrong on that front I apologise and would appreciate a point in the right direction.

#2 @SergeyBiryukov
13 years ago

  • Milestone changed from Awaiting Review to 3.5

Thanks for the patch, it looks proper. Some edits in 21451.patch:

  • Added false as a third parameter (since the result should be concatenated rather than printed directly).
  • Reformatted the last block for consistency with the first one.
  • Adjusted spaces as per the coding standards.

#3 @iamfriendly
13 years ago

Ah, nice catches Sergey. I clearly need more coffee before submitting core patches (well, diffs). If I spot any more trivialities, I'll be sure to tidy them up.

Thanks again

Last edited 13 years ago by iamfriendly (previous) (diff)

#4 @ocean90
13 years ago

  • Summary changed from (minor)Default Widgets don't all use selected() consistently to Default Widgets don't all use selected() consistently

#5 @nacin
13 years ago

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

In [21867]:

Use selected() in default widgets. props SergeyBiryukov, iamfriendly. fixes #21451.

Note: See TracTickets for help on using tickets.